[llvm] e28ae5e - [X86][AVX] Add PR49971 test case

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 22 03:32:44 PDT 2021


Author: Simon Pilgrim
Date: 2021-04-22T11:32:29+01:00
New Revision: e28ae5e530679eee5a7a574de6cb78a12cbe75ed

URL: https://github.com/llvm/llvm-project/commit/e28ae5e530679eee5a7a574de6cb78a12cbe75ed
DIFF: https://github.com/llvm/llvm-project/commit/e28ae5e530679eee5a7a574de6cb78a12cbe75ed.diff

LOG: [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.

Added: 
    

Modified: 
    llvm/test/CodeGen/X86/horizontal-shuffle-3.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/CodeGen/X86/horizontal-shuffle-3.ll b/llvm/test/CodeGen/X86/horizontal-shuffle-3.ll
index 424ecf352e97..297070ad2bb6 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> <i32 0, i32 1, i32 0, i32 1>
+  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>)


        


More information about the llvm-commits mailing list