Use cached subtargets inside X86FixupLEAs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228333 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Christopher 2015-02-05 19:27:01 +00:00
parent d63e18f179
commit 3e68370c22

View File

@ -155,8 +155,7 @@ bool FixupLEAPass::runOnMachineFunction(MachineFunction &Func) {
if (!ST.LEAusesAG() && !ST.slowLEA())
return false;
TII =
static_cast<const X86InstrInfo *>(TM->getSubtargetImpl()->getInstrInfo());
TII = ST.getInstrInfo();
DEBUG(dbgs() << "Start X86FixupLEAs\n";);
// Process all basic blocks.
@ -219,7 +218,7 @@ FixupLEAPass::searchBackwards(MachineOperand &p, MachineBasicBlock::iterator &I,
return CurInst;
}
InstrDistance += TII->getInstrLatency(
TM->getSubtargetImpl()->getInstrItineraryData(), CurInst);
MF->getSubtarget().getInstrItineraryData(), CurInst);
Found = getPreviousInstr(CurInst, MFI);
}
return nullptr;