[PATCH] D107541: [AArch64] Cost-model vector concatenation
Dave Green via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 6 10:08:34 PDT 2021
dmgreen added a comment.
In D107541#2930890 <https://reviews.llvm.org/D107541#2930890>, @SjoerdMeijer wrote:
> In D107541#2929005 <https://reviews.llvm.org/D107541#2929005>, @dmgreen wrote:
>
>> Can we also add some more tests, for things that are insert_subvector's but not just the simple concat's?
>
> Yeah, I have tried, but unsuccessfully. The shuffle cost for a `SK_InsertSubvector` is guarded by `isInsertSubvectorMask()`:
>
> if (Shuffle->isInsertSubvectorMask(NumSubElts, SubIndex))
> return TargetTTI->getShuffleCost(
> TTI::SK_InsertSubvector, VecTy, Shuffle->getShuffleMask(),
> SubIndex,
> FixedVectorType::get(VecTy->getScalarType(), NumSubElts));
>
> And this `isInsertSubvectorMask()` seems to only return true for subverter masks that are identity masks, so I haven't been able to trigger this with other masks.
This would count too `%X = shufflevector <8 x i16> undef, <8 x i16> undef, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 8, i32 9>`. It has an identity for the first vector, with the second inserted into it.
I think the condition can be more specific to a concat if those are the cases that are really cheap. Two 64bit vectors combined together into a 128bit vector.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D107541/new/
https://reviews.llvm.org/D107541
More information about the llvm-commits
mailing list