Skip to content

Commit c731291

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

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,18 @@ define <8 x float> @constant_fold_vpermilvar_ps_256() {
370370
ret <8 x float> %1
371371
}
372372

373+
define <8 x float> @freeze_vpermilvar_ps_256(<8 x float> %a0) {
374+
; CHECK-LABEL: freeze_vpermilvar_ps_256:
375+
; CHECK: # %bb.0:
376+
; CHECK-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,3,1,2,7,6,5,4]
377+
; CHECK-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,2,3,1,7,6,5,4]
378+
; CHECK-NEXT: ret{{[l|q]}}
379+
%s0 = call <8 x float> @llvm.x86.avx.vpermilvar.ps.256(<8 x float> %a0, <8 x i32> <i32 0, i32 3, i32 1, i32 2, i32 7, i32 6, i32 5, i32 4>)
380+
%f0 = freeze <8 x float> %s0
381+
%s1 = call <8 x float> @llvm.x86.avx.vpermilvar.ps.256(<8 x float> %f0, <8 x i32> <i32 0, i32 2, i32 3, i32 1, i32 7, i32 6, i32 5, i32 4>)
382+
ret <8 x float> %s1
383+
}
384+
373385
define void @PR39483() {
374386
; X86-AVX1-LABEL: PR39483:
375387
; X86-AVX1: # %bb.0: # %entry

0 commit comments

Comments
 (0)