diff options
author | Owen Anderson <resistor@mac.com> | 2010-09-16 18:28:33 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2010-09-16 18:28:33 +0000 |
commit | 140296f5c02a35b1812abb5d868eecbd198e29a2 (patch) | |
tree | 9d1d9a07e619467fd5106a4a0459e1c92f078753 /llvm/lib | |
parent | 2fcc0e5555557ed176a09b84b8956a7d123cdeb7 (diff) | |
download | bcm5719-llvm-140296f5c02a35b1812abb5d868eecbd198e29a2.tar.gz bcm5719-llvm-140296f5c02a35b1812abb5d868eecbd198e29a2.zip |
It is possible, under specific circumstances involving ptrtoint ConstantExpr's, for LVI to end up trying to merge
a Constant into a ConstantRange. Handle this conservatively for now, rather than asserting. The testcase is
more complex that I would like, but the manifestation of the problem is sensitive to iteration orders and the state of the
LVI cache, and I have not been able to reproduce it with manually constructed or simplified cases.
Fixes PR8162.
llvm-svn: 114103
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Analysis/LazyValueInfo.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/LazyValueInfo.cpp b/llvm/lib/Analysis/LazyValueInfo.cpp index 74267e045ae..0e024042f17 100644 --- a/llvm/lib/Analysis/LazyValueInfo.cpp +++ b/llvm/lib/Analysis/LazyValueInfo.cpp @@ -201,6 +201,7 @@ public: return markOverdefined(); return markNotConstant(RHS.getNotConstant()); } else if (isConstantRange()) { + // FIXME: This could be made more precise. return markOverdefined(); } @@ -223,9 +224,12 @@ public: return markConstantRange(RHS.getConstantRange()); } - // RHS must be a constant, we must be undef, constant, or notconstant. - assert(!isConstantRange() && - "Constant and ConstantRange cannot be merged."); + // RHS must be a constant, we must be constantrange, + // undef, constant, or notconstant. + if (isConstantRange()) { + // FIXME: This could be made more precise. + return markOverdefined(); + } if (isUndefined()) return markConstant(RHS.getConstant()); |