From 7c85c9433cffac9192529b55e4a7c1331ec206e6 Mon Sep 17 00:00:00 2001 From: Cameron Zwarich Date: Tue, 12 Feb 2013 05:48:58 +0000 Subject: [PATCH] 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 --- llvm/lib/CodeGen/PHIElimination.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; } -- 2.7.4