diff options
author | Filip Kastl <fkastl@suse.cz> | 2023-12-14 11:29:31 +0100 |
---|---|---|
committer | Filip Kastl <fkastl@suse.cz> | 2023-12-14 11:30:40 +0100 |
commit | cd794c3961017703a4d2ca0e854ea23b3d4b6373 (patch) | |
tree | 1547f11b5209f3a016e07850da490f2bc1b79150 /gcc/tree-pass.h | |
parent | 96e1978b213482fc4c25693b91ae2ead481af620 (diff) | |
download | gcc-cd794c3961017703a4d2ca0e854ea23b3d4b6373.zip gcc-cd794c3961017703a4d2ca0e854ea23b3d4b6373.tar.gz gcc-cd794c3961017703a4d2ca0e854ea23b3d4b6373.tar.bz2 |
A new copy propagation and PHI elimination pass
This patch adds the strongly-connected copy propagation (SCCOPY) pass.
It is a lightweight GIMPLE copy propagation pass that also removes some
redundant PHI statements. It handles degenerate PHIs, e.g.:
_5 = PHI <_1>;
_6 = PHI <_6, _6, _1, _1>;
_7 = PHI <16, _7>;
// Replaces occurences of _5 and _6 by _1 and _7 by 16
It also handles more complicated situations, e.g.:
_8 = PHI <_9, _10>;
_9 = PHI <_8, _10>;
_10 = PHI <_8, _9, _1>;
// Replaces occurences of _8, _9 and _10 by _1
gcc/ChangeLog:
* Makefile.in: Added sccopy pass.
* passes.def: Added sccopy pass before LTO streaming and before
RTL expansion.
* tree-pass.h (make_pass_sccopy): Added sccopy pass.
* gimple-ssa-sccopy.cc: New file.
gcc/testsuite/ChangeLog:
* gcc.dg/sccopy-1.c: New test.
Signed-off-by: Filip Kastl <fkastl@suse.cz>
Diffstat (limited to 'gcc/tree-pass.h')
-rw-r--r-- | gcc/tree-pass.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/tree-pass.h b/gcc/tree-pass.h index de2820b..52fd57f 100644 --- a/gcc/tree-pass.h +++ b/gcc/tree-pass.h @@ -399,6 +399,7 @@ extern gimple_opt_pass *make_pass_iv_optimize (gcc::context *ctxt); extern gimple_opt_pass *make_pass_tree_loop_done (gcc::context *ctxt); extern gimple_opt_pass *make_pass_ch (gcc::context *ctxt); extern gimple_opt_pass *make_pass_ch_vect (gcc::context *ctxt); +extern gimple_opt_pass *make_pass_sccopy (gcc::context *ctxt); extern gimple_opt_pass *make_pass_ccp (gcc::context *ctxt); extern gimple_opt_pass *make_pass_split_paths (gcc::context *ctxt); extern gimple_opt_pass *make_pass_build_ssa (gcc::context *ctxt); |