From: Simon Pilgrim Date: Sat, 17 Sep 2016 17:41:14 +0000 (+0000) Subject: [X86][AVX] Add target shuffle constant folding tests X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=679cf9558a24b43c39cd5948824564207849d983;p=llvm [X86][AVX] Add target shuffle constant folding tests git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281829 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/CodeGen/X86/vector-shuffle-combining-avx.ll b/test/CodeGen/X86/vector-shuffle-combining-avx.ll index ac18bba166f..70a1f14633a 100644 --- a/test/CodeGen/X86/vector-shuffle-combining-avx.ll +++ b/test/CodeGen/X86/vector-shuffle-combining-avx.ll @@ -240,3 +240,40 @@ define <4 x float> @combine_vpermilvar_4f32_as_insertps(<4 x float> %a0) { %2 = shufflevector <4 x float> %1, <4 x float> zeroinitializer, <4 x i32> ret <4 x float> %2 } + +define <2 x double> @constant_fold_vpermilvar_pd() { +; ALL-LABEL: constant_fold_vpermilvar_pd: +; ALL: # BB#0: +; ALL-NEXT: vpermilpd {{.*#+}} xmm0 = mem[1,0] +; ALL-NEXT: retq + %1 = call <2 x double> @llvm.x86.avx.vpermilvar.pd(<2 x double> , <2 x i64> ) + ret <2 x double> %1 +} + +define <4 x double> @constant_fold_vpermilvar_pd_256() { +; ALL-LABEL: constant_fold_vpermilvar_pd_256: +; ALL: # BB#0: +; ALL-NEXT: vpermilpd {{.*#+}} ymm0 = mem[1,0,2,3] +; ALL-NEXT: retq + %1 = call <4 x double> @llvm.x86.avx.vpermilvar.pd.256(<4 x double> , <4 x i64> ) + ret <4 x double> %1 +} + +define <4 x float> @constant_fold_vpermilvar_ps() { +; ALL-LABEL: constant_fold_vpermilvar_ps: +; ALL: # BB#0: +; ALL-NEXT: vpermilps {{.*#+}} xmm0 = mem[3,0,2,1] +; ALL-NEXT: retq + %1 = call <4 x float> @llvm.x86.avx.vpermilvar.ps(<4 x float> , <4 x i32> ) + ret <4 x float> %1 +} + +define <8 x float> @constant_fold_vpermilvar_ps_256() { +; ALL-LABEL: constant_fold_vpermilvar_ps_256: +; ALL: # BB#0: +; ALL-NEXT: vmovaps {{.*#+}} ymm0 = [1.000000e+00,2.000000e+00,3.000000e+00,4.000000e+00,5.000000e+00,6.000000e+00,7.000000e+00,8.000000e+00] +; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,2,1,4,5,5,5] +; ALL-NEXT: retq + %1 = call <8 x float> @llvm.x86.avx.vpermilvar.ps.256(<8 x float> , <8 x i32> ) + ret <8 x float> %1 +}