From 0559b9e557addc6093db2667b0a22a8a4e6ca9d4 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Tue, 6 Dec 2016 22:50:13 +0000 Subject: [PATCH] [X86][XOP] Add test case for PR31296 llvm-svn: 288858 --- .../X86/vector-shuffle-combining-xop.ll | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/llvm/test/CodeGen/X86/vector-shuffle-combining-xop.ll b/llvm/test/CodeGen/X86/vector-shuffle-combining-xop.ll index 707cafe9931e..41c1866de0d0 100644 --- a/llvm/test/CodeGen/X86/vector-shuffle-combining-xop.ll +++ b/llvm/test/CodeGen/X86/vector-shuffle-combining-xop.ll @@ -341,3 +341,23 @@ define <16 x i8> @constant_fold_vpperm() { %1 = call <16 x i8> @llvm.x86.xop.vpperm(<16 x i8> , <16 x i8> , <16 x i8> ) ret <16 x i8> %1 } + +define <4 x float> @PR31296(i8* %in) { +; X32-LABEL: PR31296: +; X32: # BB#0: # %entry +; X32-NEXT: vmovaps {{.*#+}} xmm0 = [1.000000e+00,0.000000e+00,0.000000e+00,1.000000e+00] +; X32-NEXT: retl +; +; X64-LABEL: PR31296: +; X64: # BB#0: # %entry +; X64-NEXT: vmovaps {{.*#+}} xmm0 = [1.000000e+00,0.000000e+00,0.000000e+00,1.000000e+00] +; X64-NEXT: retq +entry: + %0 = getelementptr i8, i8* %in, i32 0 + %1 = bitcast i8* %0 to i32* + %2 = load i32, i32* %1 + %3 = zext i32 %2 to i128 + %4 = bitcast i128 %3 to <4 x float> + %5 = shufflevector <4 x float> %4, <4 x float> , <4 x i32> + ret <4 x float> %5 +}