You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying some examples with https://reviews.llvm.org/D123494 and noticed that AArch64 seems smarter about decomposing shuffle costs via mask:
definevoid@cross_talk(<8 x i32> %a, <8 x i32> %b) {
%s = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i328, i320, i321, i322, i323, i328, i328, i328>
retvoid
}
If we don't care about element order, that can be turned into the much simpler (especially for a 128-bit vector target):
definevoid@identity_and_splat(<8 x i32> %a, <8 x i32> %b) {
%s = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i320, i321, i322, i323, i328, i328, i328, i328>
retvoid
}
That transform happens with AArch64, but that doesn't happen with x86 because:
% opt -mtriple=x86_64 -passes="print<cost-model>" -disable-output shufcost.ll Printing analysis 'Cost Model Analysis' for function 'cross_talk':Cost Model: Found an estimated cost of 12 for instruction: %s = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 8, i32 0, i32 1, i32 2, i32 3, i32 8, i32 8, i32 8>Printing analysis 'Cost Model Analysis' for function 'identity_and_splat':Cost Model: Found an estimated cost of 12 for instruction: %s = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 8, i32 8, i32 8, i32 8>
The text was updated successfully, but these errors were encountered:
I was trying some examples with https://reviews.llvm.org/D123494 and noticed that AArch64 seems smarter about decomposing shuffle costs via mask:
If we don't care about element order, that can be turned into the much simpler (especially for a 128-bit vector target):
That transform happens with AArch64, but that doesn't happen with x86 because:
The text was updated successfully, but these errors were encountered: