blob: afa455ea25c0308c6d51ef3cfaab796d883831d7 [file] [log] [blame]
Daniel Dunbar0c795d62009-07-25 06:49:55 +00001//===-- SystemZTargetMachine.cpp - Define TargetMachine for SystemZ -------===//
Anton Korobeynikov4403b932009-07-16 13:27:25 +00002//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
Anton Korobeynikov4403b932009-07-16 13:27:25 +00009
Anton Korobeynikov4403b932009-07-16 13:27:25 +000010#include "SystemZTargetMachine.h"
11#include "SystemZ.h"
Anton Korobeynikov4403b932009-07-16 13:27:25 +000012#include "llvm/PassManager.h"
Daniel Dunbar0c795d62009-07-25 06:49:55 +000013#include "llvm/Target/TargetRegistry.h"
Anton Korobeynikov4403b932009-07-16 13:27:25 +000014using namespace llvm;
15
Anton Korobeynikov7df84622009-07-16 14:36:52 +000016extern "C" void LLVMInitializeSystemZTarget() {
Daniel Dunbar0c795d62009-07-25 06:49:55 +000017 // Register the target.
18 RegisterTargetMachine<SystemZTargetMachine> X(TheSystemZTarget);
Anton Korobeynikov4403b932009-07-16 13:27:25 +000019}
20
21/// SystemZTargetMachine ctor - Create an ILP64 architecture model
22///
Anton Korobeynikov7df84622009-07-16 14:36:52 +000023SystemZTargetMachine::SystemZTargetMachine(const Target &T,
Evan Cheng43966132011-07-19 06:37:02 +000024 StringRef TT,
25 StringRef CPU,
26 StringRef FS, Reloc::Model RM)
27 : LLVMTargetMachine(T, TT, CPU, FS, RM),
Evan Cheng276365d2011-06-30 01:53:36 +000028 Subtarget(TT, CPU, FS),
Anton Korobeynikov7df84622009-07-16 14:36:52 +000029 DataLayout("E-p:64:64:64-i8:8:16-i16:16:16-i32:32:32-i64:64:64-f32:32:32"
Chris Lattner59a91782009-11-07 19:07:32 +000030 "-f64:64:64-f128:128:128-a0:16:16-n32:64"),
Dan Gohmanff7a5622010-05-11 17:31:57 +000031 InstrInfo(*this), TLInfo(*this), TSInfo(*this),
Anton Korobeynikov16c29b52011-01-10 12:39:04 +000032 FrameLowering(Subtarget) {
Anton Korobeynikov4403b932009-07-16 13:27:25 +000033}
34
35bool SystemZTargetMachine::addInstSelector(PassManagerBase &PM,
36 CodeGenOpt::Level OptLevel) {
37 // Install an instruction selector.
38 PM.add(createSystemZISelDag(*this, OptLevel));
39 return false;
40}