diff options
Diffstat (limited to 'lib/Target/XCore/XCoreTargetMachine.cpp')
-rw-r--r-- | lib/Target/XCore/XCoreTargetMachine.cpp | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/lib/Target/XCore/XCoreTargetMachine.cpp b/lib/Target/XCore/XCoreTargetMachine.cpp index 0fa8c21..7998fc1 100644 --- a/lib/Target/XCore/XCoreTargetMachine.cpp +++ b/lib/Target/XCore/XCoreTargetMachine.cpp @@ -12,10 +12,11 @@ #include "XCoreTargetMachine.h" #include "XCoreTargetObjectFile.h" +#include "XCoreTargetTransformInfo.h" #include "XCore.h" #include "llvm/CodeGen/Passes.h" #include "llvm/IR/Module.h" -#include "llvm/PassManager.h" +#include "llvm/IR/LegacyPassManager.h" #include "llvm/Support/TargetRegistry.h" using namespace llvm; @@ -28,6 +29,7 @@ XCoreTargetMachine::XCoreTargetMachine(const Target &T, StringRef TT, CodeGenOpt::Level OL) : LLVMTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL), TLOF(make_unique<XCoreTargetObjectFile>()), + DL("e-m:e-p:32:32-i1:8:32-i8:8:32-i16:16:32-i64:32-f64:32-a:0:32-n32"), Subtarget(TT, CPU, FS, *this) { initAsmInfo(); } @@ -48,7 +50,7 @@ public: void addIRPasses() override; bool addPreISel() override; bool addInstSelector() override; - bool addPreEmitPass() override; + void addPreEmitPass() override; }; } // namespace @@ -72,9 +74,8 @@ bool XCorePassConfig::addInstSelector() { return false; } -bool XCorePassConfig::addPreEmitPass() { - addPass(createXCoreFrameToArgsOffsetEliminationPass()); - return false; +void XCorePassConfig::addPreEmitPass() { + addPass(createXCoreFrameToArgsOffsetEliminationPass(), false); } // Force static initialization. @@ -82,10 +83,7 @@ extern "C" void LLVMInitializeXCoreTarget() { RegisterTargetMachine<XCoreTargetMachine> X(TheXCoreTarget); } -void XCoreTargetMachine::addAnalysisPasses(PassManagerBase &PM) { - // Add first the target-independent BasicTTI pass, then our XCore pass. This - // allows the XCore pass to delegate to the target independent layer when - // appropriate. - PM.add(createBasicTargetTransformInfoPass(this)); - PM.add(createXCoreTargetTransformInfoPass(this)); +TargetIRAnalysis XCoreTargetMachine::getTargetIRAnalysis() { + return TargetIRAnalysis( + [this](Function &) { return TargetTransformInfo(XCoreTTIImpl(this)); }); } |