llvm-6502/lib
Chris Lattner 3dd08734c1 optimize bitcasts from large integers to vector into vector
element insertion from the pieces that feed into the vector.
This handles a pattern that occurs frequently due to code
generated for the x86-64 abi.  We now compile something like
this:

struct S { float A, B, C, D; };
struct S g;
struct S bar() { 
  struct S A = g;
  ++A.A;
  ++A.C;
  return A;
}

into all nice vector operations:

_bar:                                   ## @bar
## BB#0:                                ## %entry
	movq	_g@GOTPCREL(%rip), %rax
	movss	LCPI1_0(%rip), %xmm1
	movss	(%rax), %xmm0
	addss	%xmm1, %xmm0
	pshufd	$16, %xmm0, %xmm0
	movss	4(%rax), %xmm2
	movss	12(%rax), %xmm3
	pshufd	$16, %xmm2, %xmm2
	unpcklps	%xmm2, %xmm0
	addss	8(%rax), %xmm1
	pshufd	$16, %xmm1, %xmm1
	pshufd	$16, %xmm3, %xmm2
	unpcklps	%xmm2, %xmm1
	ret

instead of icky integer operations:

_bar:                                   ## @bar
	movq	_g@GOTPCREL(%rip), %rax
	movss	LCPI1_0(%rip), %xmm1
	movss	(%rax), %xmm0
	addss	%xmm1, %xmm0
	movd	%xmm0, %ecx
	movl	4(%rax), %edx
	movl	12(%rax), %esi
	shlq	$32, %rdx
	addq	%rcx, %rdx
	movd	%rdx, %xmm0
	addss	8(%rax), %xmm1
	movd	%xmm1, %eax
	shlq	$32, %rsi
	addq	%rax, %rsi
	movd	%rsi, %xmm1
	ret

This resolves rdar://8360454



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112343 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-28 01:20:38 +00:00
..
Analysis Fix an index calculation thinko. 2010-08-28 00:39:27 +00:00
Archive
AsmParser Add a comment explaining why this code doesn't just call 2010-08-24 14:35:45 +00:00
Bitcode Add a FIXME comment. 2010-08-25 20:23:38 +00:00
CodeGen Completely disable tail calls when fast-isel is enabled, as fast-isel 2010-08-28 00:51:03 +00:00
CompilerDriver Add a TODO. 2010-08-23 19:24:12 +00:00
ExecutionEngine remove some dead code. 2010-08-23 03:12:06 +00:00
Linker Reapply r112091 and r111922, support for metadata linking, with a 2010-08-26 15:41:53 +00:00
MC MCELF: Port EmitInstruction changes from MachO streamer. Patch by Roman Divacky. 2010-08-27 10:40:51 +00:00
Support StringRef::compare_numeric also differed from StringRef::compare for characters > 127. 2010-08-26 15:25:35 +00:00
System
Target We don't need to custom-select VLDMQ and VSTMQ anymore. 2010-08-28 00:20:11 +00:00
Transforms optimize bitcasts from large integers to vector into vector 2010-08-28 01:20:38 +00:00
VMCore Add alignment arguments to all the NEON load/store intrinsics. 2010-08-27 17:13:24 +00:00
Makefile