aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/RegAllocLocal.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-07-09 19:55:19 +0000
committerDan Gohman <gohman@apple.com>2008-07-09 19:55:19 +0000
commit88490546240c1f1e3ded46a103c2b4f53c19a008 (patch)
tree6c4c4cee6408610aa112c93fcdd46516aa9f016d /lib/CodeGen/RegAllocLocal.cpp
parent0383bc014c82ce3979416e5fe28caaca59142a05 (diff)
downloadexternal_llvm-88490546240c1f1e3ded46a103c2b4f53c19a008.zip
external_llvm-88490546240c1f1e3ded46a103c2b4f53c19a008.tar.gz
external_llvm-88490546240c1f1e3ded46a103c2b4f53c19a008.tar.bz2
RegAllocLocal has a TargetInstrInfo data member. Use it instead
of having local variables duplicate it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53346 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/RegAllocLocal.cpp')
-rw-r--r--lib/CodeGen/RegAllocLocal.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/CodeGen/RegAllocLocal.cpp b/lib/CodeGen/RegAllocLocal.cpp
index 7acf982..c59d3b8 100644
--- a/lib/CodeGen/RegAllocLocal.cpp
+++ b/lib/CodeGen/RegAllocLocal.cpp
@@ -291,8 +291,6 @@ void RALocal::spillVirtReg(MachineBasicBlock &MBB,
DOUT << " Spilling register " << TRI->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!";
std::pair<MachineInstr*, unsigned> &LastUse = getVirtRegLastUse(VirtReg);
@@ -507,7 +505,6 @@ MachineInstr *RALocal::reloadVirtReg(MachineBasicBlock &MBB, MachineInstr *MI,
<< TRI->getName(PhysReg) << "\n";
// Add move instruction(s)
- const TargetInstrInfo* TII = MBB.getParent()->getTarget().getInstrInfo();
TII->loadRegFromStackSlot(MBB, MI, PhysReg, FrameIndex, RC);
++NumLoads; // Update statistics
@@ -564,7 +561,6 @@ static bool precedes(MachineBasicBlock::iterator A,
void RALocal::AllocateBasicBlock(MachineBasicBlock &MBB) {
// loop over each instruction
MachineBasicBlock::iterator MII = MBB.begin();
- const TargetInstrInfo &TII = *TM->getInstrInfo();
DEBUG(const BasicBlock *LBB = MBB.getBasicBlock();
if (LBB) DOUT << "\nStarting RegAlloc of BB: " << LBB->getName());
@@ -882,7 +878,7 @@ void RALocal::AllocateBasicBlock(MachineBasicBlock &MBB) {
// Finally, if this is a noop copy instruction, zap it.
unsigned SrcReg, DstReg;
- if (TII.isMoveInstr(*MI, SrcReg, DstReg) && SrcReg == DstReg)
+ if (TII->isMoveInstr(*MI, SrcReg, DstReg) && SrcReg == DstReg)
MBB.erase(MI);
}