aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/StrongPHIElimination.cpp
diff options
context:
space:
mode:
authorCameron Zwarich <zwarich@apple.com>2011-10-12 21:24:54 +0000
committerCameron Zwarich <zwarich@apple.com>2011-10-12 21:24:54 +0000
commit980df169203a5f60793e758cdc5cbcad853ca9eb (patch)
tree1f603569c753d569b66c8d17f7e9afe5f7457e6e /lib/CodeGen/StrongPHIElimination.cpp
parentc66e7afcf2810a2c1ebf08514eaf45c478e5ff67 (diff)
To find the exiting VN of a LiveInterval from a block, use the previous slot
rather than the previous index. If a block has a single instruction, the previous index may be in a different basic block. I have no clue how this used to work on all of test-suite, because now this failure is seen quite often when trying to compile code with -strong-phi-elim. This fixes PR10252. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141812 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/StrongPHIElimination.cpp')
-rw-r--r--lib/CodeGen/StrongPHIElimination.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/CodeGen/StrongPHIElimination.cpp b/lib/CodeGen/StrongPHIElimination.cpp
index 0fabd8e6ee..76e6c9966a 100644
--- a/lib/CodeGen/StrongPHIElimination.cpp
+++ b/lib/CodeGen/StrongPHIElimination.cpp
@@ -674,7 +674,7 @@ void StrongPHIElimination::InsertCopiesForPHI(MachineInstr *PHI,
if (PHIColor && SrcColor == PHIColor) {
LiveInterval &SrcInterval = LI->getInterval(SrcReg);
SlotIndex PredIndex = LI->getMBBEndIdx(PredBB);
- VNInfo *SrcVNI = SrcInterval.getVNInfoAt(PredIndex.getPrevIndex());
+ VNInfo *SrcVNI = SrcInterval.getVNInfoAt(PredIndex.getPrevSlot());
assert(SrcVNI);
SrcVNI->setHasPHIKill(true);
continue;