[llvm-commits] [llvm] r53269 - in /llvm/trunk: include/llvm/Analysis/ScalarEvolution.h include/llvm/Analysis/ScalarEvolutionExpressions.h lib/Analysis/ScalarEvolution.cpp

Nick Lewycky nicholas at mxc.ca
Tue Jul 8 20:21:57 PDT 2008


Author: nicholas
Date: Tue Jul  8 22:21:51 2008
New Revision: 53269

URL: http://llvm.org/viewvc/llvm-project?rev=53269&view=rev
Log:
Remove getValueRange from SCEV. It wasn't doing anything there anyways, and a
more complete version is now available from the LoopVR pass.

Modified:
    llvm/trunk/include/llvm/Analysis/ScalarEvolution.h
    llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpressions.h
    llvm/trunk/lib/Analysis/ScalarEvolution.cpp

Modified: llvm/trunk/include/llvm/Analysis/ScalarEvolution.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ScalarEvolution.h?rev=53269&r1=53268&r2=53269&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Analysis/ScalarEvolution.h (original)
+++ llvm/trunk/include/llvm/Analysis/ScalarEvolution.h Tue Jul  8 22:21:51 2008
@@ -59,10 +59,6 @@
 
     unsigned getSCEVType() const { return SCEVType; }
 
-    /// getValueRange - Return the tightest constant bounds that this value is
-    /// known to have.  This method is only valid on integer SCEV objects.
-    virtual ConstantRange getValueRange() const;
-
     /// isLoopInvariant - Return true if the value of this SCEV is unchanging in
     /// the specified loop.
     virtual bool isLoopInvariant(const Loop *L) const = 0;

Modified: llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpressions.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpressions.h?rev=53269&r1=53268&r2=53269&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpressions.h (original)
+++ llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpressions.h Tue Jul  8 22:21:51 2008
@@ -42,10 +42,6 @@
   public:
     ConstantInt *getValue() const { return V; }
 
-    /// getValueRange - Return the tightest constant bounds that this value is
-    /// known to have.  This method is only valid on integer SCEV objects.
-    virtual ConstantRange getValueRange() const;
-
     virtual bool isLoopInvariant(const Loop *L) const {
       return true;
     }
@@ -104,10 +100,6 @@
       return SE.getTruncateExpr(H, Ty);
     }
 
-    /// getValueRange - Return the tightest constant bounds that this value is
-    /// known to have.  This method is only valid on integer SCEV objects.
-    virtual ConstantRange getValueRange() const;
-
     virtual void print(std::ostream &OS) const;
     void print(std::ostream *OS) const { if (OS) print(*OS); }
 
@@ -141,10 +133,6 @@
       return Op->hasComputableLoopEvolution(L);
     }
 
-    /// getValueRange - Return the tightest constant bounds that this value is
-    /// known to have.  This method is only valid on integer SCEV objects.
-    virtual ConstantRange getValueRange() const;
-
     SCEVHandle replaceSymbolicValuesWithConcrete(const SCEVHandle &Sym,
                                                  const SCEVHandle &Conc,
                                                  ScalarEvolution &SE) const {
@@ -187,10 +175,6 @@
       return Op->hasComputableLoopEvolution(L);
     }
 
-    /// getValueRange - Return the tightest constant bounds that this value is
-    /// known to have.  This method is only valid on integer SCEV objects.
-    virtual ConstantRange getValueRange() const;
-
     SCEVHandle replaceSymbolicValuesWithConcrete(const SCEVHandle &Sym,
                                                  const SCEVHandle &Conc,
                                                  ScalarEvolution &SE) const {

Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=53269&r1=53268&r2=53269&view=diff

==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Tue Jul  8 22:21:51 2008
@@ -117,15 +117,6 @@
   print(cerr);
 }
 
-/// getValueRange - Return the tightest constant bounds that this value is
-/// known to have.  This method is only valid on integer SCEV objects.
-ConstantRange SCEV::getValueRange() const {
-  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(getBitWidth());
-}
-
 uint32_t SCEV::getBitWidth() const {
   if (const IntegerType* ITy = dyn_cast<IntegerType>(getType()))
     return ITy->getBitWidth();
@@ -192,10 +183,6 @@
   return getConstant(ConstantInt::get(Val));
 }
 
-ConstantRange SCEVConstant::getValueRange() const {
-  return ConstantRange(V->getValue());
-}
-
 const Type *SCEVConstant::getType() const { return V->getType(); }
 
 void SCEVConstant::print(std::ostream &OS) const {
@@ -220,10 +207,6 @@
   SCEVTruncates->erase(std::make_pair(Op, Ty));
 }
 
-ConstantRange SCEVTruncateExpr::getValueRange() const {
-  return getOperand()->getValueRange().truncate(getBitWidth());
-}
-
 void SCEVTruncateExpr::print(std::ostream &OS) const {
   OS << "(truncate " << *Op << " to " << *Ty << ")";
 }
@@ -246,10 +229,6 @@
   SCEVZeroExtends->erase(std::make_pair(Op, Ty));
 }
 
-ConstantRange SCEVZeroExtendExpr::getValueRange() const {
-  return getOperand()->getValueRange().zeroExtend(getBitWidth());
-}
-
 void SCEVZeroExtendExpr::print(std::ostream &OS) const {
   OS << "(zeroextend " << *Op << " to " << *Ty << ")";
 }
@@ -272,10 +251,6 @@
   SCEVSignExtends->erase(std::make_pair(Op, Ty));
 }
 
-ConstantRange SCEVSignExtendExpr::getValueRange() const {
-  return getOperand()->getValueRange().signExtend(getBitWidth());
-}
-
 void SCEVSignExtendExpr::print(std::ostream &OS) const {
   OS << "(signextend " << *Op << " to " << *Ty << ")";
 }
@@ -2906,12 +2881,6 @@
       SV->print(OS);
       OS << "\t\t";
 
-      if ((*I).getType()->isInteger()) {
-        ConstantRange Bounds = SV->getValueRange();
-        if (!Bounds.isFullSet())
-          OS << "Bounds: " << Bounds << " ";
-      }
-
       if (const Loop *L = LI.getLoopFor((*I).getParent())) {
         OS << "Exits: ";
         SCEVHandle ExitValue = getSCEVAtScope(&*I, L->getParentLoop());





More information about the llvm-commits mailing list