[PATCH] D81053: [LoopUnroll] Allow loops with multiple exiting blocks where loop latch is not necessary one of them.

Whitney Tsang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 2 21:52:58 PDT 2020


Whitney created this revision.
Whitney added reviewers: dmgreen, Meinersbur, etiotto, fhahn, efriedma, bmahjour.
Whitney added a project: LLVM.
Herald added subscribers: llvm-commits, zzheng, hiraditya.

Currently LoopUnrollPass already allow loops with multiple exiting blocks, but it is only allowed when the loop latch is one of the exiting blocks.
When the loop latch is not an exiting block, then only single exiting block is supported.
When possible, the single loop latch or the single exiting block terminator is optimized to an unconditional branch in the unrolled loop.

This patch allows loops with multiple exiting blocks even if the loop latch is not one of them. However, the optimization of exiting block terminator to unconditional branch is not done when there exists more than one exiting block.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D81053

Files:
  llvm/lib/Transforms/Utils/LoopUnroll.cpp
  llvm/test/Transforms/LoopUnroll/nonlatchcondbr.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D81053.268051.patch
Type: text/x-patch
Size: 10434 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200603/20275989/attachment-0001.bin>


More information about the llvm-commits mailing list