aboutsummaryrefslogtreecommitdiff
path: root/gcc/passes.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>2005-09-27 12:47:27 -0600
committerJeff Law <law@gcc.gnu.org>2005-09-27 12:47:27 -0600
commitf20731b7ca20be9dd32d7cf95ddeb9ef6baa4d1c (patch)
tree6c0678c98499772e377cb3741449d3860e6fd8a0 /gcc/passes.c
parent3542b7ccd2bfe7d5bf9df0f008eecf4d1858c18d (diff)
downloadgcc-f20731b7ca20be9dd32d7cf95ddeb9ef6baa4d1c.zip
gcc-f20731b7ca20be9dd32d7cf95ddeb9ef6baa4d1c.tar.gz
gcc-f20731b7ca20be9dd32d7cf95ddeb9ef6baa4d1c.tar.bz2
passes.c (init_optimization_passes): Replace copy propagation passes immediately after DOM with phi-only copy...
* 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. From-SVN: r104705
Diffstat (limited to 'gcc/passes.c')
-rw-r--r--gcc/passes.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/gcc/passes.c b/gcc/passes.c
index 6a35b17..b03eae3 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,