aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Analysis/ScalarEvolutionExpressions.h
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2009-06-22 21:39:50 +0000
committerOwen Anderson <resistor@mac.com>2009-06-22 21:39:50 +0000
commit372b46cad9f745859f542f9d2216991585ae83f4 (patch)
tree7d2038817349cb030a0b49423a325620dbaa1cb5 /include/llvm/Analysis/ScalarEvolutionExpressions.h
parent9170ab6685fcd820c6274e761b8c3a71f25ae074 (diff)
downloadexternal_llvm-372b46cad9f745859f542f9d2216991585ae83f4.zip
external_llvm-372b46cad9f745859f542f9d2216991585ae83f4.tar.gz
external_llvm-372b46cad9f745859f542f9d2216991585ae83f4.tar.bz2
SCEVHandle is no more!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73906 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis/ScalarEvolutionExpressions.h')
-rw-r--r--include/llvm/Analysis/ScalarEvolutionExpressions.h95
1 files changed, 48 insertions, 47 deletions
diff --git a/include/llvm/Analysis/ScalarEvolutionExpressions.h b/include/llvm/Analysis/ScalarEvolutionExpressions.h
index 0cc50f7..8bfd29c 100644
--- a/include/llvm/Analysis/ScalarEvolutionExpressions.h
+++ b/include/llvm/Analysis/ScalarEvolutionExpressions.h
@@ -51,8 +51,8 @@ namespace llvm {
virtual const Type *getType() const;
- SCEVHandle replaceSymbolicValuesWithConcrete(const SCEVHandle &Sym,
- const SCEVHandle &Conc,
+ const SCEV* replaceSymbolicValuesWithConcrete(const SCEV* Sym,
+ const SCEV* Conc,
ScalarEvolution &SE) const {
return this;
}
@@ -75,15 +75,15 @@ namespace llvm {
///
class SCEVCastExpr : public SCEV {
protected:
- SCEVHandle Op;
+ const SCEV* Op;
const Type *Ty;
- SCEVCastExpr(unsigned SCEVTy, const SCEVHandle &op, const Type *ty,
+ SCEVCastExpr(unsigned SCEVTy, const SCEV* op, const Type *ty,
const ScalarEvolution* p);
virtual ~SCEVCastExpr();
public:
- const SCEVHandle &getOperand() const { return Op; }
+ const SCEV* getOperand() const { return Op; }
virtual const Type *getType() const { return Ty; }
virtual bool isLoopInvariant(const Loop *L) const {
@@ -112,14 +112,14 @@ namespace llvm {
class SCEVTruncateExpr : public SCEVCastExpr {
friend class ScalarEvolution;
- SCEVTruncateExpr(const SCEVHandle &op, const Type *ty,
+ SCEVTruncateExpr(const SCEV* op, const Type *ty,
const ScalarEvolution* p);
public:
- SCEVHandle replaceSymbolicValuesWithConcrete(const SCEVHandle &Sym,
- const SCEVHandle &Conc,
+ const SCEV* replaceSymbolicValuesWithConcrete(const SCEV* Sym,
+ const SCEV* Conc,
ScalarEvolution &SE) const {
- SCEVHandle H = Op->replaceSymbolicValuesWithConcrete(Sym, Conc, SE);
+ const SCEV* H = Op->replaceSymbolicValuesWithConcrete(Sym, Conc, SE);
if (H == Op)
return this;
return SE.getTruncateExpr(H, Ty);
@@ -141,14 +141,14 @@ namespace llvm {
class SCEVZeroExtendExpr : public SCEVCastExpr {
friend class ScalarEvolution;
- SCEVZeroExtendExpr(const SCEVHandle &op, const Type *ty,
+ SCEVZeroExtendExpr(const SCEV* op, const Type *ty,
const ScalarEvolution* p);
public:
- SCEVHandle replaceSymbolicValuesWithConcrete(const SCEVHandle &Sym,
- const SCEVHandle &Conc,
+ const SCEV* replaceSymbolicValuesWithConcrete(const SCEV* Sym,
+ const SCEV* Conc,
ScalarEvolution &SE) const {
- SCEVHandle H = Op->replaceSymbolicValuesWithConcrete(Sym, Conc, SE);
+ const SCEV* H = Op->replaceSymbolicValuesWithConcrete(Sym, Conc, SE);
if (H == Op)
return this;
return SE.getZeroExtendExpr(H, Ty);
@@ -170,14 +170,14 @@ namespace llvm {
class SCEVSignExtendExpr : public SCEVCastExpr {
friend class ScalarEvolution;
- SCEVSignExtendExpr(const SCEVHandle &op, const Type *ty,
+ SCEVSignExtendExpr(const SCEV* op, const Type *ty,
const ScalarEvolution* p);
public:
- SCEVHandle replaceSymbolicValuesWithConcrete(const SCEVHandle &Sym,
- const SCEVHandle &Conc,
+ const SCEV* replaceSymbolicValuesWithConcrete(const SCEV* Sym,
+ const SCEV* Conc,
ScalarEvolution &SE) const {
- SCEVHandle H = Op->replaceSymbolicValuesWithConcrete(Sym, Conc, SE);
+ const SCEV* H = Op->replaceSymbolicValuesWithConcrete(Sym, Conc, SE);
if (H == Op)
return this;
return SE.getSignExtendExpr(H, Ty);
@@ -199,22 +199,22 @@ namespace llvm {
///
class SCEVNAryExpr : public SCEV {
protected:
- SmallVector<SCEVHandle, 8> Operands;
+ SmallVector<const SCEV*, 8> Operands;
- SCEVNAryExpr(enum SCEVTypes T, const SmallVectorImpl<SCEVHandle> &ops,
+ SCEVNAryExpr(enum SCEVTypes T, const SmallVectorImpl<const SCEV*> &ops,
const ScalarEvolution* p)
: SCEV(T, p), Operands(ops.begin(), ops.end()) {}
virtual ~SCEVNAryExpr() {}
public:
unsigned getNumOperands() const { return (unsigned)Operands.size(); }
- const SCEVHandle &getOperand(unsigned i) const {
+ const SCEV* getOperand(unsigned i) const {
assert(i < Operands.size() && "Operand index out of range!");
return Operands[i];
}
- const SmallVectorImpl<SCEVHandle> &getOperands() const { return Operands; }
- typedef SmallVectorImpl<SCEVHandle>::const_iterator op_iterator;
+ const SmallVectorImpl<const SCEV*> &getOperands() const { return Operands; }
+ typedef SmallVectorImpl<const SCEV*>::const_iterator op_iterator;
op_iterator op_begin() const { return Operands.begin(); }
op_iterator op_end() const { return Operands.end(); }
@@ -261,13 +261,13 @@ namespace llvm {
class SCEVCommutativeExpr : public SCEVNAryExpr {
protected:
SCEVCommutativeExpr(enum SCEVTypes T,
- const SmallVectorImpl<SCEVHandle> &ops,
+ const SmallVectorImpl<const SCEV*> &ops,
const ScalarEvolution* p)
: SCEVNAryExpr(T, ops, p) {}
public:
- SCEVHandle replaceSymbolicValuesWithConcrete(const SCEVHandle &Sym,
- const SCEVHandle &Conc,
+ const SCEV* replaceSymbolicValuesWithConcrete(const SCEV* Sym,
+ const SCEV* Conc,
ScalarEvolution &SE) const;
virtual const char *getOperationStr() const = 0;
@@ -291,7 +291,7 @@ namespace llvm {
class SCEVAddExpr : public SCEVCommutativeExpr {
friend class ScalarEvolution;
- explicit SCEVAddExpr(const SmallVectorImpl<SCEVHandle> &ops,
+ explicit SCEVAddExpr(const SmallVectorImpl<const SCEV*> &ops,
const ScalarEvolution* p)
: SCEVCommutativeExpr(scAddExpr, ops, p) {
}
@@ -312,7 +312,7 @@ namespace llvm {
class SCEVMulExpr : public SCEVCommutativeExpr {
friend class ScalarEvolution;
- explicit SCEVMulExpr(const SmallVectorImpl<SCEVHandle> &ops,
+ explicit SCEVMulExpr(const SmallVectorImpl<const SCEV*> &ops,
const ScalarEvolution* p)
: SCEVCommutativeExpr(scMulExpr, ops, p) {
}
@@ -334,14 +334,15 @@ namespace llvm {
class SCEVUDivExpr : public SCEV {
friend class ScalarEvolution;
- SCEVHandle LHS, RHS;
- SCEVUDivExpr(const SCEVHandle &lhs, const SCEVHandle &rhs,
+ const SCEV* LHS;
+ const SCEV* RHS;
+ SCEVUDivExpr(const SCEV* lhs, const SCEV* rhs,
const ScalarEvolution* p)
: SCEV(scUDivExpr, p), LHS(lhs), RHS(rhs) {}
public:
- const SCEVHandle &getLHS() const { return LHS; }
- const SCEVHandle &getRHS() const { return RHS; }
+ const SCEV* getLHS() const { return LHS; }
+ const SCEV* getRHS() const { return RHS; }
virtual bool isLoopInvariant(const Loop *L) const {
return LHS->isLoopInvariant(L) && RHS->isLoopInvariant(L);
@@ -352,11 +353,11 @@ namespace llvm {
RHS->hasComputableLoopEvolution(L);
}
- SCEVHandle replaceSymbolicValuesWithConcrete(const SCEVHandle &Sym,
- const SCEVHandle &Conc,
+ const SCEV* replaceSymbolicValuesWithConcrete(const SCEV* Sym,
+ const SCEV* Conc,
ScalarEvolution &SE) const {
- SCEVHandle L = LHS->replaceSymbolicValuesWithConcrete(Sym, Conc, SE);
- SCEVHandle R = RHS->replaceSymbolicValuesWithConcrete(Sym, Conc, SE);
+ const SCEV* L = LHS->replaceSymbolicValuesWithConcrete(Sym, Conc, SE);
+ const SCEV* R = RHS->replaceSymbolicValuesWithConcrete(Sym, Conc, SE);
if (L == LHS && R == RHS)
return this;
else
@@ -391,7 +392,7 @@ namespace llvm {
const Loop *L;
- SCEVAddRecExpr(const SmallVectorImpl<SCEVHandle> &ops, const Loop *l,
+ SCEVAddRecExpr(const SmallVectorImpl<const SCEV*> &ops, const Loop *l,
const ScalarEvolution* p)
: SCEVNAryExpr(scAddRecExpr, ops, p), L(l) {
for (size_t i = 0, e = Operands.size(); i != e; ++i)
@@ -400,15 +401,15 @@ namespace llvm {
}
public:
- const SCEVHandle &getStart() const { return Operands[0]; }
+ const SCEV* getStart() const { return Operands[0]; }
const Loop *getLoop() const { return L; }
/// getStepRecurrence - This method constructs and returns the recurrence
/// indicating how much this expression steps by. If this is a polynomial
/// of degree N, it returns a chrec of degree N-1.
- SCEVHandle getStepRecurrence(ScalarEvolution &SE) const {
+ const SCEV* getStepRecurrence(ScalarEvolution &SE) const {
if (isAffine()) return getOperand(1);
- return SE.getAddRecExpr(SmallVector<SCEVHandle, 3>(op_begin()+1,op_end()),
+ return SE.getAddRecExpr(SmallVector<const SCEV*, 3>(op_begin()+1,op_end()),
getLoop());
}
@@ -436,7 +437,7 @@ namespace llvm {
/// evaluateAtIteration - Return the value of this chain of recurrences at
/// the specified iteration number.
- SCEVHandle evaluateAtIteration(SCEVHandle It, ScalarEvolution &SE) const;
+ const SCEV* evaluateAtIteration(const SCEV* It, ScalarEvolution &SE) const;
/// getNumIterationsInRange - Return the number of iterations of this loop
/// that produce values in the specified constant range. Another way of
@@ -444,11 +445,11 @@ namespace llvm {
/// value is not in the condition, thus computing the exit count. If the
/// iteration count can't be computed, an instance of SCEVCouldNotCompute is
/// returned.
- SCEVHandle getNumIterationsInRange(ConstantRange Range,
+ const SCEV* getNumIterationsInRange(ConstantRange Range,
ScalarEvolution &SE) const;
- SCEVHandle replaceSymbolicValuesWithConcrete(const SCEVHandle &Sym,
- const SCEVHandle &Conc,
+ const SCEV* replaceSymbolicValuesWithConcrete(const SCEV* Sym,
+ const SCEV* Conc,
ScalarEvolution &SE) const;
virtual void print(raw_ostream &OS) const;
@@ -467,7 +468,7 @@ namespace llvm {
class SCEVSMaxExpr : public SCEVCommutativeExpr {
friend class ScalarEvolution;
- explicit SCEVSMaxExpr(const SmallVectorImpl<SCEVHandle> &ops,
+ explicit SCEVSMaxExpr(const SmallVectorImpl<const SCEV*> &ops,
const ScalarEvolution* p)
: SCEVCommutativeExpr(scSMaxExpr, ops, p) {
}
@@ -489,7 +490,7 @@ namespace llvm {
class SCEVUMaxExpr : public SCEVCommutativeExpr {
friend class ScalarEvolution;
- explicit SCEVUMaxExpr(const SmallVectorImpl<SCEVHandle> &ops,
+ explicit SCEVUMaxExpr(const SmallVectorImpl<const SCEV*> &ops,
const ScalarEvolution* p)
: SCEVCommutativeExpr(scUMaxExpr, ops, p) {
}
@@ -525,8 +526,8 @@ namespace llvm {
return false; // not computable
}
- SCEVHandle replaceSymbolicValuesWithConcrete(const SCEVHandle &Sym,
- const SCEVHandle &Conc,
+ const SCEV* replaceSymbolicValuesWithConcrete(const SCEV* Sym,
+ const SCEV* Conc,
ScalarEvolution &SE) const {
if (&*Sym == this) return Conc;
return this;