[PATCH] D131967: [RISCV] Correct costs for vector ceil/floor/trunc/round

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 16 07:37:15 PDT 2022


reames created this revision.
reames added reviewers: craig.topper, frasercrmck, kito-cheng.
Herald added subscribers: sunshaoce, VincentWu, luke957, StephenFan, vkmr, evandro, luismarques, apazos, sameer.abuasal, s.egerton, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, shiva0217, niosHD, sabuasal, bollu, simoncook, johnrusso, rbar, asb, hiraditya, arichardson, mcrosier.
Herald added a project: All.
reames requested review of this revision.
Herald added subscribers: pcwang-thead, eopXD, MaskRay.
Herald added a project: LLVM.

Add vector costs for ceil/floor/trunc/round.  As can be seen in the tests, the prior default costs were a significant under estimate of the actual code generated.

These costs are computed by simply generating code with the current backend, and then counting the number of instructions.  I discount one vsetvli, and ignore the return.

These costs were generated by some simple scripting.  Assuming we're happy with the code structure, I plan to add a bunch more intrinsics using the same approach (in individual reviews).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D131967

Files:
  llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
  llvm/test/Analysis/CostModel/RISCV/fround.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131967.453003.patch
Type: text/x-patch
Size: 24611 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220816/a12f9737/attachment.bin>


More information about the llvm-commits mailing list