Skip to content

Commit c10befb

Browse files
authored
[X86] Add test showing failure to fold freeze(vpermps(x,y)) -> vpermps(freeze(x),freeze(y)) (#160837)
1 parent ef5e0c7 commit c10befb

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

llvm/test/CodeGen/X86/vector-shuffle-combining-avx2.ll

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -933,6 +933,26 @@ entry:
933933
ret i32 %tmp6
934934
}
935935

936+
define <8 x float> @freeze_permps(<8 x float> %a0) {
937+
; AVX2-LABEL: freeze_permps:
938+
; AVX2: # %bb.0:
939+
; AVX2-NEXT: vmovaps {{.*#+}} ymm1 = [7,6,5,4,3,2,1,0]
940+
; AVX2-NEXT: vpermps %ymm0, %ymm1, %ymm0
941+
; AVX2-NEXT: vpermps %ymm0, %ymm1, %ymm0
942+
; AVX2-NEXT: ret{{[l|q]}}
943+
;
944+
; AVX512-LABEL: freeze_permps:
945+
; AVX512: # %bb.0:
946+
; AVX512-NEXT: vpmovsxbd {{.*#+}} ymm1 = [7,6,5,4,3,2,1,0]
947+
; AVX512-NEXT: vpermps %ymm0, %ymm1, %ymm0
948+
; AVX512-NEXT: vpermps %ymm0, %ymm1, %ymm0
949+
; AVX512-NEXT: ret{{[l|q]}}
950+
%s0 = call <8 x float> @llvm.x86.avx2.permps(<8 x float> %a0, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>)
951+
%f0 = freeze <8 x float> %s0
952+
%s1 = call <8 x float> @llvm.x86.avx2.permps(<8 x float> %f0, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>)
953+
ret <8 x float> %s1
954+
}
955+
936956
define <32 x i8> @PR27320(<8 x i32> %a0) {
937957
; CHECK-LABEL: PR27320:
938958
; CHECK: # %bb.0:

0 commit comments

Comments
 (0)