[PATCH] D150398: [VPlan] Model branch cond to enter scalar epilogue in VPlan.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 19 07:49:59 PDT 2023


fhahn updated this revision to Diff 551753.
fhahn marked 13 inline comments as done.
fhahn added a comment.
Herald added subscribers: wangpc, dmgreen.

Address latest comments, thanks!

I reworked the patch to use a BranchOnCond VPInstruction to handle the branch in MiddleVPBB and undid the changes to live-outs. At the moment, this requires updating the branch recipe's operands after the skeleton (and the exit and scalar preheader blocks) have been created. There's FIXMEs to model creation of those blocks in VPlan directly as well.

This should compose nicely with tail-folding as VPlan-to-VPlan transform (D157713 <https://reviews.llvm.org/D157713>); once the transformation has been applied, the conditional branch can be replaced by an unconditional one.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D150398/new/

https://reviews.llvm.org/D150398

Files:
  llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
  llvm/lib/Transforms/Vectorize/VPlan.cpp
  llvm/lib/Transforms/Vectorize/VPlan.h
  llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
  llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
  llvm/test/Transforms/LoopVectorize/AArch64/fixed-order-recurrence.ll
  llvm/test/Transforms/LoopVectorize/AArch64/interleaving-reduction.ll
  llvm/test/Transforms/LoopVectorize/AArch64/loop-vectorization-factors.ll
  llvm/test/Transforms/LoopVectorize/AArch64/scalable-reduction-inloop-cond.ll
  llvm/test/Transforms/LoopVectorize/AArch64/scalable-strict-fadd.ll
  llvm/test/Transforms/LoopVectorize/AArch64/streaming-compatible-sve-no-maximize-bandwidth.ll
  llvm/test/Transforms/LoopVectorize/AArch64/sve-epilog-vect-inloop-reductions.ll
  llvm/test/Transforms/LoopVectorize/AArch64/sve-epilog-vect-reductions.ll
  llvm/test/Transforms/LoopVectorize/AArch64/sve-epilog-vect-strict-reductions.ll
  llvm/test/Transforms/LoopVectorize/AArch64/sve-interleaved-accesses.ll
  llvm/test/Transforms/LoopVectorize/AArch64/widen-call-with-intrinsic-or-libfunc.ll
  llvm/test/Transforms/LoopVectorize/ARM/mve-reduction-predselect.ll
  llvm/test/Transforms/LoopVectorize/ARM/mve-reduction-types.ll
  llvm/test/Transforms/LoopVectorize/ARM/sphinx.ll
  llvm/test/Transforms/LoopVectorize/ARM/tail-folding-not-allowed.ll
  llvm/test/Transforms/LoopVectorize/X86/cost-model.ll
  llvm/test/Transforms/LoopVectorize/X86/fixed-order-recurrence.ll
  llvm/test/Transforms/LoopVectorize/X86/imprecise-through-phis.ll
  llvm/test/Transforms/LoopVectorize/X86/invariant-store-vectorization.ll
  llvm/test/Transforms/LoopVectorize/X86/load-deref-pred.ll
  llvm/test/Transforms/LoopVectorize/X86/reduction-fastmath.ll
  llvm/test/Transforms/LoopVectorize/X86/strided_load_cost.ll
  llvm/test/Transforms/LoopVectorize/X86/uniform_mem_op.ll
  llvm/test/Transforms/LoopVectorize/X86/x86-predication.ll
  llvm/test/Transforms/LoopVectorize/epilog-vectorization-reductions.ll
  llvm/test/Transforms/LoopVectorize/first-order-recurrence-chains-vplan.ll
  llvm/test/Transforms/LoopVectorize/first-order-recurrence-complex.ll
  llvm/test/Transforms/LoopVectorize/first-order-recurrence-multiply-recurrences.ll
  llvm/test/Transforms/LoopVectorize/first-order-recurrence.ll
  llvm/test/Transforms/LoopVectorize/float-minmax-instruction-flag.ll
  llvm/test/Transforms/LoopVectorize/if-pred-non-void.ll
  llvm/test/Transforms/LoopVectorize/if-pred-stores.ll
  llvm/test/Transforms/LoopVectorize/induction.ll
  llvm/test/Transforms/LoopVectorize/interleave-and-scalarize-only.ll
  llvm/test/Transforms/LoopVectorize/interleaved-accesses.ll
  llvm/test/Transforms/LoopVectorize/load-deref-pred-align.ll
  llvm/test/Transforms/LoopVectorize/pr55167-fold-tail-live-out.ll
  llvm/test/Transforms/LoopVectorize/pr59319-loop-access-info-invalidation.ll
  llvm/test/Transforms/LoopVectorize/reduction-small-size.ll
  llvm/test/Transforms/LoopVectorize/select-reduction-start-value-may-be-undef-or-poison.ll
  llvm/test/Transforms/LoopVectorize/vplan-iv-transforms.ll
  llvm/test/Transforms/LoopVectorize/vplan-printing.ll
  llvm/test/Transforms/LoopVectorize/vplan-sink-scalars-and-merge-vf1.ll
  llvm/test/Transforms/LoopVectorize/vplan-sink-scalars-and-merge.ll
  llvm/unittests/Transforms/Vectorize/VPlanTestBase.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D150398.551753.patch
Type: text/x-patch
Size: 231724 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230819/c5f33c1f/attachment-0001.bin>


More information about the llvm-commits mailing list