summaryrefslogtreecommitdiff
path: root/lib/Analysis/LazyValueInfo.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2010-09-16 18:28:33 +0000
committerOwen Anderson <resistor@mac.com>2010-09-16 18:28:33 +0000
commitc2ce21ad51590377b572a572243e373f7a7b9fb4 (patch)
treee1648b926976b1bda2137558aada313284d2dda3 /lib/Analysis/LazyValueInfo.cpp
parent6dbe29e34e0017dac703f951429964d9c95b528c (diff)
downloadllvm-c2ce21ad51590377b572a572243e373f7a7b9fb4.tar.gz
llvm-c2ce21ad51590377b572a572243e373f7a7b9fb4.tar.bz2
llvm-c2ce21ad51590377b572a572243e373f7a7b9fb4.tar.xz
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114103 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/LazyValueInfo.cpp')
-rw-r--r--lib/Analysis/LazyValueInfo.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/Analysis/LazyValueInfo.cpp b/lib/Analysis/LazyValueInfo.cpp
index 74267e045a..0e024042f1 100644
--- a/lib/Analysis/LazyValueInfo.cpp
+++ b/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());