diff options
author | Dan Gohman <gohman@apple.com> | 2008-06-22 19:23:09 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-06-22 19:23:09 +0000 |
commit | 17f1972c770dc18f5c7c3c95776b4d62ae9e121d (patch) | |
tree | 57ff8e11cc6f02c82e1595479f9bacd978a7075e /lib/Analysis/ScalarEvolutionExpander.cpp | |
parent | 09d3fdc254c0b922c38f7c2bcad27c02fa0904f3 (diff) |
Use SCEVAddRecExpr::isAffine.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52614 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/ScalarEvolutionExpander.cpp')
-rw-r--r-- | lib/Analysis/ScalarEvolutionExpander.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Analysis/ScalarEvolutionExpander.cpp b/lib/Analysis/ScalarEvolutionExpander.cpp index 07850f77a1..593e27300d 100644 --- a/lib/Analysis/ScalarEvolutionExpander.cpp +++ b/lib/Analysis/ScalarEvolutionExpander.cpp @@ -147,7 +147,7 @@ Value *SCEVExpander::visitAddRecExpr(SCEVAddRecExpr *S) { } // {0,+,1} --> Insert a canonical induction variable into the loop! - if (S->getNumOperands() == 2 && + if (S->isAffine() && S->getOperand(1) == SE.getIntegerSCEV(1, Ty)) { // Create and insert the PHI node for the induction variable in the // specified loop. @@ -178,7 +178,7 @@ Value *SCEVExpander::visitAddRecExpr(SCEVAddRecExpr *S) { Value *I = getOrInsertCanonicalInductionVariable(L, Ty); // If this is a simple linear addrec, emit it now as a special case. - if (S->getNumOperands() == 2) { // {0,+,F} --> i*F + if (S->isAffine()) { // {0,+,F} --> i*F Value *F = expand(S->getOperand(1)); // IF the step is by one, just return the inserted IV. |