[llvm-commits] CVS: llvm/lib/Analysis/ScalarEvolution.cpp

Reid Spencer reid at x10sys.com
Wed Feb 28 14:04:12 PST 2007



Changes in directory llvm/lib/Analysis:

ScalarEvolution.cpp updated: 1.95 -> 1.96
---
Log message:

For PR1205: http://llvm.org/PR1205 :
Adjust to changes in ConstantRange interface.


---
Diffs of the changes:  (+5 -4)

 ScalarEvolution.cpp |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)


Index: llvm/lib/Analysis/ScalarEvolution.cpp
diff -u llvm/lib/Analysis/ScalarEvolution.cpp:1.95 llvm/lib/Analysis/ScalarEvolution.cpp:1.96
--- llvm/lib/Analysis/ScalarEvolution.cpp:1.95	Wed Feb 28 13:57:34 2007
+++ llvm/lib/Analysis/ScalarEvolution.cpp	Wed Feb 28 16:03:51 2007
@@ -124,7 +124,7 @@
   const Type *Ty = getType();
   assert(Ty->isInteger() && "Can't get range for a non-integer SCEV!");
   // Default to a full range if no better information is available.
-  return ConstantRange(getType());
+  return ConstantRange(getBitWidth());
 }
 
 uint32_t SCEV::getBitWidth() const {
@@ -211,7 +211,7 @@
 }
 
 ConstantRange SCEVTruncateExpr::getValueRange() const {
-  return getOperand()->getValueRange().truncate(getType());
+  return getOperand()->getValueRange().truncate(getBitWidth());
 }
 
 void SCEVTruncateExpr::print(std::ostream &OS) const {
@@ -237,7 +237,7 @@
 }
 
 ConstantRange SCEVZeroExtendExpr::getValueRange() const {
-  return getOperand()->getValueRange().zeroExtend(getType());
+  return getOperand()->getValueRange().zeroExtend(getBitWidth());
 }
 
 void SCEVZeroExtendExpr::print(std::ostream &OS) const {
@@ -1572,7 +1572,8 @@
           ConstantExpr::getBitCast(CompVal, RealTy));
         if (CompVal) {
           // Form the constant range.
-          ConstantRange CompRange(Cond, CompVal->getValue());
+          ConstantRange CompRange(
+              ICmpInst::makeConstantRange(Cond, CompVal->getValue()));
 
           SCEVHandle Ret = AddRec->getNumIterationsInRange(CompRange, 
               false /*Always treat as unsigned range*/);






More information about the llvm-commits mailing list