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 "SystemZMCAsmInfo.h"
11 #include "SystemZTargetMachine.h"
13 #include "llvm/PassManager.h"
14 #include "llvm/Target/TargetRegistry.h"
17 extern "C" void LLVMInitializeSystemZTarget() {
18 // Register the target.
19 RegisterTargetMachine<SystemZTargetMachine> X(TheSystemZTarget);
20 RegisterAsmInfo<SystemZMCAsmInfo> Y(TheSystemZTarget);
23 /// SystemZTargetMachine ctor - Create an ILP64 architecture model
25 SystemZTargetMachine::SystemZTargetMachine(const Target &T,
26 const std::string &TT,
27 const std::string &CPU,
28 const std::string &FS)
29 : LLVMTargetMachine(T, TT),
30 Subtarget(TT, CPU, FS),
31 DataLayout("E-p:64:64:64-i8:8:16-i16:16:16-i32:32:32-i64:64:64-f32:32:32"
32 "-f64:64:64-f128:128:128-a0:16:16-n32:64"),
33 InstrInfo(*this), TLInfo(*this), TSInfo(*this),
34 FrameLowering(Subtarget) {
36 if (getRelocationModel() == Reloc::Default)
37 setRelocationModel(Reloc::Static);
40 bool SystemZTargetMachine::addInstSelector(PassManagerBase &PM,
41 CodeGenOpt::Level OptLevel) {
42 // Install an instruction selector.
43 PM.add(createSystemZISelDag(*this, OptLevel));