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;
}
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); }
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 {
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 {
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();
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 {
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 << ")";
}
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 << ")";
}
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 << ")";
}
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());