summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/ScalarEvolutionExpander.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-06-22 19:23:09 +0000
committerDan Gohman <gohman@apple.com>2008-06-22 19:23:09 +0000
commit6829fffaeeb6f1de974183d7f34299a4ed2736e6 (patch)
tree4859cf7993bae2858fccc1836365b1ef9215e1a9 /llvm/lib/Analysis/ScalarEvolutionExpander.cpp
parent1f2b2a4abe95d8602bacffbfb4c6e4c797b9e437 (diff)
downloadbcm5719-llvm-6829fffaeeb6f1de974183d7f34299a4ed2736e6.tar.gz
bcm5719-llvm-6829fffaeeb6f1de974183d7f34299a4ed2736e6.zip
Use SCEVAddRecExpr::isAffine.
llvm-svn: 52614
Diffstat (limited to 'llvm/lib/Analysis/ScalarEvolutionExpander.cpp')
-rw-r--r--llvm/lib/Analysis/ScalarEvolutionExpander.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolutionExpander.cpp b/llvm/lib/Analysis/ScalarEvolutionExpander.cpp
index 07850f77a14..593e27300d3 100644
--- a/llvm/lib/Analysis/ScalarEvolutionExpander.cpp
+++ b/llvm/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.
OpenPOWER on IntegriCloud