diff options
author | Philip Reames <listmail@philipreames.com> | 2016-04-26 22:31:53 +0000 |
---|---|---|
committer | Philip Reames <listmail@philipreames.com> | 2016-04-26 22:31:53 +0000 |
commit | d5c62a0aad1f87e89d5a8c1d9837ed949d1687a6 (patch) | |
tree | f1d03e8c616960298909c9dcb50d5e3034fc3e9b /llvm/lib/Analysis/LazyValueInfo.cpp | |
parent | fd5c9be4bba42b508bdcc9515993be1f36364594 (diff) | |
download | llvm-d5c62a0aad1f87e89d5a8c1d9837ed949d1687a6.zip llvm-d5c62a0aad1f87e89d5a8c1d9837ed949d1687a6.tar.gz llvm-d5c62a0aad1f87e89d5a8c1d9837ed949d1687a6.tar.bz2 |
[LVI] Speculative fix for assertion seen in clang bots
I'll clean this up and add a test case shortly. I want to make sure this does actually fix the bots; if not, I'll revert.
llvm-svn: 267617
Diffstat (limited to 'llvm/lib/Analysis/LazyValueInfo.cpp')
-rw-r--r-- | llvm/lib/Analysis/LazyValueInfo.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/LazyValueInfo.cpp b/llvm/lib/Analysis/LazyValueInfo.cpp index 4abb098..5f1d179 100644 --- a/llvm/lib/Analysis/LazyValueInfo.cpp +++ b/llvm/lib/Analysis/LazyValueInfo.cpp @@ -1013,6 +1013,12 @@ bool LazyValueInfoCache::solveBlockValueCast(LVILatticeVal &BBLV, const unsigned OperandBitWidth = BBI->getOperand(0)->getType()->getPrimitiveSizeInBits(); + if (OperandBitWidth == 0) { + // Without knowing how wide the input is, we can't analyze it in any useful + // way. + BBLV.markOverdefined(); + return true; + } ConstantRange LHSRange = ConstantRange(OperandBitWidth); if (hasBlockValue(BBI->getOperand(0), BB)) { |