From 7798d5992aa8d1bdf96b1c8399d26b6d38a998b5 Mon Sep 17 00:00:00 2001 From: Filipe Cabecinhas Date: Sun, 22 Jun 2014 17:21:37 +0000 Subject: Fix PR20087 by using the source index when changing the vector load git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211472 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CodeGen/X86/sse41.ll | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test/CodeGen') diff --git a/test/CodeGen/X86/sse41.ll b/test/CodeGen/X86/sse41.ll index a77ede228d..6726a3ea9f 100644 --- a/test/CodeGen/X86/sse41.ll +++ b/test/CodeGen/X86/sse41.ll @@ -703,3 +703,14 @@ define <4 x float> @insertps_with_undefs(<4 x float> %a, float* %b) { %result = shufflevector <4 x float> %a, <4 x float> %2, <4 x i32> ret <4 x float> %result } + +; Test for a bug in X86ISelLowering.cpp:getINSERTPS where we were using +; the destination index to change the load, instead of the source index. +define <4 x float> @pr20087(<4 x float> %a, <4 x float> *%ptr) { +; CHECK-LABEL: pr20087: +; CHECK: insertps $48 +; CHECK: ret + %load = load <4 x float> *%ptr + %ret = shufflevector <4 x float> %load, <4 x float> %a, <4 x i32> + ret <4 x float> %ret +} -- cgit v1.2.3