diff options
author | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-09-27 18:47:27 +0000 |
---|---|---|
committer | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-09-27 18:47:27 +0000 |
commit | 421828b0b5dc7574bccb3ed8a292a6c6e05058ee (patch) | |
tree | 6c0678c98499772e377cb3741449d3860e6fd8a0 /gcc/passes.c | |
parent | 3b918afe88944dabe0320865d2550ae001f7950a (diff) | |
download | gcc-421828b0b5dc7574bccb3ed8a292a6c6e05058ee.tar.gz |
* passes.c (init_optimization_passes): Replace copy propagation
passes immediately after DOM with phi-only copy propagation
pases. Add phi-only copy propagation pass after first DOM pass.
* tree-pass.h (pass_phi_only_copy_prop): Declare.
* tree-ssa-copy.c (init_copy_prop): Accept new PHI_ONLY argument.
If true, then mark all non-control statements with DONT_SIMULATE_AGAIN.
(execute_copy_prop): Accept new PHI_ONLY argument. Pass it along
to init_copy_prop. Callers updated.
(do_phi_only_copy_prop): New function.
(pass_phi_only_copy_prop): New pass descriptor.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@104705 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/passes.c')
-rw-r--r-- | gcc/passes.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/gcc/passes.c b/gcc/passes.c index 6a35b1750a7..b03eae39f43 100644 --- a/gcc/passes.c +++ b/gcc/passes.c @@ -494,6 +494,12 @@ init_optimization_passes (void) NEXT_PASS (pass_merge_phi); NEXT_PASS (pass_dominator); + /* The only copy propagation opportunities left after DOM + should be due to degenerate PHI nodes. So rather than + run the full copy propagator, just discover and copy + propagate away the degenerate PHI nodes. */ + NEXT_PASS (pass_phi_only_copy_prop); + NEXT_PASS (pass_phiopt); NEXT_PASS (pass_may_alias); NEXT_PASS (pass_tail_recursion); @@ -508,7 +514,13 @@ init_optimization_passes (void) NEXT_PASS (pass_may_alias); NEXT_PASS (pass_rename_ssa_copies); NEXT_PASS (pass_dominator); - NEXT_PASS (pass_copy_prop); + + /* The only copy propagation opportunities left after DOM + should be due to degenerate PHI nodes. So rather than + run the full copy propagator, just discover and copy + propagate away the degenerate PHI nodes. */ + NEXT_PASS (pass_phi_only_copy_prop); + NEXT_PASS (pass_dce); NEXT_PASS (pass_dse); NEXT_PASS (pass_may_alias); @@ -529,7 +541,13 @@ init_optimization_passes (void) NEXT_PASS (pass_sink_code); NEXT_PASS (pass_tree_loop); NEXT_PASS (pass_dominator); - NEXT_PASS (pass_copy_prop); + + /* The only copy propagation opportunities left after DOM + should be due to degenerate PHI nodes. So rather than + run the full copy propagator, just discover and copy + propagate away the degenerate PHI nodes. */ + NEXT_PASS (pass_phi_only_copy_prop); + NEXT_PASS (pass_cd_dce); /* FIXME: If DCE is not run before checking for uninitialized uses, |