[PATCH] D150873: [LoopVectorize] Consider interleaving when deciding if epilogue vectorisation is beneficial

Kerry McLaughlin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 18 08:12:17 PDT 2023


kmclaughlin created this revision.
kmclaughlin added reviewers: sdesmalen, david-arm, dmgreen, paulwalker-arm, reames.
Herald added subscribers: shiva0217, ctetreau, hiraditya.
Herald added a project: All.
kmclaughlin requested review of this revision.
Herald added subscribers: llvm-commits, pcwang-thead.
Herald added a project: LLVM.

Changes isEpilogueVectorizationProfitable to multiply the VF of the original loop with the
interleave count and compare this to EpilogueVectorizationMinVF.

When interleaving we reduce the likelihood of doing any vector work by increasing the
minimum trip count required to enter the loop, in the same way as choosing a high VF.
This change allows epilogues to be considered for loops with interleaving more equally,
for example VF=8, IC=2 will be considered in the same way that VF=16, IC=1 will.

I ran SPEC2017 on neoverse-v1 with this change and saw no overall difference in the geometric
mean, and no differences in the performance of individual benchmarks outside of noise.
This change however results in about a 6% performance improvement for x264 on publicly
available SVE2 hardware.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D150873

Files:
  llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
  llvm/test/Transforms/LoopVectorize/AArch64/interleaving-reduction.ll
  llvm/test/Transforms/LoopVectorize/AArch64/sve-gather-scatter.ll
  llvm/test/Transforms/LoopVectorize/X86/cost-model.ll
  llvm/test/Transforms/LoopVectorize/X86/float-induction-x86.ll
  llvm/test/Transforms/LoopVectorize/X86/interleaving.ll
  llvm/test/Transforms/LoopVectorize/X86/masked_load_store.ll
  llvm/test/Transforms/LoopVectorize/X86/pr23997.ll
  llvm/test/Transforms/LoopVectorize/X86/pr47437.ll
  llvm/test/Transforms/PhaseOrdering/X86/vdiv.ll
  llvm/test/Transforms/PhaseOrdering/X86/vector-reduction-known-first-value.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D150873.523386.patch
Type: text/x-patch
Size: 221543 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230518/29528e20/attachment-0001.bin>


More information about the llvm-commits mailing list