diff options
author | Owen Anderson <resistor@mac.com> | 2008-01-01 21:11:32 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2008-01-01 21:11:32 +0000 |
commit | f6372aa1cc568df19da7c5023e83c75aa9404a07 (patch) | |
tree | 9cc85598bdfe4e6af602fffcca57f03c61c0dc3f /lib/CodeGen/RegAllocLocal.cpp | |
parent | 80fe5311b5e9e5c4642ff46ba2377173c17797f6 (diff) |
Move some more instruction creation methods from RegisterInfo into InstrInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45484 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/RegAllocLocal.cpp')
-rw-r--r-- | lib/CodeGen/RegAllocLocal.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/CodeGen/RegAllocLocal.cpp b/lib/CodeGen/RegAllocLocal.cpp index 8c38cd06f9..251d175ea6 100644 --- a/lib/CodeGen/RegAllocLocal.cpp +++ b/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); |