[PATCH] D105484: [TTI] Remove IsPairwiseForm from getArithmeticReductionCost

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 6 07:56:22 PDT 2021


dmgreen created this revision.
dmgreen added reviewers: spatel, RKSimon, david-arm, sdesmalen, kmclaughlin, CarolineConcatto, ABataev.
Herald added subscribers: foad, kerbowa, pengfei, hiraditya, nhaehnle, jvesely, arsenm.
dmgreen requested review of this revision.
Herald added a project: LLVM.

This patch removes the IsPairwiseForm flag from the Reduction Cost TTI hooks, along with some accompanying code for pattern matching reductions from trees starting at extract elements. IsPairWise is now assumed to be false, which was the predominant way that the value was used from both the Loop and SLP vectorizer. Since the adjustments such as D93860 <https://reviews.llvm.org/D93860>, the SLP vectorizer has not relied upon this distinction between paiwise and non-pairwise reductions, as far as I understand. (But another confirmation of that from someone more knowledgeable about the SLP vectorizer would be appreciated. None of the tests change at least).

This also removes some code that was detecting reductions trees starting from extract elements inside the costmodel. This case was double-counting costs though, adding the individual costs on the individual instruction _and_ the total cost of the reduction. Removing it changes the costs in llvm/test/Analysis/CostModel/X86/reduction.ll to not double count. The cost of reduction intrinsics is still tested through the various tests in llvm/test/Analysis/CostModel/X86/reduce-xyz.ll.


https://reviews.llvm.org/D105484

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/ARM/ARMTargetTransformInfo.cpp
  llvm/lib/Target/ARM/ARMTargetTransformInfo.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/X86/reduction.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105484.356724.patch
Type: text/x-patch
Size: 134940 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210706/f27acd15/attachment-0001.bin>


More information about the llvm-commits mailing list