[llvm-commits] [polly] r144904 - /polly/trunk/lib/Support/SCEVValidator.cpp
Tobias Grosser
grosser at fim.uni-passau.de
Thu Nov 17 04:56:15 PST 2011
Author: grosser
Date: Thu Nov 17 06:56:14 2011
New Revision: 144904
URL: http://llvm.org/viewvc/llvm-project?rev=144904&view=rev
Log:
SCEVValidator: Restructure the logic of visitAddRecExpr
Suggested by Sebastian Pop.
Modified:
polly/trunk/lib/Support/SCEVValidator.cpp
Modified: polly/trunk/lib/Support/SCEVValidator.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Support/SCEVValidator.cpp?rev=144904&r1=144903&r2=144904&view=diff
==============================================================================
--- polly/trunk/lib/Support/SCEVValidator.cpp (original)
+++ polly/trunk/lib/Support/SCEVValidator.cpp Thu Nov 17 06:56:14 2011
@@ -157,23 +157,23 @@
ValidatorResult Start = visit(Expr->getStart());
ValidatorResult Recurrence = visit(Expr->getStepRecurrence(SE));
- if (!Start.isValid() || !Recurrence.isValid() || Recurrence.isIV())
+ if (!Start.isValid() || !Recurrence.isConstant())
return ValidatorResult(SCEVType::INVALID);
+ if (R->contains(Expr->getLoop())) {
+ if (Recurrence.isINT()) {
+ ValidatorResult Result(SCEVType::IV);
+ Result.addParamsFrom(Start);
+ return Result;
+ }
- if (!R->contains(Expr->getLoop())) {
- if (Start.isIV())
- return ValidatorResult(SCEVType::INVALID);
- else
- return ValidatorResult(SCEVType::PARAM, Expr);
+ return ValidatorResult(SCEVType::INVALID);
}
- if (!Recurrence.isINT())
- return ValidatorResult(SCEVType::INVALID);
+ if (Start.isConstant())
+ return ValidatorResult(SCEVType::PARAM, Expr);
- ValidatorResult Result(SCEVType::IV);
- Result.addParamsFrom(Start);
- return Result;
+ return ValidatorResult(SCEVType::INVALID);
}
struct ValidatorResult visitSMaxExpr(const SCEVSMaxExpr *Expr) {
More information about the llvm-commits
mailing list