From 84adaabf3e04d1938a137b1299a677d2fa489383 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Mon, 11 Oct 2021 13:30:10 +0100 Subject: [PATCH] [X86][AVX] Add test case for PR52122 --- .../CodeGen/X86/vector-shuffle-combining-avx2.ll | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/llvm/test/CodeGen/X86/vector-shuffle-combining-avx2.ll b/llvm/test/CodeGen/X86/vector-shuffle-combining-avx2.ll index 83fb56c67415..c01b83cc3064 100644 --- a/llvm/test/CodeGen/X86/vector-shuffle-combining-avx2.ll +++ b/llvm/test/CodeGen/X86/vector-shuffle-combining-avx2.ll @@ -843,6 +843,19 @@ entry: ret <8 x float> %shuf2 } +define <32 x i8> @PR52122(<32 x i8> %0, <32 x i8> %1) { +; CHECK-LABEL: PR52122: +; CHECK: # %bb.0: +; CHECK-NEXT: vpshufb {{.*#+}} ymm1 = zero,zero,ymm1[4],zero,zero,zero,ymm1[5],zero,zero,zero,ymm1[6],zero,zero,zero,ymm1[7],zero,zero,zero,ymm1[20],zero,zero,zero,ymm1[21],zero,zero,zero,ymm1[22],zero,zero,zero,ymm1[23],zero +; CHECK-NEXT: vpshufb {{.*#+}} ymm0 = ymm0[2,4],zero,ymm0[u,u,5],zero,ymm0[u,3,6],zero,ymm0[u,u,7],zero,ymm0[u,18,20],zero,ymm0[u,u,21],zero,ymm0[u,19,22],zero,ymm0[u,u,23],zero,ymm0[u] +; CHECK-NEXT: vpor %ymm1, %ymm0, %ymm0 +; CHECK-NEXT: ret{{[l|q]}} + %3 = shufflevector <32 x i8> %0, <32 x i8> , <32 x i32> + %4 = shufflevector <32 x i8> %3, <32 x i8> %1, <32 x i32> + %5 = shufflevector <32 x i8> %4, <32 x i8> %3, <32 x i32> + ret <32 x i8> %5 +} + define void @packss_zext_v8i1() { ; X86-LABEL: packss_zext_v8i1: ; X86: # %bb.0: