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 | 156d460c758463eb407590cba2371857daf27d8a (patch) | |
tree | ebc219320509ceb897a738ddafd913338262414f /lib/Transforms/Scalar/IndVarSimplify.cpp | |
parent | 26f448079f2dc070da637e346a0635ad3127df7d (diff) | |
download | llvm-156d460c758463eb407590cba2371857daf27d8a.tar.gz llvm-156d460c758463eb407590cba2371857daf27d8a.tar.bz2 llvm-156d460c758463eb407590cba2371857daf27d8a.tar.xz |
indvars -disable-iv-rewrite: run RLEV after SimplifyIVUsers for
a bit more control over the order SCEVs are evaluated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133959 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/IndVarSimplify.cpp')
-rw-r--r-- | lib/Transforms/Scalar/IndVarSimplify.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Transforms/Scalar/IndVarSimplify.cpp b/lib/Transforms/Scalar/IndVarSimplify.cpp index 1d79339472..1a87b15e7f 100644 --- a/lib/Transforms/Scalar/IndVarSimplify.cpp +++ b/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 |