From 6f6bc51d3ba3533ee5293562c5056a63b74854e0 Mon Sep 17 00:00:00 2001 From: Jim Grosbach Date: Tue, 29 Sep 2009 17:24:37 +0000 Subject: [PATCH] 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 --- lib/CodeGen/RegisterScavenging.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/CodeGen/RegisterScavenging.cpp b/lib/CodeGen/RegisterScavenging.cpp index f878eaa55e6..ada7b4665d3 100644 --- a/lib/CodeGen/RegisterScavenging.cpp +++ b/lib/CodeGen/RegisterScavenging.cpp @@ -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()); }