summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2009-07-18 06:34:42 +0000
committerNick Lewycky <nicholas@mxc.ca>2009-07-18 06:34:42 +0000
commit0d1390356312fbaff47dcbffa53d2579de47378f (patch)
tree119d098082d6b2a6810a5a1e35cf90252bb8eba2 /llvm/lib/Analysis
parente9812bdac5c678e635fde0b056087cea89589e06 (diff)
downloadbcm5719-llvm-0d1390356312fbaff47dcbffa53d2579de47378f.tar.gz
bcm5719-llvm-0d1390356312fbaff47dcbffa53d2579de47378f.zip
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. llvm-svn: 76289
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r--llvm/lib/Analysis/LoopVR.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/Analysis/LoopVR.cpp b/llvm/lib/Analysis/LoopVR.cpp
index 6854e950ef8..e4dac8f1f9b 100644
--- a/llvm/lib/Analysis/LoopVR.cpp
+++ b/llvm/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));
}
OpenPOWER on IntegriCloud