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 &FS)
28 : LLVMTargetMachine(T, TT),
30 DataLayout("E-p:64:64:64-i8:8:16-i16:16:16-i32:32:32-i64:64:64-f32:32:32"
31 "-f64:64:64-f128:128:128-a0:16:16-n32:64"),
32 InstrInfo(*this), TLInfo(*this), TSInfo(*this),
33 FrameLowering(Subtarget) {
35 if (getRelocationModel() == Reloc::Default)
36 setRelocationModel(Reloc::Static);
39 bool SystemZTargetMachine::addInstSelector(PassManagerBase &PM,
40 CodeGenOpt::Level OptLevel) {
41 // Install an instruction selector.
42 PM.add(createSystemZISelDag(*this, OptLevel));