1 //===-- SystemZTargetMachine.cpp - Define TargetMachine for SystemZ -------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #include "SystemZTargetMachine.h"
12 #include "llvm/PassManager.h"
13 #include "llvm/Target/TargetRegistry.h"
16 extern "C" void LLVMInitializeSystemZTarget() {
17 // Register the target.
18 RegisterTargetMachine<SystemZTargetMachine> X(TheSystemZTarget);
21 /// SystemZTargetMachine ctor - Create an ILP64 architecture model
23 SystemZTargetMachine::SystemZTargetMachine(const Target &T,
24 const std::string &TT,
25 const std::string &CPU,
26 const std::string &FS)
27 : LLVMTargetMachine(T, TT, CPU, FS),
28 Subtarget(TT, CPU, FS),
29 DataLayout("E-p:64:64:64-i8:8:16-i16:16:16-i32:32:32-i64:64:64-f32:32:32"
30 "-f64:64:64-f128:128:128-a0:16:16-n32:64"),
31 InstrInfo(*this), TLInfo(*this), TSInfo(*this),
32 FrameLowering(Subtarget) {
34 if (getRelocationModel() == Reloc::Default)
35 setRelocationModel(Reloc::Static);
38 bool SystemZTargetMachine::addInstSelector(PassManagerBase &PM,
39 CodeGenOpt::Level OptLevel) {
40 // Install an instruction selector.
41 PM.add(createSystemZISelDag(*this, OptLevel));