[PATCH] D144375: [SystemZ, SLP] Enable FP horizontal reductions and fix SLP cost computation.

Jonas Paulsson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 23 10:46:41 PST 2023


jonpa updated this revision to Diff 499915.
jonpa added a comment.

> Better to calculate scalarization overhead for the loadinst elements and subtract from the gather cost.
>
> Or better to include this check to the getGatherCost function

Thanks for review. Good suggestion to add back the scalarization overhead as it was originally added (instead of just '1'). This made me realize that on SystemZ there is an even further complication here, namely that for i64 vectors, two GPRs can be inserted with a single instruction.

I have experimented further with this and found a solution where the getGatherCost() function is lifted into TTI instead of being SLP specific. That way there can be a default implementation per our previous discussions and also a SystemZ specific handling of the i64 vector costs. Does this seem reasonable?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D144375/new/

https://reviews.llvm.org/D144375

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/SystemZ/SystemZTargetTransformInfo.cpp
  llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.h
  llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
  llvm/test/Analysis/CostModel/SystemZ/vector-reductions-fp.ll
  llvm/test/Transforms/SLPVectorizer/SystemZ/reductions-fadd.ll
  llvm/test/Transforms/SLPVectorizer/SystemZ/reductions-fmin-fmax.ll
  llvm/test/Transforms/SLPVectorizer/SystemZ/reductions-fmul.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D144375.499915.patch
Type: text/x-patch
Size: 163077 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230223/2bfd2698/attachment-0001.bin>


More information about the llvm-commits mailing list