[PATCH] D139832: [IndVars] Support AND in optimizeLoopExitWithUnknownExitCount

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 12 05:46:14 PST 2022


nikic added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1465
+  Value *NewCond = Builder.CreateAnd(Conditions);
+  replaceExitCond(BI, NewCond, DeadInsts);
   return true;
----------------
Why do we have to reconstruct the whole and chain? Can't we replace a single condition only? This looks quite fragile, especially as we probably want to generalize this to logical and as well, and at that point we'd have to replicate different types of ands in the correct position.


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

https://reviews.llvm.org/D139832



More information about the llvm-commits mailing list