[AArch64][CostModel] Make sext/zext free if folded into a masked load
authorDavid Sherwood <david.sherwood@arm.com>
Wed, 5 Apr 2023 12:58:03 +0000 (12:58 +0000)
committerDavid Sherwood <david.sherwood@arm.com>
Thu, 20 Apr 2023 08:48:57 +0000 (08:48 +0000)
commitafc2b7db026a9d6c71d1f0d1ec9dd1ca56d1601f
tree8664e868ef225081eeae89b504da4246b1eae905
parent7365a1127bfe2f6bdd2c04931eab04f4ca1df015
[AArch64][CostModel] Make sext/zext free if folded into a masked load

The BasicTTIImpl implementation of getCastInstrCost ensures
that the cost of zext/sext is 0 when following a load if we
know the combined extending load is legal. For SVE we can do
the same for masked loads too, since they use exactly the
same underlying instruction.

Differential Revision: https://reviews.llvm.org/D148123
llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
llvm/test/Analysis/CostModel/AArch64/masked_ldst.ll