diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2011-02-10 23:54:10 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2011-02-10 23:54:10 +0000 |
commit | 3b739d278c87f8ac22b5dc368b319fa278347b2f (patch) | |
tree | 38d264e0e347f1b60ba4ab886858726ece2b6cd0 /lib/Analysis/ValueTracking.cpp | |
parent | 2c2b933037ecd5a0ebcfa3077606892802c04a29 (diff) | |
download | external_llvm-3b739d278c87f8ac22b5dc368b319fa278347b2f.zip external_llvm-3b739d278c87f8ac22b5dc368b319fa278347b2f.tar.gz external_llvm-3b739d278c87f8ac22b5dc368b319fa278347b2f.tar.bz2 |
Tolerate degenerate phi nodes that can occur in the middle of optimization
passes. Fixes PR9112. Patch by Jakub Staszak!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125319 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/ValueTracking.cpp')
-rw-r--r-- | lib/Analysis/ValueTracking.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Analysis/ValueTracking.cpp b/lib/Analysis/ValueTracking.cpp index 44c1b53..32d2c88 100644 --- a/lib/Analysis/ValueTracking.cpp +++ b/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) { |