summaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/RegisterCoalescer.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/CodeGen/RegisterCoalescer.cpp b/lib/CodeGen/RegisterCoalescer.cpp
index f45072f1ac..ad1f5f4f12 100644
--- a/lib/CodeGen/RegisterCoalescer.cpp
+++ b/lib/CodeGen/RegisterCoalescer.cpp
@@ -1733,11 +1733,15 @@ void JoinVals::pruneValues(JoinVals &Other,
// This value takes precedence over the value in Other.LI.
LIS->pruneValue(&Other.LI, Def, &EndPoints);
// Remove <def,read-undef> flags. This def is now a partial redef.
- if (!Def.isBlock())
+ if (!Def.isBlock()) {
for (MIOperands MO(Indexes->getInstructionFromIndex(Def));
MO.isValid(); ++MO)
if (MO->isReg() && MO->isDef() && MO->getReg() == LI.reg)
MO->setIsUndef(false);
+ // This value will reach instructions below, but we need to make sure
+ // the live range also reaches the instruction at Def.
+ EndPoints.push_back(Def);
+ }
DEBUG(dbgs() << "\t\tpruned " << PrintReg(Other.LI.reg) << " at " << Def
<< ": " << Other.LI << '\n');
break;