llvm-6502/lib/Transforms/InstCombine
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
..
CMakeLists.txt
InstCombine.h Reapply r110396, with fixes to appease the Linux buildbot gods. 2010-08-06 18:33:48 +00:00
InstCombineAddSub.cpp
InstCombineAndOrXor.cpp Re-apply the infamous r108614, with a fix pointed out by Dirk Steinke. 2010-08-02 09:32:13 +00:00
InstCombineCalls.cpp PR7853: fix a silly mistake introduced in r101899, and add a test to make sure 2010-08-09 20:49:43 +00:00
InstCombineCasts.cpp optimize bitcast(trunc(bitcast(x))) where the result is a float and 'x' 2010-08-26 21:55:42 +00:00
InstCombineCompares.cpp PR7750: !CExpr->isNullValue() only properly computes whether CExpr is nonnull 2010-07-29 18:03:33 +00:00
InstCombineLoadStoreAlloca.cpp Re-apply r111568 with a fix for the clang self-host. 2010-08-20 18:24:43 +00:00
InstCombineMulDivRem.cpp
InstCombinePHI.cpp cache result of operator* 2010-07-12 14:15:58 +00:00
InstCombineSelect.cpp Remove the rest of my instcombine changes. Back to the drawing board on this one. 2010-07-16 16:39:00 +00:00
InstCombineShifts.cpp
InstCombineSimplifyDemanded.cpp use ArgOperand API 2010-06-28 16:45:00 +00:00
InstCombineVectorOps.cpp Temporarily revert r110987 as it's causing some miscompares in 2010-08-17 22:55:27 +00:00
InstCombineWorklist.h
InstructionCombining.cpp Fix batch of converting RegisterPass<> to INTIALIZE_PASS(). 2010-07-21 22:09:45 +00:00
Makefile