diff options
| author | Dan Gohman <gohman@apple.com> | 2009-02-14 02:25:19 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2009-02-14 02:25:19 +0000 |
| commit | cd3eb9b09882087761c811d349c2b3be4e5c8a34 (patch) | |
| tree | 0bfe0a3acdc25f90888825b3336ee7fee1895653 /lib/Transforms | |
| parent | b463272fbbc4002db57fa8fb5b54c21ced465fbf (diff) | |
| download | llvm-cd3eb9b09882087761c811d349c2b3be4e5c8a34.tar.gz llvm-cd3eb9b09882087761c811d349c2b3be4e5c8a34.tar.bz2 llvm-cd3eb9b09882087761c811d349c2b3be4e5c8a34.tar.xz | |
Simplify some code. hasComputableLoopEvolution is overkill in this case.
No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64530 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
| -rw-r--r-- | lib/Transforms/Scalar/IndVarSimplify.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/lib/Transforms/Scalar/IndVarSimplify.cpp b/lib/Transforms/Scalar/IndVarSimplify.cpp index ccd25d8fb5..2385051678 100644 --- a/lib/Transforms/Scalar/IndVarSimplify.cpp +++ b/lib/Transforms/Scalar/IndVarSimplify.cpp @@ -551,15 +551,14 @@ bool IndVarSimplify::runOnLoop(Loop *L, LPPassManager &LPM) { PHINode *PN = cast<PHINode>(I); if (PN->getType()->isInteger()) { // FIXME: when we have fast-math, enable! SCEVHandle SCEV = SE->getSCEV(PN); - if (SCEV->hasComputableLoopEvolution(L)) - // FIXME: It is an extremely bad idea to indvar substitute anything more - // complex than affine induction variables. Doing so will put expensive - // polynomial evaluations inside of the loop, and the str reduction pass - // currently can only reduce affine polynomials. For now just disable - // indvar subst on anything more complex than an affine addrec. - if (SCEVAddRecExpr *AR = dyn_cast<SCEVAddRecExpr>(SCEV)) - if (AR->isAffine()) - IndVars.push_back(std::make_pair(PN, SCEV)); + // FIXME: It is an extremely bad idea to indvar substitute anything more + // complex than affine induction variables. Doing so will put expensive + // polynomial evaluations inside of the loop, and the str reduction pass + // currently can only reduce affine polynomials. For now just disable + // indvar subst on anything more complex than an affine addrec. + if (SCEVAddRecExpr *AR = dyn_cast<SCEVAddRecExpr>(SCEV)) + if (AR->getLoop() == L && AR->isAffine()) + IndVars.push_back(std::make_pair(PN, SCEV)); } } |
