summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/RegisterScavenging.cpp
diff options
context:
space:
mode:
authorHal Finkel <hfinkel@anl.gov>2013-07-11 05:55:57 +0000
committerHal Finkel <hfinkel@anl.gov>2013-07-11 05:55:57 +0000
commit743b1940846b242e1cdb50d3fc0c6e8fa8dfbf0a (patch)
tree434157e0be71d291d6031737acb1b610b240cf8a /llvm/lib/CodeGen/RegisterScavenging.cpp
parenta3635b7b3bca60cd5c901b33bb023363c2bcd0ae (diff)
downloadbcm5719-llvm-743b1940846b242e1cdb50d3fc0c6e8fa8dfbf0a.tar.gz
bcm5719-llvm-743b1940846b242e1cdb50d3fc0c6e8fa8dfbf0a.zip
RegScavenger should not exclude undef uses
When computing currently-live registers, the register scavenger excludes undef uses. As a result, undef uses are ignored when computing the restore points of registers spilled into the emergency slots. While the register scavenger normally excludes from consideration, when scavenging, registers used by the current instruction, we need to not exclude undef uses. Otherwise, we might end up requiring more emergency spill slots than we have (in the case where the undef use *is* the currently-spilled register). Another bug found by llvm-stress. llvm-svn: 186067
Diffstat (limited to 'llvm/lib/CodeGen/RegisterScavenging.cpp')
-rw-r--r--llvm/lib/CodeGen/RegisterScavenging.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/RegisterScavenging.cpp b/llvm/lib/CodeGen/RegisterScavenging.cpp
index d1a945df81a..75ebdaa357f 100644
--- a/llvm/lib/CodeGen/RegisterScavenging.cpp
+++ b/llvm/lib/CodeGen/RegisterScavenging.cpp
@@ -368,7 +368,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() && MO.getReg() != 0 &&
+ if (MO.isReg() && MO.getReg() != 0 && !(MO.isUse() && MO.isUndef()) &&
!TargetRegisterInfo::isVirtualRegister(MO.getReg()))
Candidates.reset(MO.getReg());
}
OpenPOWER on IntegriCloud