diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2009-07-18 06:34:42 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2009-07-18 06:34:42 +0000 |
commit | 3a4a884c1618d94202ee714ea5c899cd80d1c536 (patch) | |
tree | 1e69e339c818903ac78cd8ed80335c25c1a5f5d7 /lib/Analysis/LoopVR.cpp | |
parent | d370d776aa6f28866563cdc85abbc32f20a96ec7 (diff) |
Replace intersectWith with maximalIntersectWith. The latter guarantees that
all values belonging to the intersection will belong to the resulting range.
The former was inconsistent about that point (either way is fine, just pick
one.) This is part of PR4545.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76289 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/LoopVR.cpp')
-rw-r--r-- | lib/Analysis/LoopVR.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/Analysis/LoopVR.cpp b/lib/Analysis/LoopVR.cpp index 6854e950ef..e4dac8f1f9 100644 --- a/lib/Analysis/LoopVR.cpp +++ b/lib/Analysis/LoopVR.cpp @@ -142,14 +142,13 @@ ConstantRange LoopVR::getRange(const SCEV *S, const SCEV *T, ScalarEvolution &SE if (R.getUnsignedMin() == 0) { // Just because it contains zero, doesn't mean it will also contain one. - // Use maximalIntersectWith to get the right behaviour. ConstantRange NotZero(APInt(L.getBitWidth(), 1), APInt::getNullValue(L.getBitWidth())); - R = R.maximalIntersectWith(NotZero); + R = R.intersectWith(NotZero); } - // But, the maximal intersection might still include zero. If it does, then - // we know it also included one. + // But, the intersection might still include zero. If it does, then we know + // it also included one. if (R.contains(APInt::getNullValue(L.getBitWidth()))) Upper = L.getUnsignedMax(); else @@ -295,5 +294,5 @@ void LoopVR::narrow(Value *V, const ConstantRange &CR) { if (I == Map.end()) Map[V] = new ConstantRange(CR); else - Map[V] = new ConstantRange(Map[V]->maximalIntersectWith(CR)); + Map[V] = new ConstantRange(Map[V]->intersectWith(CR)); } |