diff options
author | Richard Henderson <rth@redhat.com> | 2003-02-15 13:06:16 -0800 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2003-02-15 13:06:16 -0800 |
commit | 5f24e0dcf6344dda90214aed59753203dac14b4b (patch) | |
tree | d9e25ddc6c9d0b6ad9a565e5db34fc03dfed353b /gcc | |
parent | 9381bbc998366a7d255d2ad86d3f87b64b22ba22 (diff) | |
download | gcc-5f24e0dcf6344dda90214aed59753203dac14b4b.zip gcc-5f24e0dcf6344dda90214aed59753203dac14b4b.tar.gz gcc-5f24e0dcf6344dda90214aed59753203dac14b4b.tar.bz2 |
cfgcleanup.c: Include params.h.
* cfgcleanup.c: Include params.h.
(try_crossjump_bb): Use PARAM_MAX_CROSSJUMP_EDGES. Fix test for
too many outgoing edges from a block.
* Makefile.in (cfgcleanup.o): Depend on PARAMS_H.
* params.def (max-crossjump-edges): New.
* doc/invoke.texi: Document it.
From-SVN: r62942
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/Makefile.in | 7 | ||||
-rw-r--r-- | gcc/cfgcleanup.c | 13 | ||||
-rw-r--r-- | gcc/doc/invoke.texi | 7 | ||||
-rw-r--r-- | gcc/params.def | 6 |
5 files changed, 34 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2315a03..bba56b8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,14 @@ 2003-02-15 Richard Henderson <rth@redhat.com> + * cfgcleanup.c: Include params.h. + (try_crossjump_bb): Use PARAM_MAX_CROSSJUMP_EDGES. Fix test for + too many outgoing edges from a block. + * Makefile.in (cfgcleanup.o): Depend on PARAMS_H. + * params.def (max-crossjump-edges): New. + * doc/invoke.texi: Document it. + +2003-02-15 Richard Henderson <rth@redhat.com> + * recog.c (split_all_insns): Include new blocks in life update; do a global life update. diff --git a/gcc/Makefile.in b/gcc/Makefile.in index f4e26b7..8af0a704 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -1593,9 +1593,10 @@ cfganal.o : cfganal.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ cfgbuild.o : cfgbuild.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h \ insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h $(RECOG_H) \ function.h except.h $(GGC_H) -cfgcleanup.o : cfgcleanup.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(TIMEVAR_H) $(BASIC_BLOCK_H) hard-reg-set.h output.h flags.h $(RECOG_H) toplev.h \ - $(GGC_H) insn-config.h cselib.h $(TARGET_H) $(TM_P_H) +cfgcleanup.o : cfgcleanup.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(RTL_H) $(TIMEVAR_H) $(BASIC_BLOCK_H) hard-reg-set.h output.h flags.h \ + $(RECOG_H) toplev.h $(GGC_H) insn-config.h cselib.h $(TARGET_H) $(TM_P_H) \ + $(PARAMS_H) cfgloop.o : cfgloop.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) coretypes.h $(TM_H) \ $(BASIC_BLOCK_H) hard-reg-set.h cfgloop.h flags.h cfgloopanal.o : cfgloopanal.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) \ diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c index 338281a..3607fc3 100644 --- a/gcc/cfgcleanup.c +++ b/gcc/cfgcleanup.c @@ -45,6 +45,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "recog.h" #include "toplev.h" #include "cselib.h" +#include "params.h" #include "tm_p.h" #include "target.h" @@ -1464,7 +1465,7 @@ try_crossjump_bb (mode, bb) { edge e, e2, nexte2, nexte, fallthru; bool changed; - int n = 0; + int n = 0, max; /* Nothing to do if there is not at least two incoming edges. */ if (!bb->pred || !bb->pred->pred_next) @@ -1473,11 +1474,13 @@ try_crossjump_bb (mode, bb) /* It is always cheapest to redirect a block that ends in a branch to a block that falls through into BB, as that adds no branches to the program. We'll try that combination first. */ - for (fallthru = bb->pred; fallthru; fallthru = fallthru->pred_next, n++) + fallthru = NULL; + max = PARAM_VALUE (PARAM_MAX_CROSSJUMP_EDGES); + for (e = bb->pred; e ; e = e->pred_next, n++) { - if (fallthru->flags & EDGE_FALLTHRU) - break; - if (n > 100) + if (e->flags & EDGE_FALLTHRU) + fallthru = e; + if (n > max) return false; } diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 36e1411..0c6f4eb 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -4346,6 +4346,13 @@ In each case, the @var{value} is an integer. The allowable choices for @var{name} are given in the following table: @table @gcctabopt +@item max-crossjump-edges +The maximum number of incoming edges to consider for crossjumping. +The algorithm used by @option(-fcrossjumping) is @math{O(N^2)} in +the number of edges incoming to each block. Increasing values mean +more aggressive optimization, making the compile time increase with +probably small improvement in executable size. + @item max-delay-slot-insn-search The maximum number of instructions to consider when looking for an instruction to fill a delay slot. If more than this arbitrary number of diff --git a/gcc/params.def b/gcc/params.def index 998b40d..66d8231 100644 --- a/gcc/params.def +++ b/gcc/params.def @@ -202,6 +202,12 @@ DEFPARAM(TRACER_MIN_BRANCH_PROBABILITY, this threshold (in percents). Used when profile feedback is not available", 50) +/* The maximum number of incoming edges to consider for crossjumping. */ +DEFPARAM(PARAM_MAX_CROSSJUMP_EDGES, + "max-crossjump-edges", + "The maximum number of incoming edges to consider for crossjumping", + 100) + #ifdef ENABLE_GC_ALWAYS_COLLECT # define GGC_MIN_EXPAND_DEFAULT 0 # define GGC_MIN_HEAPSIZE_DEFAULT 0 |