From: Cameron Zwarich Date: Tue, 12 Feb 2013 05:48:58 +0000 (+0000) Subject: Don't consider definitions by other PHIs live-in when trimming a PHI source's X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=4930e7266b7643410cfbbed5ef6e4d3b19178918;p=oota-llvm.git 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 --- diff --git a/lib/CodeGen/PHIElimination.cpp b/lib/CodeGen/PHIElimination.cpp index f046ac9627d..abad5c1e850 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; }