[llvm-commits] CVS: llvm/lib/CodeGen/VirtRegMap.cpp
Alkis Evlogimenos
alkis at cs.uiuc.edu
Tue Mar 9 02:36:01 PST 2004
Changes in directory llvm/lib/CodeGen:
VirtRegMap.cpp updated: 1.10 -> 1.11
---
Log message:
Spill explicit physical register defs as well.
---
Diffs of the changes: (+11 -3)
Index: llvm/lib/CodeGen/VirtRegMap.cpp
diff -u llvm/lib/CodeGen/VirtRegMap.cpp:1.10 llvm/lib/CodeGen/VirtRegMap.cpp:1.11
--- llvm/lib/CodeGen/VirtRegMap.cpp:1.10 Sat Mar 6 17:08:44 2004
+++ llvm/lib/CodeGen/VirtRegMap.cpp Tue Mar 9 02:35:13 2004
@@ -283,8 +283,8 @@
// the value of the spilled virtual register
VirtRegMap::MI2VirtMap::const_iterator i, e;
for (tie(i, e) = vrm_->getFoldedVirts(mii); i != e; ++i) {
- unsigned physReg = vrm_->getPhys(i->second);
- if (physReg) vacateJustPhysReg(mbb, mii, physReg);
+ if (vrm_->hasPhys(i->second))
+ vacateJustPhysReg(mbb, mii, vrm_->getPhys(i->second));
}
// rewrite all used operands
@@ -304,10 +304,18 @@
}
}
- // spill implicit defs
+ // spill implicit physical register defs
const TargetInstrDescriptor& tid = tii_->get(mii->getOpcode());
for (const unsigned* id = tid.ImplicitDefs; *id; ++id)
vacatePhysReg(mbb, mii, *id);
+
+ // spill explicit physical register defs
+ for (unsigned i = 0, e = mii->getNumOperands(); i != e; ++i) {
+ MachineOperand& op = mii->getOperand(i);
+ if (op.isRegister() && op.getReg() && !op.isUse() &&
+ MRegisterInfo::isPhysicalRegister(op.getReg()))
+ vacatePhysReg(mbb, mii, op.getReg());
+ }
// rewrite def operands (def&use was handled with the
// uses so don't check for those here)
More information about the llvm-commits
mailing list