[PATCH] D114951: [Analysis][AArch64] Add on the address computational cost for gathers/scatters

David Sherwood via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 2 06:06:09 PST 2021


david-arm created this revision.
david-arm added reviewers: sdesmalen, kmclaughlin, greened, lebedev.ri, peterwaller-arm.
Herald added subscribers: hiraditya, kristof.beyls.
david-arm requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

In AArch64TTIImpl::getGatherScatterOpCost I have increased the gather/scatter
cost by 1 x element count. This is to take into account the likely address
computational cost for setting up the indices. At the same time, I discovered
the call to getAddressComputationCost in
LoopVectorizationCostModel::getGatherScatterCost is redundant for all targets
except AArch64 - removing it makes no difference to the non-AArch64 costs. It
looks like getAddressComputationCost is mostly useful for contiguous loads or
when scalarising, and getGatherScatterCost is better placed to calculate the
cost of setting up the indices.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D114951

Files:
  llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
  llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
  llvm/test/Analysis/CostModel/AArch64/mem-op-cost-model.ll
  llvm/test/Analysis/CostModel/AArch64/sve-gather.ll
  llvm/test/Analysis/CostModel/AArch64/sve-scatter.ll
  llvm/test/Transforms/LoopVectorize/AArch64/sve-gather-scatter-cost.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D114951.391298.patch
Type: text/x-patch
Size: 59352 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211202/168b1d5d/attachment.bin>


More information about the llvm-commits mailing list