llvm-6502/test/Transforms
Chris Lattner 6bf77500c6 Teach jump threading to thread through blocks like:
br (and X, phi(Y, Z, false)), label L1, label L2

This triggers once on 252.eon and 6 times on 176.gcc.  Blocks 
in question often look like this:

bb262:		; preds = %bb261, %bb248
	%iftmp.251.0 = phi i1 [ true, %bb261 ], [ false, %bb248 ]		; <i1> [#uses=4]
	%tmp270 = icmp eq %struct.rtx_def* %tmp.0.i, null		; <i1> [#uses=1]
	%bothcond = or i1 %iftmp.251.0, %tmp270		; <i1> [#uses=1]
	br i1 %bothcond, label %bb288, label %bb273

In this case, it is clear that it doesn't matter if tmp.0.i is null when coming from bb261.  When coming from bb248, it is all that matters.


Another random example:

check_asm_operands.exit:		; preds = %check_asm_operands.exit.thr_comm, %bb30.i, %bb12.i, %bb6.i413
	%tmp.0.i420 = phi i1 [ true, %bb6.i413 ], [ true, %bb12.i ], [ true, %bb30.i ], [ false, %check_asm_operands.exit.thr_comm ; <i1> [#uses=1]
	call void @llvm.stackrestore( i8* %savedstack ) nounwind 
	%tmp4389 = icmp eq i32 %added_sets_1.0, 0		; <i1> [#uses=1]
	%tmp4394 = icmp eq i32 %added_sets_2.0, 0		; <i1> [#uses=1]
	%bothcond80 = and i1 %tmp4389, %tmp4394		; <i1> [#uses=1]
	%bothcond81 = and i1 %bothcond80, %tmp.0.i420		; <i1> [#uses=1]
	br i1 %bothcond81, label %bb4398, label %bb4397

Here is the case from 252.eon:

bb290.i.i:		; preds = %bb23.i57.i.i, %bb8.i39.i.i, %bb100.i.i, %bb100.i.i, %bb85.i.i110
	%myEOF.1.i.i = phi i1 [ true, %bb100.i.i ], [ true, %bb100.i.i ], [ true, %bb85.i.i110 ], [ true, %bb8.i39.i.i ], [ false, %bb23.i57.i.i ]		; <i1> [#uses=2]
	%i.4.i.i = phi i32 [ %i.1.i.i, %bb85.i.i110 ], [ %i.0.i.i, %bb100.i.i ], [ %i.0.i.i, %bb100.i.i ], [ %i.3.i.i, %bb8.i39.i.i ], [ %i.3.i.i, %bb23.i57.i.i ]		; <i32> [#uses=3]
	%tmp292.i.i = load i8* %tmp16.i.i100, align 1		; <i8> [#uses=1]
	%tmp293.not.i.i = icmp ne i8 %tmp292.i.i, 0		; <i1> [#uses=1]
	%bothcond.i.i = and i1 %tmp293.not.i.i, %myEOF.1.i.i		; <i1> [#uses=1]
	br i1 %bothcond.i.i, label %bb202.i.i, label %bb301.i.i
  Factoring out 3 common predecessors.

On the path from any blocks other than bb23.i57.i.i, the load and compare 
are dead.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50096 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-22 07:05:46 +00:00
..
ADCE rename *.llx -> *.ll, last batch. 2008-04-19 22:32:52 +00:00
ArgumentPromotion Remove llvm-upgrade and update test cases. 2008-03-01 09:15:35 +00:00
BlockPlacement Remove llvm-upgrade and update test cases. 2008-03-01 09:15:35 +00:00
BranchFolding Don't branch fold inline asm statements. 2007-10-19 21:09:55 +00:00
CodeExtractor Remove llvm-upgrade and update test cases. 2008-03-01 09:15:35 +00:00
CondProp Remove llvm-upgrade and update test cases. 2008-03-01 09:15:35 +00:00
ConstantMerge Remove llvm-upgrade and update test cases. 2008-03-01 09:15:35 +00:00
ConstProp Remove llvm-upgrade and update test cases. 2008-03-01 09:15:35 +00:00
DeadArgElim Remove llvm-upgrade and update test cases. 2008-03-01 09:15:35 +00:00
DeadStoreElimination rename *.llx -> *.ll, last batch. 2008-04-19 22:32:52 +00:00
GCSE Remove llvm-upgrade and update test cases. 2008-03-01 09:15:35 +00:00
GlobalDCE Remove llvm-upgrade and update test cases. 2008-03-01 09:15:35 +00:00
GlobalOpt rename *.llx -> *.ll, last batch. 2008-04-19 22:32:52 +00:00
GVN Add testcase for PR2213. 2008-04-11 05:13:32 +00:00
GVNPRE For PR1553: 2007-07-19 23:13:04 +00:00
IndVarsSimplify rename *.llx -> *.ll, last batch. 2008-04-19 22:32:52 +00:00
Inline rename *.llx -> *.ll, last batch. 2008-04-19 22:32:52 +00:00
InstCombine optimize "p != gep p, ..." better. This allows us to compile 2008-04-22 02:53:33 +00:00
IPConstantProp Handle multiple ret values. 2008-03-11 22:24:29 +00:00
JumpThreading Teach jump threading to thread through blocks like: 2008-04-22 07:05:46 +00:00
LCSSA Byebye llvm-upgrade! 2008-03-25 04:26:08 +00:00
LICM rename *.llx -> *.ll, last batch. 2008-04-19 22:32:52 +00:00
LoopIndexSplit Add incoming value from header only if phi node has any use inside the loop. 2008-03-24 20:16:14 +00:00
LoopRotate Byebye llvm-upgrade! 2008-03-25 04:26:08 +00:00
LoopSimplify Byebye llvm-upgrade! 2008-03-25 04:26:08 +00:00
LoopStrengthReduce Upgrade tests. 2008-03-19 07:28:33 +00:00
LoopUnroll Upgrade tests. 2008-03-19 07:28:33 +00:00
LoopUnswitch Upgrade tests. 2008-03-19 07:28:33 +00:00
LowerInvoke rename *.llx -> *.ll, last batch. 2008-04-19 22:32:52 +00:00
LowerSetJmp Upgrade tests. 2008-03-19 07:28:33 +00:00
LowerSwitch Upgrade tests. 2008-03-19 07:28:33 +00:00
Mem2Reg Upgrade tests. 2008-03-19 07:28:33 +00:00
MemCpyOpt Refactor memcpyopt based on Chris' suggestions. Consolidate several functions 2008-04-21 07:45:10 +00:00
PredicateSimplifier Upgrade tests. 2008-03-19 05:39:35 +00:00
PruneEH rename *.llx -> *.ll, last batch. 2008-04-19 22:32:52 +00:00
RaiseAllocations Upgrade tests. 2008-03-19 05:39:35 +00:00
Reassociate Upgrade tests to not use llvm-upgrade. 2008-03-19 04:36:04 +00:00
ScalarRepl Upgrade tests to not use llvm-upgrade. 2008-03-18 04:14:37 +00:00
SCCP Upgrade tests to not use llvm-upgrade. 2008-03-19 04:14:49 +00:00
SimplifyCFG Upgrade tests. 2008-03-19 05:39:35 +00:00
SimplifyLibCalls Generalize getUnaryFloatFunction to handle any FP unary function, automatically 2008-04-09 17:48:11 +00:00
SRETPromotion Fix attribute handling. 2008-03-12 00:07:03 +00:00
StripSymbols Do not strip llvm.used values. 2008-01-16 03:33:05 +00:00
TailCallElim Remove llvm-upgrade and update tests. 2008-03-10 07:21:50 +00:00
TailDup rename *.llx -> *.ll, last batch. 2008-04-19 22:32:52 +00:00