aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2008-03-24 20:16:14 +0000
committerDevang Patel <dpatel@apple.com>2008-03-24 20:16:14 +0000
commit1d4115e430d6f48b26efea9241109e157e2c52ad (patch)
treec2517b819d9fbc0f32ae5692636c437f6a9f6ef0 /lib
parent79e6c77c1019cff74a514eeafb1a53a79a73ccfa (diff)
downloadexternal_llvm-1d4115e430d6f48b26efea9241109e157e2c52ad.zip
external_llvm-1d4115e430d6f48b26efea9241109e157e2c52ad.tar.gz
external_llvm-1d4115e430d6f48b26efea9241109e157e2c52ad.tar.bz2
Add incoming value from header only if phi node has any use inside the loop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48738 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Transforms/Scalar/LoopIndexSplit.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Transforms/Scalar/LoopIndexSplit.cpp b/lib/Transforms/Scalar/LoopIndexSplit.cpp
index 3aedb93..513cad8 100644
--- a/lib/Transforms/Scalar/LoopIndexSplit.cpp
+++ b/lib/Transforms/Scalar/LoopIndexSplit.cpp
@@ -1665,8 +1665,9 @@ void LoopIndexSplit::updatePHINodes(BasicBlock *ExitBB, BasicBlock *Latch,
break;
}
- assert (NewV && "Unable to find new incoming value for exit block PHI");
- PN->addIncoming(NewV, Header);
+ // Add incoming value from header only if PN has any use inside the loop.
+ if (NewV)
+ PN->addIncoming(NewV, Header);
} else if (Instruction *PHI = dyn_cast<Instruction>(V)) {
// If this instruction is IVIncrement then IV is new incoming value