diff --git a/lib/Target/X86/X86CallFrameOptimization.cpp b/lib/Target/X86/X86CallFrameOptimization.cpp index d6563c2f271..5e8d37431e1 100644 --- a/lib/Target/X86/X86CallFrameOptimization.cpp +++ b/lib/Target/X86/X86CallFrameOptimization.cpp @@ -117,7 +117,7 @@ bool X86CallFrameOptimization::isLegal(MachineFunction &MF) { // No point in running this in 64-bit mode, since some arguments are // passed in-register in all common calling conventions, so the pattern // we're looking for will never match. - const X86Subtarget &STI = MF.getTarget().getSubtarget(); + const X86Subtarget &STI = MF.getSubtarget(); if (STI.is64Bit()) return false; @@ -402,7 +402,7 @@ bool X86CallFrameOptimization::adjustCallSequence(MachineFunction &MF, // If PUSHrmm is not slow on this target, try to fold the source of the // push into the instruction. - const X86Subtarget &ST = MF.getTarget().getSubtarget(); + const X86Subtarget &ST = MF.getSubtarget(); bool SlowPUSHrmm = ST.isAtom() || ST.isSLM(); // Check that this is legal to fold. Right now, we're extremely diff --git a/lib/Target/X86/X86FixupLEAs.cpp b/lib/Target/X86/X86FixupLEAs.cpp index bc23f9d63cf..b39c5aba30b 100644 --- a/lib/Target/X86/X86FixupLEAs.cpp +++ b/lib/Target/X86/X86FixupLEAs.cpp @@ -88,7 +88,6 @@ public: private: MachineFunction *MF; - const TargetMachine *TM; const X86InstrInfo *TII; // Machine instruction info. }; char FixupLEAPass::ID = 0; @@ -150,8 +149,7 @@ FunctionPass *llvm::createX86FixupLEAs() { return new FixupLEAPass(); } bool FixupLEAPass::runOnMachineFunction(MachineFunction &Func) { MF = &Func; - TM = &Func.getTarget(); - const X86Subtarget &ST = TM->getSubtarget(); + const X86Subtarget &ST = Func.getSubtarget(); if (!ST.LEAusesAG() && !ST.slowLEA()) return false; @@ -332,7 +330,7 @@ bool FixupLEAPass::processBasicBlock(MachineFunction &MF, MachineFunction::iterator MFI) { for (MachineBasicBlock::iterator I = MFI->begin(); I != MFI->end(); ++I) { - if (TM->getSubtarget().isSLM()) + if (MF.getSubtarget().isSLM()) processInstructionForSLM(I, MFI); else processInstruction(I, MFI);