diff options
author | Dan Gohman <gohman@apple.com> | 2008-07-09 20:12:26 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-07-09 20:12:26 +0000 |
commit | 70aa89d215d07509fee10f3114c45b3f260c205a (patch) | |
tree | 7fb973a7fb571f0c1a20d98c3eaed45e170af400 /llvm/lib/CodeGen/RegAllocSimple.cpp | |
parent | 5c0d2bd46e1eacf3c40561f4632b40eea0c679ff (diff) | |
download | bcm5719-llvm-70aa89d215d07509fee10f3114c45b3f260c205a.tar.gz bcm5719-llvm-70aa89d215d07509fee10f3114c45b3f260c205a.zip |
Reuse the MO variable instead of recomputing it in RegAllocLocal.
Keep RegAllocSimple in sync.
llvm-svn: 53351
Diffstat (limited to 'llvm/lib/CodeGen/RegAllocSimple.cpp')
-rw-r--r-- | llvm/lib/CodeGen/RegAllocSimple.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/llvm/lib/CodeGen/RegAllocSimple.cpp b/llvm/lib/CodeGen/RegAllocSimple.cpp index ce4b42071a7..9ad38405ae7 100644 --- a/llvm/lib/CodeGen/RegAllocSimple.cpp +++ b/llvm/lib/CodeGen/RegAllocSimple.cpp @@ -188,12 +188,12 @@ void RegAllocSimple::AllocateBasicBlock(MachineBasicBlock &MBB) { // Loop over uses, move from memory into registers. for (int i = MI->getNumOperands() - 1; i >= 0; --i) { - MachineOperand &op = MI->getOperand(i); + MachineOperand &MO = MI->getOperand(i); - if (op.isRegister() && op.getReg() && - TargetRegisterInfo::isVirtualRegister(op.getReg())) { - unsigned virtualReg = (unsigned) op.getReg(); - DOUT << "op: " << op << "\n"; + if (MO.isRegister() && MO.getReg() && + TargetRegisterInfo::isVirtualRegister(MO.getReg())) { + unsigned virtualReg = (unsigned) MO.getReg(); + DOUT << "op: " << MO << "\n"; DOUT << "\t inst[" << i << "]: "; DEBUG(MI->print(*cerr.stream(), TM)); @@ -201,7 +201,7 @@ void RegAllocSimple::AllocateBasicBlock(MachineBasicBlock &MBB) { // register in any given instruction unsigned physReg = Virt2PhysRegMap[virtualReg]; if (physReg == 0) { - if (op.isDef()) { + if (MO.isDef()) { int TiedOp = Desc.findTiedToSrcOperand(i); if (TiedOp == -1) { physReg = getFreeReg(virtualReg); @@ -222,8 +222,8 @@ void RegAllocSimple::AllocateBasicBlock(MachineBasicBlock &MBB) { Virt2PhysRegMap[virtualReg] = physReg; } } - MI->getOperand(i).setReg(physReg); - DOUT << "virt: " << virtualReg << ", phys: " << op.getReg() << "\n"; + MO.setReg(physReg); + DOUT << "virt: " << virtualReg << ", phys: " << MO.getReg() << "\n"; } } RegClassIdx.clear(); |