[PATCH] D81813: [ARM] MVE FP16 cost adjustments

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 14 14:56:29 PDT 2020


dmgreen created this revision.
dmgreen added reviewers: samparker, SjoerdMeijer, efriedma, simon_tatham, ostannard.
Herald added subscribers: danielkiss, hiraditya, kristof.beyls.
Herald added a project: LLVM.

This adjusts the MVE fp16 cost model, similar to how we already do for integer casts. In general it attempts to model fptrunc and fpext between half and float as 1 vcvt per lane, with some adjustments for places where we expect that the mve instructions can be used. If fp16 (or fp64) isn't present then we increase that to the cost of a libcall, which I've arbitrarily costed at 10.

It also includes some adjustments for larger integer extension costs near loads, tightenes up some Neon cast costs and makes getMemoryOpCost call the base getMemoryOpCost for default costs. That can have an effect on the cost of small illegal vector types like a <2 x ...>, increasing the cost as they will end up being scalarised. It also increases the default cost of a <4 x half> load/store as they will currently scalarise. This is hopefully something we can improve in the future, but models current codegen better.


https://reviews.llvm.org/D81813

Files:
  llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp
  llvm/test/Analysis/CostModel/ARM/cast.ll
  llvm/test/Analysis/CostModel/ARM/load_store.ll
  llvm/test/Transforms/LoopVectorize/ARM/prefer-tail-loop-folding.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D81813.270639.patch
Type: text/x-patch
Size: 175293 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200614/2301d609/attachment-0001.bin>


More information about the llvm-commits mailing list