[llvm] r174945 - Don't consider definitions by other PHIs live-in when trimming a PHI source's
Cameron Zwarich
zwarich at apple.com
Mon Feb 11 21:48:58 PST 2013
Author: zwarich
Date: Mon Feb 11 23:48:58 2013
New Revision: 174945
URL: http://llvm.org/viewvc/llvm-project?rev=174945&view=rev
Log:
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.
Modified:
llvm/trunk/lib/CodeGen/PHIElimination.cpp
Modified: llvm/trunk/lib/CodeGen/PHIElimination.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PHIElimination.cpp?rev=174945&r1=174944&r2=174945&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/PHIElimination.cpp (original)
+++ llvm/trunk/lib/CodeGen/PHIElimination.cpp Mon Feb 11 23:48:58 2013
@@ -467,7 +467,11 @@ void PHIElimination::LowerPHINode(Machin
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;
}
More information about the llvm-commits
mailing list