summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/RegAllocLocal.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2008-01-01 21:11:32 +0000
committerOwen Anderson <resistor@mac.com>2008-01-01 21:11:32 +0000
commiteee14601b1763a5488c4fce8ab91a80edd8ce73c (patch)
tree07eb1a1d7c8089c61b9c075fe70a1beac8e28e4c /llvm/lib/CodeGen/RegAllocLocal.cpp
parentcaaf8aae4de8a6a6bb2baa8db6d62bc42dff4c98 (diff)
downloadbcm5719-llvm-eee14601b1763a5488c4fce8ab91a80edd8ce73c.tar.gz
bcm5719-llvm-eee14601b1763a5488c4fce8ab91a80edd8ce73c.zip
Move some more instruction creation methods from RegisterInfo into InstrInfo.
llvm-svn: 45484
Diffstat (limited to 'llvm/lib/CodeGen/RegAllocLocal.cpp')
-rw-r--r--llvm/lib/CodeGen/RegAllocLocal.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/RegAllocLocal.cpp b/llvm/lib/CodeGen/RegAllocLocal.cpp
index 8c38cd06f93..251d175ea6f 100644
--- a/llvm/lib/CodeGen/RegAllocLocal.cpp
+++ b/llvm/lib/CodeGen/RegAllocLocal.cpp
@@ -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);
OpenPOWER on IntegriCloud