mirror of
https://github.com/intel/llvm.git
synced 2026-02-08 17:28:30 +08:00
[SCEV] Constify some uses of SCEVUnionPredicate* [NFC]
This exploits the immutability introduced in d334fec.
This commit is contained in:
@@ -437,7 +437,7 @@ public:
|
||||
|
||||
/// Returns a reference to a vector containing all predicates which apply to
|
||||
/// \p Expr.
|
||||
ArrayRef<const SCEVPredicate *> getPredicatesForExpr(const SCEV *Expr);
|
||||
ArrayRef<const SCEVPredicate *> getPredicatesForExpr(const SCEV *Expr) const;
|
||||
|
||||
/// Implementation of the SCEVPredicate interface
|
||||
bool isAlwaysTrue() const override;
|
||||
@@ -1176,7 +1176,7 @@ public:
|
||||
|
||||
/// Re-writes the SCEV according to the Predicates in \p A.
|
||||
const SCEV *rewriteUsingPredicate(const SCEV *S, const Loop *L,
|
||||
SCEVUnionPredicate &A);
|
||||
const SCEVUnionPredicate &A);
|
||||
/// Tries to convert the \p S expression to an AddRec expression,
|
||||
/// adding additional predicates to \p Preds as required.
|
||||
const SCEVAddRecExpr *convertSCEVToAddRecWithPredicates(
|
||||
|
||||
@@ -13630,7 +13630,7 @@ public:
|
||||
/// \p NewPreds such that the result will be an AddRecExpr.
|
||||
static const SCEV *rewrite(const SCEV *S, const Loop *L, ScalarEvolution &SE,
|
||||
SmallPtrSetImpl<const SCEVPredicate *> *NewPreds,
|
||||
SCEVUnionPredicate *Pred) {
|
||||
const SCEVUnionPredicate *Pred) {
|
||||
SCEVPredicateRewriter Rewriter(L, SE, NewPreds, Pred);
|
||||
return Rewriter.visit(S);
|
||||
}
|
||||
@@ -13682,7 +13682,7 @@ public:
|
||||
private:
|
||||
explicit SCEVPredicateRewriter(const Loop *L, ScalarEvolution &SE,
|
||||
SmallPtrSetImpl<const SCEVPredicate *> *NewPreds,
|
||||
SCEVUnionPredicate *Pred)
|
||||
const SCEVUnionPredicate *Pred)
|
||||
: SCEVRewriteVisitor(SE), NewPreds(NewPreds), Pred(Pred), L(L) {}
|
||||
|
||||
bool addOverflowAssumption(const SCEVPredicate *P) {
|
||||
@@ -13727,14 +13727,15 @@ private:
|
||||
}
|
||||
|
||||
SmallPtrSetImpl<const SCEVPredicate *> *NewPreds;
|
||||
SCEVUnionPredicate *Pred;
|
||||
const SCEVUnionPredicate *Pred;
|
||||
const Loop *L;
|
||||
};
|
||||
|
||||
} // end anonymous namespace
|
||||
|
||||
const SCEV *ScalarEvolution::rewriteUsingPredicate(const SCEV *S, const Loop *L,
|
||||
SCEVUnionPredicate &Preds) {
|
||||
const SCEV *
|
||||
ScalarEvolution::rewriteUsingPredicate(const SCEV *S, const Loop *L,
|
||||
const SCEVUnionPredicate &Preds) {
|
||||
return SCEVPredicateRewriter::rewrite(S, L, *this, nullptr, &Preds);
|
||||
}
|
||||
|
||||
@@ -13861,7 +13862,7 @@ bool SCEVUnionPredicate::isAlwaysTrue() const {
|
||||
}
|
||||
|
||||
ArrayRef<const SCEVPredicate *>
|
||||
SCEVUnionPredicate::getPredicatesForExpr(const SCEV *Expr) {
|
||||
SCEVUnionPredicate::getPredicatesForExpr(const SCEV *Expr) const {
|
||||
auto I = SCEVToPreds.find(Expr);
|
||||
if (I == SCEVToPreds.end())
|
||||
return ArrayRef<const SCEVPredicate *>();
|
||||
|
||||
Reference in New Issue
Block a user