[PATCH] D105432: [Analysis] Add simple cost model for strict (in-order) reductions

David Sherwood via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 5 06:17:22 PDT 2021


david-arm created this revision.
david-arm added reviewers: sdesmalen, kmclaughlin, CarolineConcatto, dmgreen, spatel.
Herald added subscribers: hiraditya, kristof.beyls.
david-arm requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

I have added a new TTI interface called getArithmeticStrictReductionCost
that tries to estimate the cost of performing a strict reduction by
treating the operation as a series of scalar operations on each lane
of the vector. For scalable vectors this is more difficult because at
compile time we do not know how many lanes there are, and so we use
the worst case maximum vscale value.

Tests have been added here:

  llvm/test/Analysis/CostModel/AArch64/strict-fadd.ll
  llvm/test/Analysis/CostModel/AArch64/sve-strict-fadd.ll


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D105432

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/Transforms/Vectorize/LoopVectorize.cpp
  llvm/test/Analysis/CostModel/AArch64/strict-fadd.ll
  llvm/test/Analysis/CostModel/AArch64/sve-strict-fadd.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105432.356491.patch
Type: text/x-patch
Size: 13799 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210705/4195c5d8/attachment.bin>


More information about the llvm-commits mailing list