summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2013-06-21 18:33:20 +0000
committerAndrew Trick <atrick@apple.com>2013-06-21 18:33:20 +0000
commit03dca5e4b6c41e1e7fa4edad3d7ff8d5f6de7008 (patch)
tree393fd24d6c1a7fce8d30049a0c8f64c2b1c0302c /lib
parentf1f99f394f367845c4f4528d4d2bce42e65a5f50 (diff)
downloadllvm-03dca5e4b6c41e1e7fa4edad3d7ff8d5f6de7008.tar.gz
llvm-03dca5e4b6c41e1e7fa4edad3d7ff8d5f6de7008.tar.bz2
llvm-03dca5e4b6c41e1e7fa4edad3d7ff8d5f6de7008.tar.xz
Handle more cases in LiveRangeEdit::eliminateDeadDefs.
Live intervals for dead physregs may be created during coalescing. We need to update these in the event that their instruction goes away. crash.ll is the unit test that catches it when MI sched is enabled on X86. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184572 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/LiveRangeEdit.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/CodeGen/LiveRangeEdit.cpp b/lib/CodeGen/LiveRangeEdit.cpp
index 0c1d45902f..d215d0c28a 100644
--- a/lib/CodeGen/LiveRangeEdit.cpp
+++ b/lib/CodeGen/LiveRangeEdit.cpp
@@ -249,6 +249,15 @@ void LiveRangeEdit::eliminateDeadDef(MachineInstr *MI, ToShrinkSet &ToShrink) {
// Check if MI reads any unreserved physregs.
if (Reg && MOI->readsReg() && !MRI.isReserved(Reg))
ReadsPhysRegs = true;
+ else if (MOI->isDef()) {
+ for (MCRegUnitIterator Units(Reg, MRI.getTargetRegisterInfo());
+ Units.isValid(); ++Units) {
+ if (LiveInterval *LI = LIS.getCachedRegUnit(*Units)) {
+ if (VNInfo *VNI = LI->getVNInfoAt(Idx))
+ LI->removeValNo(VNI);
+ }
+ }
+ }
continue;
}
LiveInterval &LI = LIS.getInterval(Reg);