[PATCH] D125896: [LoopUnroll] Freeze tripcount rather than condition

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 18 08:42:34 PDT 2022


nikic created this revision.
nikic added reviewers: reames, fhahn, nlopes.
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.

This is a followup to D125754 <https://reviews.llvm.org/D125754>. We introduce two branches, one before the unrolled loop and one before the epilogue (and similar for the prologue case). The previous patch only froze the condition on the first branch.

Rather than independently freezing the second condition, this patch instead freezes TripCount and bases BECount on it. These are the two quantities involved in the conditions, and this ensures that both work on a consistent, non-poisonous trip count.


https://reviews.llvm.org/D125896

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: D125896.430393.patch
Type: text/x-patch
Size: 97278 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220518/1a13da1f/attachment.bin>


More information about the llvm-commits mailing list