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

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 17 02:32:08 PDT 2022


nikic created this revision.
nikic added reviewers: fhahn, nlopes, reames.
Herald added subscribers: zzheng, hiraditya.
Herald added a project: All.
nikic requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

When performing runtime unrolling with multiple exits, one of the earlier (non-latch) exits may exit the loop on the first iteration, such that we never branch on the latch exit condition. As such, we need to freeze the condition of the new branch that is introduced before the loop, as it now executed unconditionally.


https://reviews.llvm.org/D125754

Files:
  llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp
  llvm/test/Transforms/LoopUnroll/runtime-loop-at-most-two-exits.ll
  llvm/test/Transforms/LoopUnroll/runtime-loop-multiexit-dom-verify.ll
  llvm/test/Transforms/LoopUnroll/runtime-loop-multiple-exits.ll
  llvm/test/Transforms/LoopUnroll/runtime-multiexit-heuristic.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D125754.429974.patch
Type: text/x-patch
Size: 170010 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220517/7cc9fc89/attachment-0001.bin>


More information about the llvm-commits mailing list