llvm-6502/test/Transforms
Chris Lattner 784f333aef Add an instcombine to clean up a common pattern produced
by the SRoA "promote to large integer" code, eliminating
some type conversions like this:

   %94 = zext i16 %93 to i32                       ; <i32> [#uses=2]
   %96 = lshr i32 %94, 8                           ; <i32> [#uses=1]
   %101 = trunc i32 %96 to i8                      ; <i8> [#uses=1]

This also unblocks other xforms from happening, now clang is able 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
	pshufd	$1, %xmm0, %xmm2
	addss	%xmm0, %xmm2
	movdqa	%xmm1, %xmm3
	addss	%xmm2, %xmm3
	pshufd	$1, %xmm1, %xmm0
	addss	%xmm3, %xmm0
	ret

on x86-64, instead of:

_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

This seems pretty close to optimal to me, at least without
using horizontal adds.  This also triggers in lots of other
code, including SPEC.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112278 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-27 18:31:05 +00:00
..
ABCD
ADCE
ArgumentPromotion Fix rdar://7879828 - crash in CallGraph, a self host issue. 2010-04-20 00:46:50 +00:00
BlockPlacement
BranchFolding
CodeExtractor
CodeGenPrepare
ConstantMerge 1. modernize the constantmerge pass, using densemap/smallvector. 2010-02-12 18:17:23 +00:00
ConstProp fix PR6197 - infinite recursion in ipsccp due to block addresses 2010-02-01 19:35:08 +00:00
DeadArgElim Preserve debug info attached with call instruction while eliminating dead argument. 2010-04-30 20:23:54 +00:00
DeadStoreElimination add newlines at the end of files. 2010-04-07 22:53:17 +00:00
FunctionAttrs Fix a README item: have functionattrs look through selects and 2010-01-06 15:37:47 +00:00
GlobalDCE
GlobalOpt Use llvm.foo as the intrinsic, rather than llvm.dbg.value. Since the 2010-05-04 20:09:25 +00:00
GVN Remove arm_apcscc from the test files. It is the default and doing this 2010-06-17 15:18:27 +00:00
IndVarSimplify Fix SCEVExpander::visitAddRecExpr so that it remembers the induction variable 2010-07-26 18:28:14 +00:00
Inline Fix PR7272: when inlining through a callsite with byval arguments, 2010-05-31 21:00:26 +00:00
InstCombine Add an instcombine to clean up a common pattern produced 2010-08-27 18:31:05 +00:00
Internalize
IPConstantProp Delete useless trailing semicolons. 2010-01-05 17:55:26 +00:00
JumpThreading Use LVI to eliminate conditional branches where we've tested a related condition previously. Update tests for this change. 2010-08-27 17:12:29 +00:00
LCSSA Avoid depending on LCSSA implicitly pulling in LoopSimplify. 2010-07-26 18:00:43 +00:00
LICM Remove dead debug info intrinsics. 2010-01-05 01:10:40 +00:00
LoopDeletion Make LoopSimplify change conditional branches in loop exiting blocks 2010-02-25 06:57:05 +00:00
LoopIndexSplit Check for side effects before splitting loop. 2010-05-03 18:06:58 +00:00
LoopRotate When rotating loops, put the original header at the bottom of the 2010-08-17 17:39:21 +00:00
LoopSimplify LoopSimplify shouldn't split loop backedges that use indirectbr. PR7867. 2010-08-14 00:43:09 +00:00
LoopStrengthReduce Move x86-specific tests out of test/Transforms/LoopStrengthReduce and 2010-08-05 17:04:15 +00:00
LoopUnroll
LoopUnswitch Remove arm_apcscc from the test files. It is the default and doing this 2010-06-17 15:18:27 +00:00
LowerAtomic Add an atomic lowering pass 2010-08-03 16:19:16 +00:00
LowerInvoke
LowerSetJmp
LowerSwitch
Mem2Reg Copy location info for current function argument from dbg.declare if respective store instruction does not have any location info. 2010-06-04 22:27:30 +00:00
MemCpyOpt Reapply address space patch after fixing an issue in MemCopyOptimizer. 2010-04-04 03:10:48 +00:00
MergeFunc Arrays and vectors with different numbers of elements are not equivalent. 2010-07-16 06:31:12 +00:00
PartialSpecialize Fixed and reactivated a partial specialization test 2010-08-19 12:42:38 +00:00
PruneEH fix some failures my callgraph dump format change broke. 2010-04-23 18:38:40 +00:00
Reassociate fix a nice subtle reassociate bug which would only occur 2010-03-05 07:18:54 +00:00
ScalarRepl Fix the second half of PR7437: scalarrepl wasn't preserving 2010-07-08 00:27:05 +00:00
SCCP fix PR7876: If ipsccp decides that a function's address is taken 2010-08-12 22:25:23 +00:00
SimplifyCFG Instead, teach SimplifyCFG to trim non-address-taken blocks from 2010-08-16 14:41:14 +00:00
SimplifyLibCalls Make sure that simplify libcalls does not replace a call with one calling 2010-06-16 19:34:01 +00:00
Sink Add an LLVM IR version of code sinking. This uses the same simple algorithm 2010-05-07 15:40:13 +00:00
SRETPromotion
SSI
StripSymbols DIGlobalVariable can be used to encode debug info for globals that are directly folded into a constant by FE. 2010-08-25 18:52:02 +00:00
TailCallElim Handle the case of a tail recursion in which the tail call is followed 2010-07-13 15:41:41 +00:00
TailDup