[PATCH] D66005: [ARM] Add MVE beats vector cost model

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 9 04:50:49 PDT 2019


dmgreen created this revision.
dmgreen added reviewers: t.p.northover, samparker, simon_tatham, SjoerdMeijer, ostannard.
Herald added subscribers: hiraditya, kristof.beyls, javed.absar.
Herald added a project: LLVM.

The MVE architecture has the idea of "beats", where a vector instruction can be executed over several ticks of the architecture. This adds a similar system into the Arm backend cost model, multiplying the cost of all vector instructions by a factor.

This factor essentially becoming the expected difference between scalar code and vector code, on average. MVE Vector instructions can also overlap so the a true cost of them is often lower. Equally scalar instructions can in some situations be dual issued, or have other optimisations or more efficient instructions. The default is chosen as 2. This should not prevent vectorisation is a most cases (as the vector instructions will still be doing at least 4 times the work), but it will help prevent over vectorising in cases where the benefits are less likely.

This adds things so far to the obvious places in ARMTargetTransformInfo, and updates a few related costs like not treating float instructions as cost 2 just because they are floats.


https://reviews.llvm.org/D66005

Files:
  llvm/lib/Target/ARM/ARM.td
  llvm/lib/Target/ARM/ARMSubtarget.cpp
  llvm/lib/Target/ARM/ARMSubtarget.h
  llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp
  llvm/test/Analysis/CostModel/ARM/arith.ll
  llvm/test/Analysis/CostModel/ARM/cast.ll
  llvm/test/Analysis/CostModel/ARM/divrem.ll
  llvm/test/Analysis/CostModel/ARM/fparith.ll
  llvm/test/Analysis/CostModel/ARM/load_store.ll
  llvm/test/Analysis/CostModel/ARM/select.ll
  llvm/test/Analysis/CostModel/ARM/shuffle.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66005.214339.patch
Type: text/x-patch
Size: 228764 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190809/f08a9856/attachment-0001.bin>


More information about the llvm-commits mailing list