[PATCH] D75525: [TTI][ARM][MVE] Refine gather/scatter cost model

Anna Welker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 3 07:32:21 PST 2020


anwel created this revision.
anwel added reviewers: dmgreen, SjoerdMeijer, samparker, efriedma, craig.topper, RKSimon, spatel.
anwel added a project: LLVM.
Herald added subscribers: llvm-commits, kerbowa, jsji, kbarton, hiraditya, kristof.beyls, nhaehnle, jvesely, nemanjai, arsenm.

This patch refines the gather/scatter cost model, but also changes the TTI function `getIntrinsicInstrCost` to as an additional parameter accept the instruction that is evaluated, which is needed for the gather/scatter cost evaluation.
The latter did require trivial changes in some non-ARM backends to adopt the new parameter.

Gathers can be extending, so if their result is sext or zext extended, the extend can be integrated. This ensures that in these cases the cost model looks at the type after extension and calculates the cost accordingly.
Similarly, a trunc of a value can be integrated into the scatter that stores it.


https://reviews.llvm.org/D75525

Files:
  llvm/include/llvm/Analysis/TargetTransformInfo.h
  llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
  llvm/include/llvm/CodeGen/BasicTTIImpl.h
  llvm/lib/Analysis/TargetTransformInfo.cpp
  llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
  llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.h
  llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp
  llvm/lib/Target/ARM/ARMTargetTransformInfo.h
  llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.cpp
  llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.h
  llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp
  llvm/lib/Target/PowerPC/PPCTargetTransformInfo.h
  llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp
  llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.h
  llvm/lib/Target/X86/X86TargetTransformInfo.cpp
  llvm/lib/Target/X86/X86TargetTransformInfo.h
  llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
  llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
  llvm/test/Analysis/CostModel/ARM/mve-gather-scatter-cost.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75525.247885.patch
Type: text/x-patch
Size: 55676 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200303/4efcaf8d/attachment.bin>


More information about the llvm-commits mailing list