summaryrefslogtreecommitdiff
path: root/lib/CodeGen/RegisterPressure.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/RegisterPressure.cpp')
-rw-r--r--lib/CodeGen/RegisterPressure.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/CodeGen/RegisterPressure.cpp b/lib/CodeGen/RegisterPressure.cpp
index 092ecdd9bb..249789a4b1 100644
--- a/lib/CodeGen/RegisterPressure.cpp
+++ b/lib/CodeGen/RegisterPressure.cpp
@@ -506,7 +506,14 @@ bool RegPressureTracker::recede(SmallVectorImpl<unsigned> *LiveUses,
DeadDef = LRQ.isDeadDef();
}
}
- if (!DeadDef) {
+ if (DeadDef) {
+ // LiveIntervals knows this is a dead even though it's MachineOperand is
+ // not flagged as such. Since this register will not be recorded as
+ // live-out, increase its PDiff value to avoid underflowing pressure.
+ if (PDiff)
+ PDiff->addPressureChange(Reg, false, MRI);
+ }
+ else {
if (LiveRegs.erase(Reg))
decreaseRegPressure(Reg);
else