summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-06-30 06:58:35 +0000
committerDan Gohman <gohman@apple.com>2010-06-30 06:58:35 +0000
commit9396b42ca4518bdf410351ee9c2305a39a5d1a58 (patch)
tree3f3f4925912d64c5f283c50166b66d4363e7d43b /llvm/lib
parent120a1e9d0fc2f1625482df789c47b979b3f2a73f (diff)
downloadbcm5719-llvm-9396b42ca4518bdf410351ee9c2305a39a5d1a58.tar.gz
bcm5719-llvm-9396b42ca4518bdf410351ee9c2305a39a5d1a58.zip
When computing a new ConservativeResult, intersect it with
the old one instead of replacing it, to be more precise. llvm-svn: 107256
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Analysis/ScalarEvolution.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index b5acd6bfd6e..240126eef8c 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -2958,7 +2958,8 @@ ScalarEvolution::getUnsignedRange(const SCEV *S) {
if (const SCEVConstant *C = dyn_cast<SCEVConstant>(AddRec->getStart()))
if (!C->getValue()->isZero())
ConservativeResult =
- ConstantRange(C->getValue()->getValue(), APInt(BitWidth, 0));
+ ConservativeResult.intersectWith(
+ ConstantRange(C->getValue()->getValue(), APInt(BitWidth, 0)));
// TODO: non-affine addrec
if (AddRec->isAffine()) {
OpenPOWER on IntegriCloud