summaryrefslogtreecommitdiff
path: root/lib/CodeGen/PHIElimination.cpp
diff options
context:
space:
mode:
authorCameron Zwarich <zwarich@apple.com>2013-02-21 08:51:58 +0000
committerCameron Zwarich <zwarich@apple.com>2013-02-21 08:51:58 +0000
commit197a60a66612ab274a734066962a10126a11fb53 (patch)
tree8f800619651d913fb38d4bb1922b99aefd7781ac /lib/CodeGen/PHIElimination.cpp
parenta566d63b61f2a29e89696abba1729ac53b9843e6 (diff)
downloadllvm-197a60a66612ab274a734066962a10126a11fb53.tar.gz
llvm-197a60a66612ab274a734066962a10126a11fb53.tar.bz2
llvm-197a60a66612ab274a734066962a10126a11fb53.tar.xz
Don't rely on the isDead() MachineOperand flag when updating LiveIntervals.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175732 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/PHIElimination.cpp')
-rw-r--r--lib/CodeGen/PHIElimination.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/CodeGen/PHIElimination.cpp b/lib/CodeGen/PHIElimination.cpp
index b84d9d3339..5584708eae 100644
--- a/lib/CodeGen/PHIElimination.cpp
+++ b/lib/CodeGen/PHIElimination.cpp
@@ -320,7 +320,9 @@ void PHIElimination::LowerPHINode(MachineBasicBlock &MBB,
}
LiveInterval &DestLI = LIS->getInterval(DestReg);
- if (NewInstr->getOperand(0).isDead()) {
+ assert(DestLI.begin() != DestLI.end() &&
+ "PHIs should have nonempty LiveIntervals.");
+ if (DestLI.endIndex().isDead()) {
// A dead PHI's live range begins and ends at the start of the MBB, but
// the lowered copy, which will still be dead, needs to begin and end at
// the copy instruction.