diff options
author | Andrew Trick <atrick@apple.com> | 2011-06-27 23:17:44 +0000 |
---|---|---|
committer | Andrew Trick <atrick@apple.com> | 2011-06-27 23:17:44 +0000 |
commit | 163b4a70fbaf3de9333bf3efd520845a53f3ccb8 (patch) | |
tree | d0e4ae3514bee225cc93d4f547c0ae7863b5d54b /llvm/lib/Transforms | |
parent | b8c604abfd883189992423e06f60c3093bbffba7 (diff) | |
download | bcm5719-llvm-163b4a70fbaf3de9333bf3efd520845a53f3ccb8.tar.gz bcm5719-llvm-163b4a70fbaf3de9333bf3efd520845a53f3ccb8.zip |
indvars -disable-iv-rewrite: run RLEV after SimplifyIVUsers for
a bit more control over the order SCEVs are evaluated.
llvm-svn: 133959
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Scalar/IndVarSimplify.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp index 1d793394728..1a87b15e7fc 100644 --- a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp +++ b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp @@ -1158,8 +1158,12 @@ bool IndVarSimplify::runOnLoop(Loop *L, LPPassManager &LPM) { // Create a rewriter object which we'll use to transform the code with. SCEVExpander Rewriter(*SE); - if (DisableIVRewrite) + + // Eliminate redundant IV users. + if (DisableIVRewrite) { Rewriter.disableCanonicalMode(); + SimplifyIVUsersNoRewrite(L, Rewriter); + } // Check to see if this loop has a computable loop-invariant execution count. // If so, this means that we can compute the final value of any expressions @@ -1171,9 +1175,7 @@ bool IndVarSimplify::runOnLoop(Loop *L, LPPassManager &LPM) { RewriteLoopExitValues(L, Rewriter); // Eliminate redundant IV users. - if (DisableIVRewrite) - SimplifyIVUsersNoRewrite(L, Rewriter); - else + if (!DisableIVRewrite) SimplifyIVUsers(Rewriter); // Compute the type of the largest recurrence expression, and decide whether |