From 4f255ad6a0ce17f02c3149dd84ab3e7eeac6055d Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Sun, 1 Oct 2017 18:17:39 +0000 Subject: [PATCH] [X86][AVX2] Simplify PACKUS combine test Trying to use a AND mask is tricky as after legalization its nigh impossible for computeKnownBits to do anything with it llvm-svn: 314630 --- llvm/test/CodeGen/X86/vector-shuffle-combining-avx2.ll | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/llvm/test/CodeGen/X86/vector-shuffle-combining-avx2.ll b/llvm/test/CodeGen/X86/vector-shuffle-combining-avx2.ll index bd1b23c..69a6eb7 100644 --- a/llvm/test/CodeGen/X86/vector-shuffle-combining-avx2.ll +++ b/llvm/test/CodeGen/X86/vector-shuffle-combining-avx2.ll @@ -846,18 +846,18 @@ declare <32 x i8> @llvm.x86.avx2.packsswb(<16 x i16>, <16 x i16>) nounwind readn define <16 x i16> @shuffle_combine_packusdw_pshufb(<8 x i32> %a0, <8 x i32> %a1) { ; X32-LABEL: shuffle_combine_packusdw_pshufb: ; X32: # BB#0: -; X32-NEXT: vpand {{\.LCPI.*}}, %ymm0, %ymm0 +; X32-NEXT: vpsrld $16, %ymm0, %ymm0 ; X32-NEXT: vpackusdw %ymm0, %ymm0, %ymm0 ; X32-NEXT: vpshufb {{.*#+}} ymm0 = ymm0[6,7,4,5,2,3,0,1,6,7,4,5,2,3,0,1,16,17,18,19,20,21,22,23,22,23,20,21,18,19,16,17] ; X32-NEXT: retl ; ; X64-LABEL: shuffle_combine_packusdw_pshufb: ; X64: # BB#0: -; X64-NEXT: vpand {{.*}}(%rip), %ymm0, %ymm0 +; X64-NEXT: vpsrld $16, %ymm0, %ymm0 ; X64-NEXT: vpackusdw %ymm0, %ymm0, %ymm0 ; X64-NEXT: vpshufb {{.*#+}} ymm0 = ymm0[6,7,4,5,2,3,0,1,6,7,4,5,2,3,0,1,16,17,18,19,20,21,22,23,22,23,20,21,18,19,16,17] ; X64-NEXT: retq - %1 = and <8 x i32> %a0, + %1 = lshr <8 x i32> %a0, %2 = tail call <16 x i16> @llvm.x86.avx2.packusdw(<8 x i32> %1, <8 x i32> %1) %3 = shufflevector <16 x i16> %2, <16 x i16> undef, <16 x i32> ret <16 x i16> %3 -- 2.7.4