Commit 5f24e0dc by Richard Henderson Committed by Richard Henderson

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
parent 9381bbc9
2003-02-15 Richard Henderson <rth@redhat.com> 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; * recog.c (split_all_insns): Include new blocks in life update;
do a global life update. do a global life update.
......
...@@ -1593,9 +1593,10 @@ cfganal.o : cfganal.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ ...@@ -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 \ 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) \ insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h $(RECOG_H) \
function.h except.h $(GGC_H) function.h except.h $(GGC_H)
cfgcleanup.o : cfgcleanup.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ cfgcleanup.o : cfgcleanup.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(TIMEVAR_H) $(BASIC_BLOCK_H) hard-reg-set.h output.h flags.h $(RECOG_H) toplev.h \ $(RTL_H) $(TIMEVAR_H) $(BASIC_BLOCK_H) hard-reg-set.h output.h flags.h \
$(GGC_H) insn-config.h cselib.h $(TARGET_H) $(TM_P_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) \ 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 $(BASIC_BLOCK_H) hard-reg-set.h cfgloop.h flags.h
cfgloopanal.o : cfgloopanal.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) \ cfgloopanal.o : cfgloopanal.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) \
......
...@@ -45,6 +45,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -45,6 +45,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "recog.h" #include "recog.h"
#include "toplev.h" #include "toplev.h"
#include "cselib.h" #include "cselib.h"
#include "params.h"
#include "tm_p.h" #include "tm_p.h"
#include "target.h" #include "target.h"
...@@ -1464,7 +1465,7 @@ try_crossjump_bb (mode, bb) ...@@ -1464,7 +1465,7 @@ try_crossjump_bb (mode, bb)
{ {
edge e, e2, nexte2, nexte, fallthru; edge e, e2, nexte2, nexte, fallthru;
bool changed; bool changed;
int n = 0; int n = 0, max;
/* Nothing to do if there is not at least two incoming edges. */ /* Nothing to do if there is not at least two incoming edges. */
if (!bb->pred || !bb->pred->pred_next) if (!bb->pred || !bb->pred->pred_next)
...@@ -1473,11 +1474,13 @@ try_crossjump_bb (mode, bb) ...@@ -1473,11 +1474,13 @@ try_crossjump_bb (mode, bb)
/* It is always cheapest to redirect a block that ends in a branch to /* 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 a block that falls through into BB, as that adds no branches to the
program. We'll try that combination first. */ 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) if (e->flags & EDGE_FALLTHRU)
break; fallthru = e;
if (n > 100) if (n > max)
return false; return false;
} }
......
...@@ -4346,6 +4346,13 @@ In each case, the @var{value} is an integer. The allowable choices for ...@@ -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: @var{name} are given in the following table:
@table @gcctabopt @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 @item max-delay-slot-insn-search
The maximum number of instructions to consider when looking for an The maximum number of instructions to consider when looking for an
instruction to fill a delay slot. If more than this arbitrary number of instruction to fill a delay slot. If more than this arbitrary number of
......
...@@ -202,6 +202,12 @@ DEFPARAM(TRACER_MIN_BRANCH_PROBABILITY, ...@@ -202,6 +202,12 @@ DEFPARAM(TRACER_MIN_BRANCH_PROBABILITY,
this threshold (in percents). Used when profile feedback is not available", this threshold (in percents). Used when profile feedback is not available",
50) 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 #ifdef ENABLE_GC_ALWAYS_COLLECT
# define GGC_MIN_EXPAND_DEFAULT 0 # define GGC_MIN_EXPAND_DEFAULT 0
# define GGC_MIN_HEAPSIZE_DEFAULT 0 # define GGC_MIN_HEAPSIZE_DEFAULT 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment