[PATCH] D108910: [IndVars] Break backedge and replace PHIs if loop exits on 1st iteration

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 2 03:19:19 PDT 2021


mkazantsev added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1327
+      if (Instruction *UserInst = dyn_cast<Instruction>(User)) {
+        if (Value *V = SimplifyInstruction(UserInst, SQ)) {
+          UserInst->replaceAllUsesWith(V);
----------------
Not sure about this. Potentially expensive compile time wise, and not clear what consequences changing the content of other loops has. Might be reasonable for enabling more other transforms, though.

Let's split it off and think through.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D108910



More information about the llvm-commits mailing list