[PATCH] D126382: [GVN] Enable enable-split-backedge-in-load-pre option by default

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 25 07:55:53 PDT 2022


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

This option was added in D89854 <https://reviews.llvm.org/D89854>. It prevents GVN from performing load PRE in a loop if doing so would require critical edge splitting on the backedge. From the review:

> I know that GVN Load PRE negatively impacts peeling, loop predication, so the passes expecting that latch has a conditional branch.

In the PhaseOrdering test in this patch, splitting the backedge negatively affects vectorization: After critical edge splitting, the loop gets rotated, effectively peeling off the first loop iteration. The effect is that the first element is handled separately, then the bulk of the elements use a vectorized reduction (but using unaligned, off-by-one memory accesses) and then a tail of 15 elements is handled separately again.

It's probably worth noting that the loop load PRE from D99926 <https://reviews.llvm.org/D99926> is not affected by this change (as it does not need backedge splitting). This is about normal load PRE that happens to occur inside a loop.


https://reviews.llvm.org/D126382

Files:
  llvm/lib/Transforms/Scalar/GVN.cpp
  llvm/test/Transforms/GVN/PRE/load-pre-metadata-accsess-group.ll
  llvm/test/Transforms/GVN/PRE/pre-loop-load-through-select.ll
  llvm/test/Transforms/GVN/PRE/rle.ll
  llvm/test/Transforms/GVN/PRE/volatile.ll
  llvm/test/Transforms/GVN/condprop-memdep-invalidation.ll
  llvm/test/Transforms/PhaseOrdering/X86/vector-reduction-known-first-value.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D126382.431991.patch
Type: text/x-patch
Size: 12846 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220525/1bccbaa6/attachment.bin>


More information about the llvm-commits mailing list