[PATCH] D133019: [VPlan] Only generate single instr for loads uniform across all parts.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 31 07:08:20 PDT 2022


fhahn created this revision.
fhahn added reviewers: Ayal, gilr, david-arm, reames.
Herald added subscribers: tschuett, frasercrmck, luismarques, apazos, sameer.abuasal, s.egerton, Jim, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, javed.absar, zzheng, jrtc27, niosHD, sabuasal, simoncook, johnrusso, bollu, rbar, asb, hiraditya.
Herald added a project: All.
fhahn requested review of this revision.
Herald added subscribers: pcwang-thead, vkmr, MaskRay.
Herald added a project: LLVM.

VPReplicateRecipe::isUniform actually means uniform-per-parts, hence a
scalar instruction is generated per-part.

This is a potential alternative D132892 <https://reviews.llvm.org/D132892>. For now the current patch only
catches cases where the address is trivially invariant (defined outside
VPlan), while D132892 <https://reviews.llvm.org/D132892> catches any address that is considered invariant
by SCEV AFAICT.

It should be possible to hoist fully invariant recipes feeding loads out
of the vector loop region as well, but in practice LICM should do that
already.

This version of the patch artificially limits this to loads to make it
easier to compare, but this restriction should be easily liftable.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D133019

Files:
  llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
  llvm/test/Transforms/LoopVectorize/RISCV/uniform-load-store.ll
  llvm/test/Transforms/LoopVectorize/X86/cost-model-assert.ll
  llvm/test/Transforms/LoopVectorize/X86/uniform_mem_op.ll
  llvm/test/Transforms/LoopVectorize/induction.ll
  llvm/test/Transforms/LoopVectorize/pointer-select-runtime-checks.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D133019.456952.patch
Type: text/x-patch
Size: 47391 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220831/223a4011/attachment.bin>


More information about the llvm-commits mailing list