[PATCH] D108262: [runtimeunroll] Support multiple exits to latch exit w/prolog loop

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 17 18:16:34 PDT 2021


reames created this revision.
reames added reviewers: nikic, fhahn, anna.
Herald added subscribers: zzheng, bollu, hiraditya, mcrosier.
reames requested review of this revision.
Herald added a project: LLVM.

This patch extends the runtime unrolling infrastructure to support unrolling a loop with multiple exiting blocks branching to the same exit block used by the latch. It intentionally does not include a cost model change to enable this functionality unless appropriate force flags are used.

This is the prolog companion to D107381 <https://reviews.llvm.org/D107381>. As it turned out, that change did cover all the prolog logic too, so this is just unblocking and updating tests.

As an aside, our prolog form leaves a lot of potential value on the floor when there is an invariant load or invariant condition in the loop being runtime unrolled.  We should probably consider a "required prolog" heuristic.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D108262

Files:
  llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp
  llvm/test/Transforms/LoopUnroll/runtime-loop-multiple-exits.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108262.367080.patch
Type: text/x-patch
Size: 62031 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210818/93dfba32/attachment-0001.bin>


More information about the llvm-commits mailing list