[PATCH] D146033: [AArch64][TTI] Cost model FADD/FSUB. WIP.

Sjoerd Meijer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 14 04:51:37 PDT 2023


SjoerdMeijer created this revision.
SjoerdMeijer added reviewers: dmgreen, fhahn, efriedma, paulwalker-arm.
Herald added subscribers: StephenFan, hiraditya, kristof.beyls.
Herald added a project: All.
SjoerdMeijer requested review of this revision.
Herald added a project: LLVM.

This is a work-in-progress (WIP) patch to lower the cost for FADD and FSUB.

The motivation is to avoid over-eager SLP vectorisation, that makes it look like SLP vectorisation is profitable but results in significant slow downs. Lowering the cost for scalar FADD and FSUB costs helps the profitability decision to favour the scalar version where vectorisation isn't beneficial.  Preliminary performance results show a 7% improvement for Imagick from SPEC FP 2017, a small improvement in Blender, and unchanged results for the other apps.

Just for a bit more context, this is related to over-eager vectorisation in https://github.com/llvm/llvm-project/issues/61047 but the motivating test case is slightly different.

This is work in progress because I am in the process to check performance results for more FP workloads. Also, I haven't fixed up a couple of regression tests. There are not many, but one is interesting. Test `Transforms/SLPVectorizer/AArch64/matmul.ll` checks vectorisation for the Cortex-A53, where things are a bit different. So probably we want to lower the cost of FADD/FSUB only for modern Neoverse cores where these instructions are as cheap as for example the integer adds/subs.

I am uploading this work in progress patch to get early feedback if you see any problems with lowering theses costs.


https://reviews.llvm.org/D146033

Files:
  llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
  llvm/test/Analysis/CostModel/AArch64/arith-fp.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146033.505026.patch
Type: text/x-patch
Size: 9471 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230314/6989a7fc/attachment.bin>


More information about the llvm-commits mailing list