From b600ba3b790cabd803b574f2e51755474e2274a0 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Fri, 8 Jul 2016 17:01:42 +0000 Subject: [PATCH] [X86][AVX] Added combine test that should simplify to insertps llvm-svn: 274884 --- llvm/test/CodeGen/X86/vector-shuffle-combining-avx.ll | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/llvm/test/CodeGen/X86/vector-shuffle-combining-avx.ll b/llvm/test/CodeGen/X86/vector-shuffle-combining-avx.ll index 29dc1a3d1ebf..ffae771da46b 100644 --- a/llvm/test/CodeGen/X86/vector-shuffle-combining-avx.ll +++ b/llvm/test/CodeGen/X86/vector-shuffle-combining-avx.ll @@ -186,3 +186,13 @@ define <8 x float> @combine_vpermilvar_8f32_4stage(<8 x float> %a0) { %4 = tail call <8 x float> @llvm.x86.avx.vpermilvar.ps.256(<8 x float> %3, <8 x i32> ) ret <8 x float> %4 } + +define <4 x float> @combine_vpermilvar_4f32_as_insertps(<4 x float> %a0) { +; ALL-LABEL: combine_vpermilvar_4f32_as_insertps: +; ALL: # BB#0: +; ALL-NEXT: vpshufb {{.*#+}} xmm0 = xmm0[4,5,6,7],zero,zero,zero,zero,xmm0[8,9,10,11],zero,zero,zero,zero +; ALL-NEXT: retq + %1 = call <4 x float> @llvm.x86.avx.vpermilvar.ps(<4 x float> %a0, <4 x i32> ) + %2 = shufflevector <4 x float> %1, <4 x float> zeroinitializer, <4 x i32> + ret <4 x float> %2 +}