llvm-6502/test
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
..
Analysis rename *.llx -> *.ll, last batch. 2008-04-19 22:32:52 +00:00
Archive Delete the svn:executable property on these files, which aren't executable. 2007-07-23 19:26:08 +00:00
Assembler rename *.llx -> *.ll 2008-04-19 22:26:29 +00:00
Bindings/Ocaml Expose ExecutionEngine::getTargetData() to c and ocaml bindings. 2008-03-27 00:27:14 +00:00
Bitcode fix this test. 2008-02-17 00:15:25 +00:00
BugPoint Remove llvm-upgrade 2008-02-17 00:15:09 +00:00
C++Frontend Add -m32 to compilation line; test is only valid in 2008-03-10 17:56:53 +00:00
CFrontend Make these structs larger to ensure that they 2008-04-21 08:17:05 +00:00
CodeGen Implement an x86-64 ABI detail of passing structs by hidden first 2008-04-21 23:59:07 +00:00
DebugInfo Remove llvm-upgrade and update tests. 2008-03-10 07:21:50 +00:00
ExecutionEngine rename *.llx -> *.ll, last batch. 2008-04-19 22:32:52 +00:00
Feature Start removing 'unwinds to' support from mainline in preparation for 2.3. 2008-04-22 05:16:02 +00:00
FrontendAda Testcase for gimplify_expr crash caused by an 2008-01-15 19:55:41 +00:00
FrontendObjC Rename these tests to use the appropriate suffixes. 2007-12-11 15:55:52 +00:00
Integer refactor handling of symbolic constant folding, picking up 2008-04-19 21:58:19 +00:00
lib Byebye llvm-upgrade! 2008-03-25 04:26:08 +00:00
Linker This passes now 2008-03-10 22:34:11 +00:00
Other Keep track of analysis information inherited from Module pass manager. 2008-03-20 01:09:53 +00:00
Scripts Add a test script for counting lines. This can be used instead of the 2007-08-10 15:07:05 +00:00
TableGen Rename MRegisterInfo to TargetRegisterInfo. 2008-02-10 18:45:23 +00:00
Transforms Teach jump threading to thread through blocks like: 2008-04-22 07:05:46 +00:00
Verifier Add testcase for prev. commit. Minor fixes 2008-03-22 08:37:05 +00:00
Makefile Do not pass -g flag when compiling tests, so remove the C.Flags. This only happens if you have a debug build of llvm. 2008-03-18 19:59:04 +00:00
Makefile.tests Failure.sh is dead, remove it. 2007-04-21 20:46:55 +00:00
TestRunner.sh Avoid an infinite loop when TestRunner.sh is run outside of the test dir. 2007-05-18 02:06:03 +00:00