summaryrefslogtreecommitdiff
path: root/test/CodeGen/X86/avx-splat.ll
diff options
context:
space:
mode:
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>2011-08-11 02:49:41 +0000
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>2011-08-11 02:49:41 +0000
commita5134a0ea3ee9e12ae3ca7907b7998e0d7f4d441 (patch)
treecbbbe28951ec8c985bdd398aa9e7cf29bfe484a5 /test/CodeGen/X86/avx-splat.ll
parent586272d67ca0cd91e49aa0f03298cc1294128385 (diff)
downloadllvm-a5134a0ea3ee9e12ae3ca7907b7998e0d7f4d441.tar.gz
llvm-a5134a0ea3ee9e12ae3ca7907b7998e0d7f4d441.tar.bz2
llvm-a5134a0ea3ee9e12ae3ca7907b7998e0d7f4d441.tar.xz
Use the splat index to generate the desired shuffle. Otherwise we
could only get undefs and the vector shuffle becomes an undef, generating wrong code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137295 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/X86/avx-splat.ll')
-rw-r--r--test/CodeGen/X86/avx-splat.ll10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/CodeGen/X86/avx-splat.ll b/test/CodeGen/X86/avx-splat.ll
index 36d469417f..243ab9ba31 100644
--- a/test/CodeGen/X86/avx-splat.ll
+++ b/test/CodeGen/X86/avx-splat.ll
@@ -77,3 +77,13 @@ __load_and_broadcast_32.exit1249: ; preds = %load.i1247, %for_ex
ret void
}
+; CHECK: vpshufd $0
+; CHECK-NEXT: vinsertf128 $1
+define <8 x float> @funcF(i32* %ptr) nounwind {
+ %val = load i32* %ptr, align 4
+ %ret6 = insertelement <8 x i32> undef, i32 %val, i32 6
+ %ret7 = insertelement <8 x i32> %ret6, i32 %val, i32 7
+ %tmp = bitcast <8 x i32> %ret7 to <8 x float>
+ ret <8 x float> %tmp
+}
+