[PATCH] D153547: [CostModel] Use min/max intrinsics for vecreduce.min/max costs

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 22 07:02:19 PDT 2023


dmgreen created this revision.
dmgreen added reviewers: RKSimon, anna, spatel, nikic.
Herald added subscribers: luke, foad, StephenFan, frasercrmck, kerbowa, luismarques, apazos, sameer.abuasal, pengfei, s.egerton, Jim, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, niosHD, sabuasal, simoncook, johnrusso, rbar, asb, hiraditya, arichardson, jvesely, arsenm.
Herald added a project: All.
dmgreen requested review of this revision.
Herald added subscribers: wangpc, MaskRay.
Herald added a project: LLVM.

This changes the costmodelling of the vecreduce.min/max nodes to use the costs of the relevant min/max intrinsics instead of expanding them to compare and selects. The getMinMaxReductionCost have changed to take a Opcode for the relevant intrinsic, dropping the IsUnsigned and CondTy parameters as they are no longer needed.

A follow up patch will add some basic fminimum/fmaximum costmodelling.


https://reviews.llvm.org/D153547

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/AArch64/AArch64TargetTransformInfo.cpp
  llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h
  llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
  llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.h
  llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
  llvm/lib/Target/RISCV/RISCVTargetTransformInfo.h
  llvm/lib/Target/X86/X86TargetTransformInfo.cpp
  llvm/lib/Target/X86/X86TargetTransformInfo.h
  llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
  llvm/test/Analysis/CostModel/AArch64/reduce-minmax.ll
  llvm/test/Analysis/CostModel/ARM/intrinsic-cost-kinds.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D153547.533573.patch
Type: text/x-patch
Size: 26901 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230622/b205afbf/attachment.bin>


More information about the llvm-commits mailing list