Moving register scavenging to a post pass results in virtual registers in

the instruction we're scavenging for. The scavenger needs to know to avoid
them when analyzing register usage.

llvm-svn: 83077
This commit is contained in:
Jim Grosbach 2009-09-29 17:24:37 +00:00
parent 34aa421e3a
commit 6f6bc51d3b

View File

@ -241,7 +241,8 @@ unsigned RegScavenger::findSurvivorReg(MachineBasicBlock::iterator MI,
// Remove any candidates touched by instruction.
for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
const MachineOperand &MO = MI->getOperand(i);
if (!MO.isReg() || MO.isUndef() || !MO.getReg())
if (!MO.isReg() || MO.isUndef() || !MO.getReg() ||
TRI->isVirtualRegister(MO.getReg()))
continue;
Candidates.reset(MO.getReg());
for (const unsigned *R = TRI->getAliasSet(MO.getReg()); *R; R++)
@ -279,7 +280,7 @@ unsigned RegScavenger::scavengeRegister(const TargetRegisterClass *RC,
// Exclude all the registers being used by the instruction.
for (unsigned i = 0, e = I->getNumOperands(); i != e; ++i) {
MachineOperand &MO = I->getOperand(i);
if (MO.isReg())
if (MO.isReg() && !TRI->isVirtualRegister(MO.getReg()))
Candidates.reset(MO.getReg());
}