[PATCH] D146128: [SVE][LoopVectorize] Add option to disable tail-folding for reverse loops

David Sherwood via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 15 04:45:10 PDT 2023


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

If we use tail-folding for reverse loops that contain loads
and stores then we will need to reverse the loop predicate.
This patch adds a new 'reverse' sve-tail-folding option and
ensures they are not considered 'simple'.

Adding this logic required changing the preferPredicateOverEpilogue
TTI interface to pass in a new boolean - NeedsReversePred.
We use a new LoopVectorizationLegality function to determine
whether or not we need a reversed predicate.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D146128

Files:
  llvm/include/llvm/Analysis/TargetTransformInfo.h
  llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
  llvm/include/llvm/CodeGen/BasicTTIImpl.h
  llvm/include/llvm/Transforms/Vectorize/LoopVectorizationLegality.h
  llvm/lib/Analysis/TargetTransformInfo.cpp
  llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
  llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h
  llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp
  llvm/lib/Target/ARM/ARMTargetTransformInfo.h
  llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp
  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: D146128.505441.patch
Type: text/x-patch
Size: 20009 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230315/7e1b53f0/attachment.bin>


More information about the llvm-commits mailing list