[AArch64] Break up larger shuffle-masks into legal sizes in getShuffleCost
authorDavid Green <david.green@arm.com>
Wed, 27 Apr 2022 12:51:50 +0000 (13:51 +0100)
committerDavid Green <david.green@arm.com>
Wed, 27 Apr 2022 12:51:50 +0000 (13:51 +0100)
commit8e2a0e61f53887c98219cf8e8057f53bf507cd9b
treedf03960a290bd03f45d25436d76170414cb576b9
parentd42f222f9d6f01afe99d0d597c98b36eb205c5ec
[AArch64] Break up larger shuffle-masks into legal sizes in getShuffleCost

Given a larger-than-legal shuffle mask, the final codegen will split
into multiple sub-vectors. This attempts to model that in
AArch64TTIImpl::getShuffleCost, splitting masks up according to the size
of the legalized vectors. If the sub-masks have at most 2 input sources
we can call getShuffleCost on them and sum the costs, to get a more
accurate final cost for the entire shuffle. The call to
improveShuffleKindFromMask helps to improve the shuffle kind for the
sub-mask cost call.

Differential Revision: https://reviews.llvm.org/D123414
llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
llvm/test/Analysis/CostModel/AArch64/shuffle-other.ll