diff options
Diffstat (limited to 'llvm/lib/Target/X86/X86TargetMachine.cpp')
-rw-r--r-- | llvm/lib/Target/X86/X86TargetMachine.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/Target/X86/X86TargetMachine.cpp b/llvm/lib/Target/X86/X86TargetMachine.cpp index de7004d97a0..2de8cc0b613 100644 --- a/llvm/lib/Target/X86/X86TargetMachine.cpp +++ b/llvm/lib/Target/X86/X86TargetMachine.cpp @@ -79,7 +79,7 @@ X86TargetMachine::X86TargetMachine(const Module &M, Subtarget(M, FS), FrameInfo(TargetFrameInfo::StackGrowsDown, Subtarget.getStackAlignment(), -4), - JITInfo(*this) { + JITInfo(*this), TLInfo(*this) { if (getRelocationModel() == Reloc::Default) if (Subtarget.isTargetDarwin()) setRelocationModel(Reloc::DynamicNoPIC); @@ -97,7 +97,7 @@ bool X86TargetMachine::addPassesToEmitFile(PassManager &PM, std::ostream &Out, FileType != TargetMachine::ObjectFile) return true; // Run loop strength reduction before anything else. - if (EnableX86LSR) PM.add(createLoopStrengthReducePass()); + if (EnableX86LSR) PM.add(createLoopStrengthReducePass(1, &TLInfo)); // FIXME: Implement efficient support for garbage collection intrinsics. PM.add(createLowerGCPass()); @@ -164,6 +164,10 @@ void X86JITInfo::addPassesToJITCompile(FunctionPassManager &PM) { // The JIT should use static relocation model. TM.setRelocationModel(Reloc::Static); + // Run loop strength reduction before anything else. + if (EnableX86LSR) + PM.add(createLoopStrengthReducePass(1, TM.getTargetLowering())); + // FIXME: Implement efficient support for garbage collection intrinsics. PM.add(createLowerGCPass()); |