[PATCH] D109067: [SVE] Make the costs for gathers/scatters/ordered reductions less pessimistic

David Sherwood via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 1 08:32:20 PDT 2021


david-arm created this revision.
david-arm added reviewers: sdesmalen, kmclaughlin, dmgreen, peterwaller-arm.
Herald added subscribers: psnobl, hiraditya, kristof.beyls, tschuett.
Herald added a reviewer: efriedma.
david-arm requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

The cost model for gathers, scatters and ordered reductions is based on
a pessimistic algorithm that involves scalarising the operations. We use
the architectural maximum value of vscale to determine the worst case
number of elements. However, in practice the maximum vector length in
available hardware is currently 512 bits so I've modified

  AArch64TargetTransform::getMaxNumElements

to allow callers to set the worst case vscale value to something more
pragmatic.

In the long term we want to come up with a more realistic cost model to
reflect the fact the operations are unlikely to be completely scalarised.
However, for now this minor tweak will permit many more loops to be
vectorised using scalable vectors.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D109067

Files:
  llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
  llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h
  llvm/test/Analysis/CostModel/AArch64/sve-intrinsics.ll
  llvm/test/Transforms/LoopVectorize/AArch64/sve-strict-fadd-cost.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D109067.369939.patch
Type: text/x-patch
Size: 13208 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210901/3cdaf887/attachment.bin>


More information about the llvm-commits mailing list