[PATCH] D88527: [IndVars] Replace checks with invariants if we cannot remove them

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 11 21:22:50 PST 2020


mkazantsev added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:2359
     return CanBeRemoved;
-  return CannotOptimize;
+  return CanBeReplacedWithInvariant;
 }
----------------
skatkov wrote:
> anna wrote:
> > I maybe missing something. Where are we checking the "never fails in any iteration other than the first" ? 
> SE->isLoopInvariantExitCondDuringFirstIterations ?
Yes, inside of `isLoopInvariantExitCondDuringFirstIterations` we effectively check that comparison against IV may be replaced with comparison against start.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88527/new/

https://reviews.llvm.org/D88527



More information about the llvm-commits mailing list