[PATCH] D87344: [IndVars] Remove exiting conditions that are trivially true/false

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 28 09:50:55 PDT 2020


reames accepted this revision.
reames added a comment.

LGTM.  Nice restructure.

An idea for another way to approach this would be to add ability to SCEV to prove an exit is infinite directly.  That might be useful in other places.  We could consider either a new function isExitCountInfinite or a new SCEVInfinite node.

Just to be clear, this is now brainstorming, not a review comment in the sense that I expect you to act on it.  :)



================
Comment at: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:2438
+      // will remain the same within iteration space?
+      if (isTrivialCond(L, cast<BranchInst>(ExitingBB->getTerminator()), SE,
+                        false)) {
----------------
Minor, pull out the cast into a variable please.


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

https://reviews.llvm.org/D87344



More information about the llvm-commits mailing list