[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:31:16 PST 2021


david-arm added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:7070
 
-  return TTI.getAddressComputationCost(VectorTy) +
-         TTI.getGatherScatterOpCost(
----------------
lebedev.ri wrote:
> I don't know what `getAddressComputationCost()` is supposed to do, or whether or not (or rather, when)
> it should be queried, but i just want to point out that within LV it seems to be consistently queried
> currently, but perhaps not so much in other passes.
> 
Yeah you're right it is consistently used elsewhere. I wasn't sure if this was entirely the best approach, but wanted to put a patch up for discussion anyway. I think the alternative is to start properly splitting out the cost of setting up indices from getGatherScatterCost and move into getAddressComputationCost perhaps? It seems like getAddressComputationCost could also be made more aware of strided costs for gathers/scatters, but currently looks like it was written to assume scalarisation. I think we'd want to pass in some extra information (besides the SCEV) to indicate this is used for a gather/scatter.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D114951



More information about the llvm-commits mailing list