summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2011-02-10 23:54:10 +0000
committerNick Lewycky <nicholas@mxc.ca>2011-02-10 23:54:10 +0000
commitac0b62c27730ca7eb6ca49363298fdceeb3e7032 (patch)
tree479f05a123f0fe344e7d16fb2215a7c561500b9a /llvm/lib/Analysis
parent97dae4d361b96e10ff450c0dccab48d2bccb5685 (diff)
downloadbcm5719-llvm-ac0b62c27730ca7eb6ca49363298fdceeb3e7032.tar.gz
bcm5719-llvm-ac0b62c27730ca7eb6ca49363298fdceeb3e7032.zip
Tolerate degenerate phi nodes that can occur in the middle of optimization
passes. Fixes PR9112. Patch by Jakub Staszak! llvm-svn: 125319
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r--llvm/lib/Analysis/ValueTracking.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp
index 44c1b5326bc..32d2c887211 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -590,6 +590,10 @@ void llvm::ComputeMaskedBits(Value *V, const APInt &Mask,
}
}
+ // Unreachable blocks may have zero-operand PHI nodes.
+ if (P->getNumIncomingValues() == 0)
+ return;
+
// Otherwise take the unions of the known bit sets of the operands,
// taking conservative care to avoid excessive recursion.
if (Depth < MaxDepth - 1 && !KnownZero && !KnownOne) {
OpenPOWER on IntegriCloud