diff options
| author | Dan Gohman <gohman@apple.com> | 2010-08-19 01:02:31 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2010-08-19 01:02:31 +0000 |
| commit | 129a816ee6eee8b3ab4bf321836a8e5d44963a7e (patch) | |
| tree | f1985596fc08e37281433e9efdd1c4d2bc06fc4a /llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp | |
| parent | beb506eeedc5fa8d59b736f987895da464cae1af (diff) | |
| download | llvm-129a816ee6eee8b3ab4bf321836a8e5d44963a7e.zip llvm-129a816ee6eee8b3ab4bf321836a8e5d44963a7e.tar.gz llvm-129a816ee6eee8b3ab4bf321836a8e5d44963a7e.tar.bz2 | |
Process the step before the start, because it's usually the simpler
of the two.
llvm-svn: 111495
Diffstat (limited to 'llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp index f7b67113..64d493c 100644 --- a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp +++ b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp @@ -441,12 +441,12 @@ static const SCEV *getExactSDiv(const SCEV *LHS, const SCEV *RHS, // Distribute the sdiv over addrec operands, if the addrec doesn't overflow. if (const SCEVAddRecExpr *AR = dyn_cast<SCEVAddRecExpr>(LHS)) { if (IgnoreSignificantBits || isAddRecSExtable(AR, SE)) { - const SCEV *Start = getExactSDiv(AR->getStart(), RHS, SE, - IgnoreSignificantBits); - if (!Start) return 0; const SCEV *Step = getExactSDiv(AR->getStepRecurrence(SE), RHS, SE, IgnoreSignificantBits); if (!Step) return 0; + const SCEV *Start = getExactSDiv(AR->getStart(), RHS, SE, + IgnoreSignificantBits); + if (!Start) return 0; return SE.getAddRecExpr(Start, Step, AR->getLoop()); } return 0; |
