aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-06-24 20:29:52 +0000
committerChris Lattner <sabre@nondot.org>2003-06-24 20:29:52 +0000
commit38b5ae4b4847196f5ec53551cf8040ba0b5fb11d (patch)
tree1853c6618e9c7b62451e12887a824a41eb119b76 /lib/Transforms
parent1e3af1ef873c0fb5dc6c4ba4e51ef98ced72dce0 (diff)
Fix bug: SCCP/2003-06-24-OverdefinedPHIValue.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6883 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/Scalar/SCCP.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/Transforms/Scalar/SCCP.cpp b/lib/Transforms/Scalar/SCCP.cpp
index 4463a7fc44..df55037c52 100644
--- a/lib/Transforms/Scalar/SCCP.cpp
+++ b/lib/Transforms/Scalar/SCCP.cpp
@@ -420,12 +420,13 @@ void SCCP::visitPHINode(PHINode &PN) {
for (unsigned i = 0, e = PN.getNumIncomingValues(); i != e; ++i) {
InstVal &IV = getValueState(PN.getIncomingValue(i));
if (IV.isUndefined()) continue; // Doesn't influence PHI node.
- if (IV.isOverdefined()) { // PHI node becomes overdefined!
- markOverdefined(&PN);
- return;
- }
if (isEdgeFeasible(PN.getIncomingBlock(i), PN.getParent())) {
+ if (IV.isOverdefined()) { // PHI node becomes overdefined!
+ markOverdefined(&PN);
+ return;
+ }
+
if (OperandVal == 0) { // Grab the first value...
OperandVal = IV.getConstant();
} else { // Another value is being merged in!