Skip to content

[X86] combineINSERT_SUBVECTOR - peek through bitcasts to find a concatenation of subvector shuffles #131331

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion llvm/lib/Target/X86/X86ISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58818,7 +58818,7 @@ static SDValue combineINSERT_SUBVECTOR(SDNode *N, SelectionDAG &DAG,

// Attempt to recursively combine to a shuffle.
if (all_of(SubVectorOps, [](SDValue SubOp) {
return isTargetShuffle(SubOp.getOpcode());
return isTargetShuffle(peekThroughBitcasts(SubOp).getOpcode());
})) {
SDValue Op(N, 0);
if (SDValue Res = combineX86ShufflesRecursively(Op, DAG, Subtarget))
Expand Down
3,316 changes: 1,630 additions & 1,686 deletions llvm/test/CodeGen/X86/vector-interleaved-store-i16-stride-5.ll

Large diffs are not rendered by default.

2,048 changes: 995 additions & 1,053 deletions llvm/test/CodeGen/X86/vector-interleaved-store-i16-stride-6.ll

Large diffs are not rendered by default.

1,222 changes: 592 additions & 630 deletions llvm/test/CodeGen/X86/vector-interleaved-store-i8-stride-5.ll

Large diffs are not rendered by default.

2,828 changes: 1,364 additions & 1,464 deletions llvm/test/CodeGen/X86/vector-interleaved-store-i8-stride-6.ll

Large diffs are not rendered by default.

5,520 changes: 2,750 additions & 2,770 deletions llvm/test/CodeGen/X86/vector-interleaved-store-i8-stride-7.ll

Large diffs are not rendered by default.

736 changes: 232 additions & 504 deletions llvm/test/CodeGen/X86/vector-interleaved-store-i8-stride-8.ll

Large diffs are not rendered by default.

6 changes: 2 additions & 4 deletions llvm/test/CodeGen/X86/vector-shuffle-512-v64.ll
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,7 @@ define <64 x i8> @shuffle_v64i8_63_62_61_60_59_58_57_56_55_54_53_52_51_50_49_48_
; AVX512F-NEXT: vpshufb %ymm1, %ymm0, %ymm2
; AVX512F-NEXT: vextracti64x4 $1, %zmm0, %ymm0
; AVX512F-NEXT: vpshufb %ymm1, %ymm0, %ymm0
; AVX512F-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0
; AVX512F-NEXT: vpermq {{.*#+}} zmm0 = zmm0[2,3,0,1,6,7,4,5]
; AVX512F-NEXT: vshufi64x2 {{.*#+}} zmm0 = zmm0[2,3,0,1],zmm2[2,3,0,1]
; AVX512F-NEXT: retq
;
; AVX512BW-LABEL: shuffle_v64i8_63_62_61_60_59_58_57_56_55_54_53_52_51_50_49_48_47_46_45_44_43_42_41_40_39_38_37_36_35_34_33_32_31_30_29_28_27_26_25_24_23_22_21_20_19_18_17_16_15_14_13_12_11_10_09_08_07_06_05_04_03_02_01_00:
Expand All @@ -185,8 +184,7 @@ define <64 x i8> @shuffle_v64i8_63_62_61_60_59_58_57_56_55_54_53_52_51_50_49_48_
; AVX512DQ-NEXT: vpshufb %ymm1, %ymm0, %ymm2
; AVX512DQ-NEXT: vextracti64x4 $1, %zmm0, %ymm0
; AVX512DQ-NEXT: vpshufb %ymm1, %ymm0, %ymm0
; AVX512DQ-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0
; AVX512DQ-NEXT: vpermq {{.*#+}} zmm0 = zmm0[2,3,0,1,6,7,4,5]
; AVX512DQ-NEXT: vshufi64x2 {{.*#+}} zmm0 = zmm0[2,3,0,1],zmm2[2,3,0,1]
; AVX512DQ-NEXT: retq
;
; AVX512VBMI-LABEL: shuffle_v64i8_63_62_61_60_59_58_57_56_55_54_53_52_51_50_49_48_47_46_45_44_43_42_41_40_39_38_37_36_35_34_33_32_31_30_29_28_27_26_25_24_23_22_21_20_19_18_17_16_15_14_13_12_11_10_09_08_07_06_05_04_03_02_01_00:
Expand Down