Move some more instruction creation methods from RegisterInfo into InstrInfo.
llvm-svn: 45484
This commit is contained in:
@@ -276,6 +276,9 @@ void RALocal::spillVirtReg(MachineBasicBlock &MBB,
|
||||
" the intended one.");
|
||||
DOUT << " Spilling register " << MRI->getName(PhysReg)
|
||||
<< " containing %reg" << VirtReg;
|
||||
|
||||
const TargetInstrInfo* TII = MBB.getParent()->getTarget().getInstrInfo();
|
||||
|
||||
if (!isVirtRegModified(VirtReg))
|
||||
DOUT << " which has not been modified, so no store necessary!";
|
||||
|
||||
@@ -286,7 +289,7 @@ void RALocal::spillVirtReg(MachineBasicBlock &MBB,
|
||||
const TargetRegisterClass *RC = MF->getRegInfo().getRegClass(VirtReg);
|
||||
int FrameIndex = getStackSpaceFor(VirtReg, RC);
|
||||
DOUT << " to stack slot #" << FrameIndex;
|
||||
MRI->storeRegToStackSlot(MBB, I, PhysReg, true, FrameIndex, RC);
|
||||
TII->storeRegToStackSlot(MBB, I, PhysReg, true, FrameIndex, RC);
|
||||
++NumStores; // Update statistics
|
||||
}
|
||||
|
||||
@@ -495,7 +498,8 @@ MachineInstr *RALocal::reloadVirtReg(MachineBasicBlock &MBB, MachineInstr *MI,
|
||||
<< MRI->getName(PhysReg) << "\n";
|
||||
|
||||
// Add move instruction(s)
|
||||
MRI->loadRegFromStackSlot(MBB, MI, PhysReg, FrameIndex, RC);
|
||||
const TargetInstrInfo* TII = MBB.getParent()->getTarget().getInstrInfo();
|
||||
TII->loadRegFromStackSlot(MBB, MI, PhysReg, FrameIndex, RC);
|
||||
++NumLoads; // Update statistics
|
||||
|
||||
MF->getRegInfo().setPhysRegUsed(PhysReg);
|
||||
|
||||
Reference in New Issue
Block a user