llvm-6502/lib/Transforms
Chris Lattner e5a1426174 optimize bitcast(trunc(bitcast(x))) where the result is a float and 'x'
is a vector to be a vector element extraction.  This allows clang to
compile:

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

into:

_foo:                                   ## @foo
## BB#0:                                ## %entry
	movd	%xmm0, %rax
	shrq	$32, %rax
	movd	%eax, %xmm2
	addss	%xmm0, %xmm2
	movapd	%xmm1, %xmm3
	addss	%xmm2, %xmm3
	movd	%xmm1, %rax
	shrq	$32, %rax
	movd	%eax, %xmm0
	addss	%xmm3, %xmm0
	ret

instead of:

_foo:                                   ## @foo
## BB#0:                                ## %entry
	movd	%xmm0, %rax
	movd	%eax, %xmm0
	shrq	$32, %rax
	movd	%eax, %xmm2
	addss	%xmm0, %xmm2
	movd	%xmm1, %rax
	movd	%eax, %xmm1
	addss	%xmm2, %xmm1
	shrq	$32, %rax
	movd	%eax, %xmm0
	addss	%xmm1, %xmm0
	ret

... eliminating half of the horribleness.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112227 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-26 21:55:42 +00:00
..
Hello Reapply r110396, with fixes to appease the Linux buildbot gods. 2010-08-06 18:33:48 +00:00
InstCombine optimize bitcast(trunc(bitcast(x))) where the result is a float and 'x' 2010-08-26 21:55:42 +00:00
Instrumentation Reapply r110396, with fixes to appease the Linux buildbot gods. 2010-08-06 18:33:48 +00:00
IPO Reapply r112091 and r111922, support for metadata linking, with a 2010-08-26 15:41:53 +00:00
Scalar Make JumpThreading smart enough to properly thread StrSwitch when it's compiled with clang++. 2010-08-26 17:40:24 +00:00
Utils Reapply r112091 and r111922, support for metadata linking, with a 2010-08-26 15:41:53 +00:00
Makefile Revert r100896 and around - this breaks the only mingw32 buildbot we have. 2010-04-15 19:51:42 +00:00