Commit 5c856b23 by Jan Hubicka Committed by Jan Hubicka

Makefile.in (tracer.o): New.

	* Makefile.in (tracer.o): New.
	* params.def (TRACER_*): New options.
	* rtl.h (tracer): Declare.
	* timevar.def (TV_TRACER): New.
	* toplev.c (dump_file_index): Add DFI_tracer.
	(dump_file_info): Add tracer.
	(flag_tracer): New.
	(lang_indepdenent_options): Add tracer.
	(rest_of_compilation): Call tracer.
	* tracer.c: New file.
	* invoke.texi (-ftracer): Document.
	(--param tracer-*): Document.

From-SVN: r54154
parent e2405951
Sat Jun 1 23:29:51 CEST 2002 Jan Hubicka <jh@suse.cz>
* Makefile.in (tracer.o): New.
* params.def (TRACER_*): New options.
* rtl.h (tracer): Declare.
* timevar.def (TV_TRACER): New.
* toplev.c (dump_file_index): Add DFI_tracer.
(dump_file_info): Add tracer.
(flag_tracer): New.
(lang_indepdenent_options): Add tracer.
(rest_of_compilation): Call tracer.
* tracer.c: New file.
* invoke.texi (-ftracer): Document.
(--param tracer-*): Document.
2002-06-01 Daniel Berlin <dberlin@dberlin.org>
* tree-inline.c (expand_call_inline): Make the statement
......
......@@ -732,7 +732,7 @@ OBJS = alias.o bb-reorder.o bitmap.o builtins.o caller-save.o calls.o \
reload.o reload1.o reorg.o resource.o rtl.o rtlanal.o rtl-error.o \
sbitmap.o sched-deps.o sched-ebb.o sched-rgn.o sched-vis.o sdbout.o \
sibcall.o simplify-rtx.o ssa.o ssa-ccp.o ssa-dce.o stmt.o \
stor-layout.o stringpool.o timevar.o toplev.o tree.o tree-dump.o \
stor-layout.o stringpool.o timevar.o toplev.o tracer.o tree.o tree-dump.o \
tree-inline.o unroll.o varasm.o varray.o version.o vmsdbgout.o xcoffout.o \
$(GGC) $(out_object_file) $(EXTRA_OBJS)
......@@ -1596,6 +1596,9 @@ predict.o: predict.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
lists.o: lists.c $(CONFIG_H) $(SYSTEM_H) toplev.h $(RTL_H) $(GGC_H)
bb-reorder.o : bb-reorder.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) \
flags.h $(BASIC_BLOCK_H) hard-reg-set.h output.h cfglayout.h $(TARGET_H)
tracer.o : tracer.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) \
$(BASIC_BLOCK_H) hard-reg-set.h output.h cfglayout.h flags.h \
$(PARAMS_H) profile.h
cfglayout.o : cfglayout.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) \
insn-config.h $(BASIC_BLOCK_H) hard-reg-set.h output.h function.h \
cfglayout.h
......
......@@ -282,7 +282,7 @@ in the following sections.
-frerun-cse-after-loop -frerun-loop-opt @gol
-fschedule-insns -fschedule-insns2 @gol
-fsingle-precision-constant -fssa -fssa-ccp -fssa-dce @gol
-fstrength-reduce -fstrict-aliasing -fthread-jumps -ftrapv @gol
-fstrength-reduce -fstrict-aliasing -ftracer -fthread-jumps -ftrapv @gol
-funroll-all-loops -funroll-loops @gol
--param @var{name}=@var{value}
-O -O0 -O1 -O2 -O3 -Os}
......@@ -3637,6 +3637,12 @@ those which have no call-preserved registers to use instead.
For all machines, optimization level 2 and higher enables this flag by
default.
@item -ftracer
@opindex ftracer
Perform tail duplication to enlarge superblock size. This transformation
simplifies the control flow of the function allowing other optimizations to do
better job.
@item -funroll-loops
@opindex funroll-loops
Unroll loops whose number of iterations can be determined at compile
......@@ -3941,6 +3947,39 @@ given basic block needs to have to be considered hot.
@item hot-bb-frequency-fraction
Select fraction of the maximal frequency of executions of basic block in
function given basic block needs to have to be considered hot
@item tracer-dynamic-coverage
@itemx tracer-dynamic-coverage-feedback
This value is used to limit superblock formation once given percentage of
executed instructions is covered. This limits unnecesary code size expansion.
The @option{tracer-dynamic-coverage-feedback} is used only when profile
feedback is available. The real profiles (as opposed to statically estimated
ones) are much less balanced allowing the threshold to be larger value.
@item tracer-max-code-growth
Stop tail duplication once code growth has reached given percentage. This is
rather hokey argument, as most of the duplicates will be elliminated later in
cross jumping, so it may be set to much higher values than is the desired code
growth.
@item tracer-min-branch-ratio
Stop reverse growth when the reverse probability of best edge is less than this
threshold (in percent).
@item tracer-min-branch-ratio
@itemx tracer-min-branch-ratio-feedback
Stop forward growth if the best edge do have probability lower than this
threshold.
Similary to @option{tracer-dynamic-coverage} two values are present, one for
compilation for profile feedback and one for compilation without. The value
for compilation with profile feedback needs to be more conservative (higher) in
order to make tracer effective.
@end table
@end table
......
......@@ -153,12 +153,43 @@ DEFPARAM(PARAM_MAX_UNROLLED_INSNS,
DEFPARAM(HOT_BB_COUNT_FRACTION,
"hot-bb-count-fraction",
"Select fraction of the maximal count of repetitions of basic block in program given basic block needs to have to be considered hot",
"Select fraction of the maximal count of repetitions of basic block in \
program given basic block needs to have to be considered hot",
10000)
DEFPARAM(HOT_BB_FREQUENCY_FRACTION,
"hot-bb-frequency-fraction",
"Select fraction of the maximal frequency of executions of basic block in function given basic block needs to have to be considered hot",
"Select fraction of the maximal frequency of executions of basic \
block in function given basic block needs to have to be considered hot",
1000)
DEFPARAM(TRACER_DYNAMIC_COVERAGE_FEEDBACK,
"tracer-dynamic-coverage-feedback",
"The percentage of function, weighted by execution frequency, that \
must be covered by trace formation. Used when profile feedback is available",
95)
DEFPARAM(TRACER_DYNAMIC_COVERAGE,
"tracer-dynamic-coverage",
"The percentage of function, weighted by execution frequency, that \
must be covered by trace formation. Used when profile feedback is not available",
75)
DEFPARAM(TRACER_MAX_CODE_GROWTH,
"tracer-max-code-growth",
"Maximal code growth caused by tail duplication (in percents)",
100)
DEFPARAM(TRACER_MIN_BRANCH_RATIO,
"tracer-min-branch-ratio",
"Stop reverse growth if the reverse probability of best edge is less \
than this threshold (in percents)",
10)
DEFPARAM(TRACER_MIN_BRANCH_PROBABILITY_FEEDBACK,
"tracer-min-branch-probability-feedback",
"Stop forward growth if the probability of best edge is less than \
this threshold (in percents). Used when profile feedback is available",
30)
DEFPARAM(TRACER_MIN_BRANCH_PROBABILITY,
"tracer-min-branch-probability",
"Stop forward growth if the probability of best edge is less than \
this threshold (in percents). Used when profile feedback is not available",
50)
/*
Local variables:
mode:c
......
......@@ -2281,4 +2281,6 @@ extern void if_convert PARAMS ((int));
/* In predict.c */
extern void invert_br_probabilities PARAMS ((rtx));
extern bool expensive_function_p PARAMS ((int));
/* In tracer.c */
extern void tracer PARAMS ((void));
#endif /* ! GCC_RTL_H */
......@@ -58,6 +58,7 @@ DEFTIMEVAR (TV_JUMP , "jump")
DEFTIMEVAR (TV_CSE , "CSE")
DEFTIMEVAR (TV_GCSE , "global CSE")
DEFTIMEVAR (TV_LOOP , "loop analysis")
DEFTIMEVAR (TV_TRACER , "tracer")
DEFTIMEVAR (TV_CSE2 , "CSE 2")
DEFTIMEVAR (TV_BRANCH_PROB , "branch prediction")
DEFTIMEVAR (TV_FLOW , "flow analysis")
......
......@@ -224,6 +224,7 @@ enum dump_file_index
DFI_loop,
DFI_cfg,
DFI_bp,
DFI_tracer,
DFI_cse2,
DFI_life,
DFI_combine,
......@@ -271,6 +272,7 @@ static struct dump_file_info dump_file[DFI_MAX] =
{ "loop", 'L', 1, 0, 0 },
{ "cfg", 'f', 1, 0, 0 },
{ "bp", 'b', 1, 0, 0 },
{ "tracer", 'T', 1, 0, 0 },
{ "cse2", 't', 1, 0, 0 },
{ "life", 'f', 1, 0, 0 }, /* Yes, duplicate enable switch. */
{ "combine", 'c', 1, 0, 0 },
......@@ -866,6 +868,10 @@ int flag_merge_constants = 1;
one, unconditionally renumber instruction UIDs. */
int flag_renumber_insns = 1;
/* Nonzero if we perform superblock formation. */
int flag_tracer = 0;
/* Values of the -falign-* flags: how much to align labels in code.
0 means `use default', 1 means `don't align'.
For each variable, there is an _log variant which is the power
......@@ -977,6 +983,8 @@ static const lang_independent_options f_options[] =
N_("When possible do not generate stack frames") },
{"optimize-sibling-calls", &flag_optimize_sibling_calls, 1,
N_("Optimize sibling and tail recursive calls") },
{"tracer", &flag_tracer, 1,
N_("Perform superblock formation via tail duplication") },
{"cse-follow-jumps", &flag_cse_follow_jumps, 1,
N_("When running CSE, follow jumps to their targets") },
{"cse-skip-blocks", &flag_cse_skip_blocks, 1,
......@@ -2958,6 +2966,19 @@ rest_of_compilation (decl)
close_dump_file (DFI_bp, print_rtl_with_bb, insns);
timevar_pop (TV_BRANCH_PROB);
}
if (flag_tracer)
{
timevar_push (TV_TRACER);
open_dump_file (DFI_tracer, decl);
if (rtl_dump_file)
dump_flow_info (rtl_dump_file);
cleanup_cfg (CLEANUP_EXPENSIVE);
tracer ();
cleanup_cfg (CLEANUP_EXPENSIVE);
close_dump_file (DFI_tracer, print_rtl_with_bb, get_insns ());
timevar_pop (TV_TRACER);
reg_scan (get_insns (), max_reg_num (), 0);
}
if (optimize > 0)
{
......
This diff is collapsed. Click to expand it.
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