[PATCH] D130868: [LV] Refactor getExtendedAddReductionCost to support other extended reduction more than Add.

Jianjian Guan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 31 23:24:10 PDT 2022


jacquesguan created this revision.
jacquesguan added reviewers: dmgreen, spatel, RKSimon, reames.
Herald added subscribers: luke957, luismarques, s.egerton, PkmX, simoncook, hiraditya, kristof.beyls, arichardson.
Herald added a project: All.
jacquesguan requested review of this revision.
Herald added subscribers: llvm-commits, pcwang-thead.
Herald added a project: LLVM.

Now the API getExtendedAddReductionCost is used to determine extended Add reduction with optional Mul. For Arm, it could cover the cases. But for other target, for example: RISCV, they support other kinds of extended recution, such as FAdd.

This patch does the following changes:
1, Split getExtendedAddReductionCost into 2 new API: getExtendedReductionCost which handles the extended reduction with addtional input of Opcode; getMulAccReductionCost which handle the MLA cases the getExtendedAddReductionCost.
2, Refactor getReductionPatternCost, add some contraint condition to make sure the getMulAccReductionCost should only handle the reuction of Add + Mul.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D130868

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/ARM/ARMTargetTransformInfo.cpp
  llvm/lib/Target/ARM/ARMTargetTransformInfo.h
  llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130868.448920.patch
Type: text/x-patch
Size: 17515 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220801/6f68d600/attachment.bin>


More information about the llvm-commits mailing list