aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/PHIElimination.cpp
diff options
context:
space:
mode:
authorCameron Zwarich <zwarich@apple.com>2013-02-12 05:48:58 +0000
committerCameron Zwarich <zwarich@apple.com>2013-02-12 05:48:58 +0000
commit7c85c9433cffac9192529b55e4a7c1331ec206e6 (patch)
tree10d6e1760370d77505d42659fc2bb3a1b88018d6 /llvm/lib/CodeGen/PHIElimination.cpp
parent4ee9aef208a08590bca15c7ef87c42f663e95309 (diff)
downloadllvm-7c85c9433cffac9192529b55e4a7c1331ec206e6.zip
llvm-7c85c9433cffac9192529b55e4a7c1331ec206e6.tar.gz
llvm-7c85c9433cffac9192529b55e4a7c1331ec206e6.tar.bz2
Don't consider definitions by other PHIs live-in when trimming a PHI source's
live range after inserting a copy at the end of a block. llvm-svn: 174945
Diffstat (limited to 'llvm/lib/CodeGen/PHIElimination.cpp')
-rw-r--r--llvm/lib/CodeGen/PHIElimination.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/PHIElimination.cpp b/llvm/lib/CodeGen/PHIElimination.cpp
index f046ac9..abad5c1 100644
--- a/llvm/lib/CodeGen/PHIElimination.cpp
+++ b/llvm/lib/CodeGen/PHIElimination.cpp
@@ -467,7 +467,11 @@ void PHIElimination::LowerPHINode(MachineBasicBlock &MBB,
bool isLiveOut = false;
for (MachineBasicBlock::succ_iterator SI = opBlock.succ_begin(),
SE = opBlock.succ_end(); SI != SE; ++SI) {
- if (SrcLI.liveAt(LIS->getMBBStartIdx(*SI))) {
+ SlotIndex startIdx = LIS->getMBBStartIdx(*SI);
+ VNInfo *VNI = SrcLI.getVNInfoAt(startIdx);
+
+ // Definitions by other PHIs are not truly live-in for our purposes.
+ if (VNI && VNI->def != startIdx) {
isLiveOut = true;
break;
}