aboutsummaryrefslogtreecommitdiffstats
path: root/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
commit4930e7266b7643410cfbbed5ef6e4d3b19178918 (patch)
treed0d4e7fad3299d24eed948ebeacd5bcd0c080fb8 /lib/CodeGen/PHIElimination.cpp
parent8d49134eeaa36953410c2fba65f7237fb3f079e7 (diff)
downloadexternal_llvm-4930e7266b7643410cfbbed5ef6e4d3b19178918.zip
external_llvm-4930e7266b7643410cfbbed5ef6e4d3b19178918.tar.gz
external_llvm-4930e7266b7643410cfbbed5ef6e4d3b19178918.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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174945 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/PHIElimination.cpp')
-rw-r--r--lib/CodeGen/PHIElimination.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/CodeGen/PHIElimination.cpp b/lib/CodeGen/PHIElimination.cpp
index f046ac9..abad5c1 100644
--- a/lib/CodeGen/PHIElimination.cpp
+++ b/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;
}