[PATCH] D130618: [AArch64][LoopVectorize] Enable tail-folding by default for SVE

David Sherwood via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 27 02:28:32 PDT 2022


david-arm created this revision.
david-arm added reviewers: sdesmalen, paulwalker-arm, kmclaughlin, peterwaller-arm.
Herald added subscribers: shiva0217, ctetreau, CarolineConcatto, hiraditya, kristof.beyls, tschuett.
Herald added a project: All.
david-arm requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This patch enables tail-folding by default for all loop types when
the SVE feature is present. However, as a further optimisation if
the user specifies either the neoverse-v1, x2 or a64fx CPU we
limit tail-folding to only simple loops, i.e. those that do not
contain reductions or first-order recurrences.

At the same time I had to fix getScalarEpilogueLowering in
LoopVectorize.cpp to ignore the TTI hook behaviour if the flag

  -epilogue-vectorization-force-VF=X

is used, since that implies we *don't* want to use tail-folding.
Without this change these tests would fail:

  Transforms/LoopVectorize/AArch64/sve-epilog-vect-*

New tests have been added here:

  Transforms/LoopVectorize/AArch64/sve-tail-folding-option.ll


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D130618

Files:
  llvm/lib/Target/AArch64/AArch64Subtarget.cpp
  llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
  llvm/lib/Target/AArch64/Utils/AArch64BaseInfo.h
  llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
  llvm/test/Transforms/LoopVectorize/AArch64/sve-tail-folding-option.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130618.447963.patch
Type: text/x-patch
Size: 11131 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220727/ce2f3d6a/attachment.bin>


More information about the llvm-commits mailing list