[PATCH] D125754: [LoopUnroll] Avoid branch on poison for runtime unroll with multiple exits

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 17 08:15:46 PDT 2022


reames added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp:755
   BasicBlock *UnrollingLoop = UseEpilogRemainder ? NewPreHeader : PrologExit;
+  // Freeze the condition if there are other exits before the latch that may
+  // cause the latch exit branch to never be executed.
----------------
Its not clear to me that you need this.  The condition being branched on should always be derived from the SCEV computed trip count.  After D124910, shouldn't we be assured that is non-poisonous?  Or at least, only poisonous if the first input is poison?  

Your code here is completely reasonable, except that I don't quite understand the case in which is matters.  :)


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

https://reviews.llvm.org/D125754



More information about the llvm-commits mailing list