From fdea31a4630da6a5644e059955ee6899deda3471 Mon Sep 17 00:00:00 2001 From: Nate Begeman Date: Wed, 24 Mar 2010 20:49:50 +0000 Subject: BUILD_VECTOR was missing out on some prime opportunities to use SSE 4.1 inserts. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99423 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CodeGen/X86/vec_insert-4.ll | 11 +++++++++++ test/CodeGen/X86/vec_insert-9.ll | 9 +++++++++ test/CodeGen/X86/vec_insert_4.ll | 11 ----------- test/CodeGen/X86/vec_set.ll | 2 +- test/CodeGen/X86/vec_shuffle.ll | 3 ++- 5 files changed, 23 insertions(+), 13 deletions(-) create mode 100644 test/CodeGen/X86/vec_insert-4.ll create mode 100644 test/CodeGen/X86/vec_insert-9.ll delete mode 100644 test/CodeGen/X86/vec_insert_4.ll (limited to 'test/CodeGen') diff --git a/test/CodeGen/X86/vec_insert-4.ll b/test/CodeGen/X86/vec_insert-4.ll new file mode 100644 index 0000000..2c31e56 --- /dev/null +++ b/test/CodeGen/X86/vec_insert-4.ll @@ -0,0 +1,11 @@ +; RUN: llc < %s -march=x86 -mcpu=yonah | grep 1084227584 | count 1 + +; ModuleID = '' +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" +target triple = "i686-apple-darwin9.2.2" + +define <8 x float> @f(<8 x float> %a, i32 %b) nounwind { +entry: + %vecins = insertelement <8 x float> %a, float 5.000000e+00, i32 %b ; <<4 x float>> [#uses=1] + ret <8 x float> %vecins +} diff --git a/test/CodeGen/X86/vec_insert-9.ll b/test/CodeGen/X86/vec_insert-9.ll new file mode 100644 index 0000000..2e829df --- /dev/null +++ b/test/CodeGen/X86/vec_insert-9.ll @@ -0,0 +1,9 @@ +; RUN: llc < %s -march=x86 -mattr=+sse41 > %t +; RUN: grep pinsrd %t | count 2 + +define <4 x i32> @var_insert2(<4 x i32> %x, i32 %val, i32 %idx) nounwind { +entry: + %tmp3 = insertelement <4 x i32> undef, i32 %val, i32 0 ; <<4 x i32>> [#uses=1] + %tmp4 = insertelement <4 x i32> %tmp3, i32 %idx, i32 3 ; <<4 x i32>> [#uses=1] + ret <4 x i32> %tmp4 +} diff --git a/test/CodeGen/X86/vec_insert_4.ll b/test/CodeGen/X86/vec_insert_4.ll deleted file mode 100644 index 2c31e56..0000000 --- a/test/CodeGen/X86/vec_insert_4.ll +++ /dev/null @@ -1,11 +0,0 @@ -; RUN: llc < %s -march=x86 -mcpu=yonah | grep 1084227584 | count 1 - -; ModuleID = '' -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" -target triple = "i686-apple-darwin9.2.2" - -define <8 x float> @f(<8 x float> %a, i32 %b) nounwind { -entry: - %vecins = insertelement <8 x float> %a, float 5.000000e+00, i32 %b ; <<4 x float>> [#uses=1] - ret <8 x float> %vecins -} diff --git a/test/CodeGen/X86/vec_set.ll b/test/CodeGen/X86/vec_set.ll index c316df8..7f5f8dd 100644 --- a/test/CodeGen/X86/vec_set.ll +++ b/test/CodeGen/X86/vec_set.ll @@ -1,4 +1,4 @@ -; RUN: llc < %s -march=x86 -mattr=+sse2 | grep punpckl | count 7 +; RUN: llc < %s -march=x86 -mattr=+sse2,-sse41 | grep punpckl | count 7 define void @test(<8 x i16>* %b, i16 %a0, i16 %a1, i16 %a2, i16 %a3, i16 %a4, i16 %a5, i16 %a6, i16 %a7) nounwind { %tmp = insertelement <8 x i16> zeroinitializer, i16 %a0, i32 0 ; <<8 x i16>> [#uses=1] diff --git a/test/CodeGen/X86/vec_shuffle.ll b/test/CodeGen/X86/vec_shuffle.ll index c05b79a..2a48de2 100644 --- a/test/CodeGen/X86/vec_shuffle.ll +++ b/test/CodeGen/X86/vec_shuffle.ll @@ -1,5 +1,6 @@ ; RUN: llc < %s -march=x86 -mcpu=core2 -o %t -; RUN: grep shufp %t | count 1 +; RUN: grep movq %t | count 1 +; RUN: grep pshufd %t | count 1 ; RUN: grep movupd %t | count 1 ; RUN: grep pshufhw %t | count 1 -- cgit v1.1