[PATCH] D116496: [unroll] Prune all but first copy of invariant exit

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 3 17:28:43 PST 2022


reames added a comment.

Pretty sure I know the cause of the issue, though I haven't yet managed to reproduce it.

If we runtime unroll a loop with a invariant condition as the latch exit condition, this patch combined with the existing code will cause all copies of the latch in the main loop to be folded to untaken.  This is correct - the main loop is dynamically dead whether we use prolog or epilogue - but can result in exits becoming unreachable when unrolling the main loop.  (And thus loop info being in potentially bad state.)

I have not yet been able to actually get the runtime unroll code to unroll such a loop.  I'll try a bit further tomorrow, but if I can't come up with a reproducer, I plan to recommit with a bailout for runtime unrolling and see if any other failures come up.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D116496



More information about the llvm-commits mailing list