summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/RegAllocSimple.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-07-09 19:56:01 +0000
committerDan Gohman <gohman@apple.com>2008-07-09 19:56:01 +0000
commitd0a33a9270db3781189613c26aa5cb7673915f97 (patch)
treed8a18a58078b7172ef15077955e162540577ea64 /llvm/lib/CodeGen/RegAllocSimple.cpp
parent8ab08642eea594c8f247c2feda17136335300f7d (diff)
downloadbcm5719-llvm-d0a33a9270db3781189613c26aa5cb7673915f97.tar.gz
bcm5719-llvm-d0a33a9270db3781189613c26aa5cb7673915f97.zip
Give RegAllocSimple a TargetInstrInfo member to keep it consistent
with RegAllocLocal. llvm-svn: 53347
Diffstat (limited to 'llvm/lib/CodeGen/RegAllocSimple.cpp')
-rw-r--r--llvm/lib/CodeGen/RegAllocSimple.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/RegAllocSimple.cpp b/llvm/lib/CodeGen/RegAllocSimple.cpp
index f07f7f92be8..ce4b42071a7 100644
--- a/llvm/lib/CodeGen/RegAllocSimple.cpp
+++ b/llvm/lib/CodeGen/RegAllocSimple.cpp
@@ -46,6 +46,7 @@ namespace {
MachineFunction *MF;
const TargetMachine *TM;
const TargetRegisterInfo *TRI;
+ const TargetInstrInfo *TII;
// StackSlotForVirtReg - Maps SSA Regs => frame index on the stack where
// these values are spilled
@@ -144,7 +145,6 @@ unsigned RegAllocSimple::reloadVirtReg(MachineBasicBlock &MBB,
// Add move instruction(s)
++NumLoads;
- const TargetInstrInfo* TII = MBB.getParent()->getTarget().getInstrInfo();
TII->loadRegFromStackSlot(MBB, I, PhysReg, FrameIdx, RC);
return PhysReg;
}
@@ -153,7 +153,6 @@ void RegAllocSimple::spillVirtReg(MachineBasicBlock &MBB,
MachineBasicBlock::iterator I,
unsigned VirtReg, unsigned PhysReg) {
const TargetRegisterClass* RC = MF->getRegInfo().getRegClass(VirtReg);
- const TargetInstrInfo* TII = MBB.getParent()->getTarget().getInstrInfo();
int FrameIdx = getStackSpaceFor(VirtReg, RC);
@@ -240,6 +239,7 @@ bool RegAllocSimple::runOnMachineFunction(MachineFunction &Fn) {
MF = &Fn;
TM = &MF->getTarget();
TRI = TM->getRegisterInfo();
+ TII = TM->getInstrInfo();
// Loop over all of the basic blocks, eliminating virtual register references
for (MachineFunction::iterator MBB = Fn.begin(), MBBe = Fn.end();
OpenPOWER on IntegriCloud