From e28ae5e530679eee5a7a574de6cb78a12cbe75ed Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Thu, 22 Apr 2021 10:57:19 +0100 Subject: [PATCH] [X86][AVX] Add PR49971 test case This is a llvm12 only bug, and is already avoided in trunk, but we should keep track of it. --- llvm/test/CodeGen/X86/horizontal-shuffle-3.ll | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/llvm/test/CodeGen/X86/horizontal-shuffle-3.ll b/llvm/test/CodeGen/X86/horizontal-shuffle-3.ll index 424ecf3..297070a 100644 --- a/llvm/test/CodeGen/X86/horizontal-shuffle-3.ll +++ b/llvm/test/CodeGen/X86/horizontal-shuffle-3.ll @@ -98,6 +98,17 @@ define <8 x i32> @test_unpackhi_hsub_v8i32(<8 x i32> %0, <8 x i32> %1, <8 x i32> ret <8 x i32> %7 } +define <4 x double> @PR49971(<4 x double> %0) { +; CHECK-LABEL: PR49971: +; CHECK: ## %bb.0: +; CHECK-NEXT: vhaddpd %xmm0, %xmm0, %xmm0 +; CHECK-NEXT: vbroadcastsd %xmm0, %ymm0 +; CHECK-NEXT: ret{{[l|q]}} + %2 = tail call <4 x double> @llvm.x86.avx.hadd.pd.256(<4 x double> %0, <4 x double> %0) + %3 = shufflevector <4 x double> %2, <4 x double> undef, <4 x i32> + ret <4 x double> %3 +} + declare <8 x float> @llvm.x86.avx.hadd.ps.256(<8 x float>, <8 x float>) declare <8 x float> @llvm.x86.avx.hsub.ps.256(<8 x float>, <8 x float>) declare <4 x double> @llvm.x86.avx.hadd.pd.256(<4 x double>, <4 x double>) -- 2.7.4