]> granicus.if.org Git - llvm/commit
[ARM] Add MVE beats vector cost model
authorDavid Green <david.green@arm.com>
Tue, 13 Aug 2019 18:12:08 +0000 (18:12 +0000)
committerDavid Green <david.green@arm.com>
Tue, 13 Aug 2019 18:12:08 +0000 (18:12 +0000)
commite752d0808444b8e419b56fc4232418eb07a022f5
tree0b922cc6cc5dfa213cd7c5f4759da4885855cdb9
parent027b0999dbfcf75771358db219fd3fcefbe83bc0
[ARM] Add MVE beats vector cost model

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 becomes 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. But equally scalar instructions can in some
situations be dual issued, or have other optimisations such as unrolling or
make use of dsp 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.

Differential Revision: https://reviews.llvm.org/D66005

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368733 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/ARM/ARM.td
lib/Target/ARM/ARMSubtarget.cpp
lib/Target/ARM/ARMSubtarget.h
lib/Target/ARM/ARMTargetTransformInfo.cpp
test/Analysis/CostModel/ARM/arith.ll
test/Analysis/CostModel/ARM/cast.ll
test/Analysis/CostModel/ARM/divrem.ll
test/Analysis/CostModel/ARM/fparith.ll
test/Analysis/CostModel/ARM/load_store.ll
test/Analysis/CostModel/ARM/select.ll
test/Analysis/CostModel/ARM/shuffle.ll