1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-28 22:42:52 +01:00
llvm-mirror/lib/Transforms/Scalar
Chris Lattner dcbc6443ae 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.

llvm-svn: 50096
2008-04-22 07:05:46 +00:00
..
ADCE.cpp API changes for class Use size reduction, wave 1. 2008-04-06 20:25:17 +00:00
BasicBlockPlacement.cpp Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
CodeGenPrepare.cpp silence a warning when assertions are disabled. 2008-04-06 21:44:08 +00:00
CondPropagate.cpp Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
ConstantProp.cpp Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
DCE.cpp Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
DeadStoreElimination.cpp Be more precise when eliminating pointers bue to memcpy's. This allows more 2008-02-04 04:53:00 +00:00
GCSE.cpp API changes for class Use size reduction, wave 1. 2008-04-06 20:25:17 +00:00
GVN.cpp Remove unneeded #include's. 2008-04-21 07:47:38 +00:00
GVNPRE.cpp API changes for class Use size reduction, wave 1. 2008-04-06 20:25:17 +00:00
IndVarSimplify.cpp API changes for class Use size reduction, wave 1. 2008-04-06 20:25:17 +00:00
InstructionCombining.cpp remove dead code. 2008-04-22 03:21:48 +00:00
JumpThreading.cpp Teach jump threading to thread through blocks like: 2008-04-22 07:05:46 +00:00
LICM.cpp Use empty() instead of comparing size() with zero. 2008-01-29 13:02:09 +00:00
LoopIndexSplit.cpp API changes for class Use size reduction, wave 1. 2008-04-06 20:25:17 +00:00
LoopRotation.cpp Revert r49614. As Dan pointed out, some of these aren't correct. 2008-04-14 17:38:21 +00:00
LoopStrengthReduce.cpp Minor whitespace and comment cleanups. 2008-04-14 18:26:16 +00:00
LoopUnroll.cpp Revert r49614. As Dan pointed out, some of these aren't correct. 2008-04-14 17:38:21 +00:00
LoopUnswitch.cpp fit some more code in 80 cols. 2008-04-21 00:25:49 +00:00
Makefile remove attribution from lib Makefiles. 2007-12-29 20:09:26 +00:00
MemCpyOptimizer.cpp Refactor memcpyopt based on Chris' suggestions. Consolidate several functions 2008-04-21 07:45:10 +00:00
PredicateSimplifier.cpp Remove unnecessary <sstream> includes. 2008-04-14 20:40:47 +00:00
Reassociate.cpp Don't include <map> in Pass.h, which doesn't need it. This requires 2008-03-21 23:51:57 +00:00
Reg2Mem.cpp Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
Scalar.cpp C and Objective Caml bindings for mem2reg and reg2mem. 2008-03-20 17:16:03 +00:00
ScalarReplAggregates.cpp API changes for class Use size reduction, wave 1. 2008-04-06 20:25:17 +00:00
SCCP.cpp Be conservative if getresult operand is neither call nor invoke. 2008-04-09 15:58:24 +00:00
SimplifyCFG.cpp API changes for class Use size reduction, wave 1. 2008-04-06 20:25:17 +00:00
TailDuplication.cpp replace a slow and verbose version of Instruction::isUsedOutsideOfBlock with 2008-04-20 22:18:22 +00:00
TailRecursionElimination.cpp API changes for class Use size reduction, wave 1. 2008-04-06 20:25:17 +00:00