Chris Lattner 3ddcc43040 fix the BuildVector -> unpcklps logic to not do pointless shuffles
when the top elements of a vector are undefined.  This happens all
the time for X86-64 ABI stuff because only the low 2 elements of
a 4 element vector are defined.  For example, on:

_Complex float f32(_Complex float A, _Complex float B) {
  return A+B;
}

We used to produce (with SSE2, SSE4.1+ uses insertps):

_f32:                                   ## @f32
	movdqa	%xmm0, %xmm2
	addss	%xmm1, %xmm2
	pshufd	$16, %xmm2, %xmm2
	pshufd	$1, %xmm1, %xmm1
	pshufd	$1, %xmm0, %xmm0
	addss	%xmm1, %xmm0
	pshufd	$16, %xmm0, %xmm1
	movdqa	%xmm2, %xmm0
	unpcklps	%xmm1, %xmm0
	ret

We now produce:

_f32:                                   ## @f32
	movdqa	%xmm0, %xmm2
	addss	%xmm1, %xmm2
	pshufd	$1, %xmm1, %xmm1
	pshufd	$1, %xmm0, %xmm3
	addss	%xmm1, %xmm3
	movaps	%xmm2, %xmm0
	unpcklps	%xmm3, %xmm0
	ret

This implements rdar://8368414


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112378 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-28 17:28:30 +00:00
..
2010-01-12 18:29:23 +00:00
2009-11-18 21:33:35 +00:00
2009-11-26 00:35:01 +00:00
2010-02-13 02:06:10 +00:00
2010-02-15 22:03:29 +00:00
2010-07-13 18:14:47 +00:00
2010-04-17 16:29:15 +00:00
2010-03-03 00:35:56 +00:00
2010-04-17 16:29:15 +00:00
2009-11-07 06:19:20 +00:00
2010-04-17 16:29:15 +00:00
2010-04-07 22:53:17 +00:00
2010-07-16 22:51:10 +00:00
2010-07-10 22:42:12 +00:00
2010-04-17 03:43:36 +00:00
2010-05-08 04:47:54 +00:00
2010-06-14 20:19:03 +00:00
2010-04-17 16:29:15 +00:00
2010-04-17 16:29:15 +00:00
2009-11-11 07:11:02 +00:00
2009-11-11 07:11:02 +00:00
2009-11-11 07:11:02 +00:00
2010-01-12 04:52:47 +00:00
2010-03-10 03:07:41 +00:00
2010-04-04 19:28:59 +00:00
2010-08-17 22:35:20 +00:00
2010-03-25 20:01:07 +00:00
2010-03-10 07:07:45 +00:00
2010-01-05 17:55:26 +00:00
2010-04-28 01:53:13 +00:00
2010-04-28 01:53:13 +00:00
2009-12-16 00:53:11 +00:00
2010-04-28 01:53:13 +00:00
2010-08-15 19:40:29 +00:00
2010-04-17 16:29:15 +00:00
2010-01-19 21:51:51 +00:00
2010-06-03 04:02:59 +00:00
2010-03-05 06:17:43 +00:00
2010-02-27 23:53:53 +00:00
2009-10-23 05:58:34 +00:00
2009-10-23 05:58:34 +00:00
2009-10-23 05:58:34 +00:00
2009-10-23 05:58:34 +00:00
2010-04-28 08:30:49 +00:00
2010-06-09 20:30:22 +00:00
2009-12-15 03:00:32 +00:00