diff options
author | Evan Cheng <evan.cheng@apple.com> | 2006-03-13 23:20:37 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2006-03-13 23:20:37 +0000 |
commit | c4c6257c1a154279bf10e9498d46d6c1793dbaa7 (patch) | |
tree | 82eef3bf2df210e48dfb0aad717dc0649936e7db /lib/Target/X86/X86TargetMachine.cpp | |
parent | e617b085fe20e3fd6ab21d0a3943140c5f1c9ff7 (diff) |
Added getTargetLowering() to TargetMachine. Refactored targets to support this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26742 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86TargetMachine.cpp')
-rw-r--r-- | lib/Target/X86/X86TargetMachine.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Target/X86/X86TargetMachine.cpp b/lib/Target/X86/X86TargetMachine.cpp index de7004d97a..2de8cc0b61 100644 --- a/lib/Target/X86/X86TargetMachine.cpp +++ b/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()); |