From 05c5270a6754fa2c52a3b2039b8b944de9cc8032 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Sat, 17 Sep 2016 17:40:08 +0000 Subject: [PATCH] [X86][SSSE3] Add target shuffle constant folding tests git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281827 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../X86/vector-shuffle-combining-ssse3.ll | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/CodeGen/X86/vector-shuffle-combining-ssse3.ll b/test/CodeGen/X86/vector-shuffle-combining-ssse3.ll index 0d03ab0e559..c286fd426b1 100644 --- a/test/CodeGen/X86/vector-shuffle-combining-ssse3.ll +++ b/test/CodeGen/X86/vector-shuffle-combining-ssse3.ll @@ -380,3 +380,19 @@ define <16 x i8> @combine_unpckl_arg1_pshufb(<16 x i8> %a0, <16 x i8> %a1) { %2 = tail call <16 x i8> @llvm.x86.ssse3.pshuf.b.128(<16 x i8> %1, <16 x i8> ) ret <16 x i8> %2 } + +define <16 x i8> @constant_fold_pshufb() { +; SSE-LABEL: constant_fold_pshufb: +; SSE: # BB#0: +; SSE-NEXT: movdqa {{.*#+}} xmm0 = [15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0] +; SSE-NEXT: pshufb {{.*#+}} xmm0 = xmm0[1],zero,zero,zero,xmm0[u,u],zero,zero,xmm0[15],zero,zero,zero,zero,zero,xmm0[7,6] +; SSE-NEXT: retq +; +; AVX-LABEL: constant_fold_pshufb: +; AVX: # BB#0: +; AVX-NEXT: vmovdqa {{.*#+}} xmm0 = [15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0] +; AVX-NEXT: vpshufb {{.*#+}} xmm0 = xmm0[1],zero,zero,zero,xmm0[u,u],zero,zero,xmm0[15],zero,zero,zero,zero,zero,xmm0[7,6] +; AVX-NEXT: retq + %1 = tail call <16 x i8> @llvm.x86.ssse3.pshuf.b.128(<16 x i8> , <16 x i8> ) + ret <16 x i8> %1 +} -- 2.50.1