[llvm] r272759 - [SCEV] Use dyn_cast<T> instead of dyn_cast<const T>; NFC
Sanjoy Das via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 14 23:53:56 PDT 2016
Author: sanjoy
Date: Wed Jun 15 01:53:55 2016
New Revision: 272759
URL: http://llvm.org/viewvc/llvm-project?rev=272759&view=rev
Log:
[SCEV] Use dyn_cast<T> instead of dyn_cast<const T>; NFC
The const is unnecessary.
Modified:
llvm/trunk/lib/Analysis/ScalarEvolution.cpp
Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=272759&r1=272758&r2=272759&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Wed Jun 15 01:53:55 2016
@@ -725,7 +725,7 @@ public:
}
// Split the Denominator when it is a product.
- if (const SCEVMulExpr *T = dyn_cast<const SCEVMulExpr>(Denominator)) {
+ if (const SCEVMulExpr *T = dyn_cast<SCEVMulExpr>(Denominator)) {
const SCEV *Q, *R;
*Quotient = Numerator;
for (const SCEV *Op : T->operands()) {
@@ -10132,7 +10132,7 @@ public:
const SCEV *visitUnknown(const SCEVUnknown *Expr) {
auto ExprPreds = P.getPredicatesForExpr(Expr);
for (auto *Pred : ExprPreds)
- if (const auto *IPred = dyn_cast<const SCEVEqualPredicate>(Pred))
+ if (const auto *IPred = dyn_cast<SCEVEqualPredicate>(Pred))
if (IPred->getLHS() == Expr)
return IPred->getRHS();
@@ -10141,7 +10141,7 @@ public:
const SCEV *visitZeroExtendExpr(const SCEVZeroExtendExpr *Expr) {
const SCEV *Operand = visit(Expr->getOperand());
- const SCEVAddRecExpr *AR = dyn_cast<const SCEVAddRecExpr>(Operand);
+ const SCEVAddRecExpr *AR = dyn_cast<SCEVAddRecExpr>(Operand);
if (AR && AR->getLoop() == L && AR->isAffine()) {
// This couldn't be folded because the operand didn't have the nuw
// flag. Add the nusw flag as an assumption that we could make.
@@ -10157,7 +10157,7 @@ public:
const SCEV *visitSignExtendExpr(const SCEVSignExtendExpr *Expr) {
const SCEV *Operand = visit(Expr->getOperand());
- const SCEVAddRecExpr *AR = dyn_cast<const SCEVAddRecExpr>(Operand);
+ const SCEVAddRecExpr *AR = dyn_cast<SCEVAddRecExpr>(Operand);
if (AR && AR->getLoop() == L && AR->isAffine()) {
// This couldn't be folded because the operand didn't have the nsw
// flag. Add the nssw flag as an assumption that we could make.
@@ -10223,7 +10223,7 @@ SCEVEqualPredicate::SCEVEqualPredicate(c
: SCEVPredicate(ID, P_Equal), LHS(LHS), RHS(RHS) {}
bool SCEVEqualPredicate::implies(const SCEVPredicate *N) const {
- const auto *Op = dyn_cast<const SCEVEqualPredicate>(N);
+ const auto *Op = dyn_cast<SCEVEqualPredicate>(N);
if (!Op)
return false;
@@ -10310,7 +10310,7 @@ SCEVUnionPredicate::getPredicatesForExpr
}
bool SCEVUnionPredicate::implies(const SCEVPredicate *N) const {
- if (const auto *Set = dyn_cast<const SCEVUnionPredicate>(N))
+ if (const auto *Set = dyn_cast<SCEVUnionPredicate>(N))
return all_of(Set->Preds,
[this](const SCEVPredicate *I) { return this->implies(I); });
@@ -10331,7 +10331,7 @@ void SCEVUnionPredicate::print(raw_ostre
}
void SCEVUnionPredicate::add(const SCEVPredicate *N) {
- if (const auto *Set = dyn_cast<const SCEVUnionPredicate>(N)) {
+ if (const auto *Set = dyn_cast<SCEVUnionPredicate>(N)) {
for (auto Pred : Set->Preds)
add(Pred);
return;
More information about the llvm-commits
mailing list