Makefile.in (rtl-profile.o): Kill all traces of it.

* Makefile.in (rtl-profile.o): Kill all traces of it.
	* common.opt (fspeculative-prefetching, ftree-based-profiling): Kill.
	* coverage.h (rtl_coverage_counter_ref): Kill.
	* opts.c (flag_speculative_prefetching_set): Kill.
	(flag_loop_optimize_set): New.
	(common_handle_option): Disable loop optimizer when profiling;
	do not handle speculative prefetching.
	* passes.c (init_optimization_passes): Replace pass_profiling combo
	by branch_prob pass.
	* profile.c (compute_value_histograms): Update for simplified value
	profiles.
	(rtl_register_profile_hooks): Kill.
	(pass_profiling): Kill.
	(rest_of_handle_branch_prob): Do not profile.
	* toplev.c (process_options): Remove speculative prefetching.
	* toplev.h (flag_tree_based_profiling): Kill.
	* tree-profile.c (prepare_instrumented_value,
	tree_gen_interval_profiler, tree_gen_pow2_profiler,
	tree_gen_one_value_profiler, do_tree_profiling): Update for
	simplified datastructures.
	* value-prof.c: Add comment that speculative prefetching was dropped;
	update rest of file for simplified datastructures.
	(NOPREFETCH_RANGE_MIN, NOPREFETCH_RANGE_MAX,
	rtl_divmod_values_to_profile, insn_prefetch_values_to_profile,
	find_mem_reference_1, find_mem_reference_2, find_mem_reference,
	rtl_values_to_profile, rtl_divmod_fixed_value, rtl_mod_pow2,
	rtl_mod_subtract, gen_speculative_prefetch,
	rtl_divmod_fixed_value_transform, rtl_mod_pow2_value_transform,
	rtl_mod_subtract_transform, speculative_prefetching_transform): Kill.
	(gate_handle_value_profile_transformations,
	rest_of_handle_value_profile_transformations,
	pass_value_profile_transformations): Kill.
	* value-prof.h (histogram_value_t): Remove IL based unions.
	(rtl_register_value_prof_hooks, rtl_register_profile_hooks,
	rtl_profile_hooks): Remove hooks.

	* invoke.texi (-ftree-based-profiling, -fspeculative-prefetching): Kill.

	* inliner-1.c: Do not dump everything.
	* tree-prof.exp: Do not pass -ftree-based-profiling.
	* bprob.exp: Likewise.

From-SVN: r102522
This commit is contained in:
Jan Hubicka 2005-07-28 23:48:38 +02:00 committed by Jan Hubicka
parent c5a4444c50
commit 8a76829ccf
19 changed files with 117 additions and 1249 deletions

View File

@ -1,5 +1,43 @@
2005-07-28 Jan Hubicka <jh@suse.cz> 2005-07-28 Jan Hubicka <jh@suse.cz>
* Makefile.in (rtl-profile.o): Kill all traces of it.
* common.opt (fspeculative-prefetching, ftree-based-profiling): Kill.
* coverage.h (rtl_coverage_counter_ref): Kill.
* opts.c (flag_speculative_prefetching_set): Kill.
(flag_loop_optimize_set): New.
(common_handle_option): Disable loop optimizer when profiling;
do not handle speculative prefetching.
* passes.c (init_optimization_passes): Replace pass_profiling combo
by branch_prob pass.
* profile.c (compute_value_histograms): Update for simplified value
profiles.
(rtl_register_profile_hooks): Kill.
(pass_profiling): Kill.
(rest_of_handle_branch_prob): Do not profile.
* toplev.c (process_options): Remove speculative prefetching.
* toplev.h (flag_tree_based_profiling): Kill.
* tree-profile.c (prepare_instrumented_value,
tree_gen_interval_profiler, tree_gen_pow2_profiler,
tree_gen_one_value_profiler, do_tree_profiling): Update for
simplified datastructures.
* value-prof.c: Add comment that speculative prefetching was dropped;
update rest of file for simplified datastructures.
(NOPREFETCH_RANGE_MIN, NOPREFETCH_RANGE_MAX,
rtl_divmod_values_to_profile, insn_prefetch_values_to_profile,
find_mem_reference_1, find_mem_reference_2, find_mem_reference,
rtl_values_to_profile, rtl_divmod_fixed_value, rtl_mod_pow2,
rtl_mod_subtract, gen_speculative_prefetch,
rtl_divmod_fixed_value_transform, rtl_mod_pow2_value_transform,
rtl_mod_subtract_transform, speculative_prefetching_transform): Kill.
(gate_handle_value_profile_transformations,
rest_of_handle_value_profile_transformations,
pass_value_profile_transformations): Kill.
* value-prof.h (histogram_value_t): Remove IL based unions.
(rtl_register_value_prof_hooks, rtl_register_profile_hooks,
rtl_profile_hooks): Remove hooks.
* invoke.texi (-ftree-based-profiling, -fspeculative-prefetching): Kill.
* cgraph.c (cgraph_clone_edge): New UPDATE_ORIGINAL argument. * cgraph.c (cgraph_clone_edge): New UPDATE_ORIGINAL argument.
(cgraph_clone_node): Likewise. (cgraph_clone_node): Likewise.
* cgraph.h (cgraph_clone_edge): Update prototype. * cgraph.h (cgraph_clone_edge): Update prototype.

View File

@ -966,7 +966,7 @@ OBJS-common = \
targhooks.o timevar.o toplev.o tracer.o tree.o tree-dump.o \ targhooks.o timevar.o toplev.o tracer.o tree.o tree-dump.o \
varasm.o varray.o vec.o version.o vmsdbgout.o xcoffout.o alloc-pool.o \ varasm.o varray.o vec.o version.o vmsdbgout.o xcoffout.o alloc-pool.o \
et-forest.o cfghooks.o bt-load.o pretty-print.o $(GGC) web.o passes.o \ et-forest.o cfghooks.o bt-load.o pretty-print.o $(GGC) web.o passes.o \
rtl-profile.o tree-profile.o rtlhooks.o cfgexpand.o lambda-mat.o \ tree-profile.o rtlhooks.o cfgexpand.o lambda-mat.o \
lambda-trans.o lambda-code.o tree-loop-linear.o tree-ssa-sink.o \ lambda-trans.o lambda-code.o tree-loop-linear.o tree-ssa-sink.o \
tree-vrp.o tree-stdarg.o tree-cfgcleanup.o tree-ssa-reassoc.o \ tree-vrp.o tree-stdarg.o tree-cfgcleanup.o tree-ssa-reassoc.o \
tree-ssa-structalias.o tree-object-size.o tree-ssa-structalias.o tree-object-size.o
@ -2242,9 +2242,6 @@ tree-profile.o : tree-profile.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(RTL_H) $(TREE_H) $(FLAGS_H) output.h $(REGS_H) $(EXPR_H) \ $(TM_H) $(RTL_H) $(TREE_H) $(FLAGS_H) output.h $(REGS_H) $(EXPR_H) \
function.h toplev.h $(COVERAGE_H) $(TREE_H) value-prof.h $(TREE_DUMP_H) \ function.h toplev.h $(COVERAGE_H) $(TREE_H) value-prof.h $(TREE_DUMP_H) \
tree-pass.h $(TREE_FLOW_H) $(TIMEVAR_H) $(GGC_H) gt-tree-profile.h tree-pass.h $(TREE_FLOW_H) $(TIMEVAR_H) $(GGC_H) gt-tree-profile.h
rtl-profile.o : tree-profile.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(RTL_H) $(TREE_H) $(FLAGS_H) output.h $(REGS_H) $(EXPR_H) \
function.h toplev.h $(COVERAGE_H) value-prof.h $(GGC_H)
value-prof.o : value-prof.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ value-prof.o : value-prof.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(BASIC_BLOCK_H) hard-reg-set.h value-prof.h $(EXPR_H) output.h $(FLAGS_H) \ $(BASIC_BLOCK_H) hard-reg-set.h value-prof.h $(EXPR_H) output.h $(FLAGS_H) \
$(RECOG_H) insn-config.h $(OPTABS_H) $(REGS_H) $(GGC_H) $(DIAGNOSTIC_H) \ $(RECOG_H) insn-config.h $(OPTABS_H) $(REGS_H) $(GGC_H) $(DIAGNOSTIC_H) \
@ -2732,7 +2729,7 @@ GTFILES = $(srcdir)/input.h $(srcdir)/coretypes.h \
$(srcdir)/tree-iterator.c $(srcdir)/gimplify.c \ $(srcdir)/tree-iterator.c $(srcdir)/gimplify.c \
$(srcdir)/tree-chrec.h $(srcdir)/tree-vect-generic.c \ $(srcdir)/tree-chrec.h $(srcdir)/tree-vect-generic.c \
$(srcdir)/tree-ssa-operands.h $(srcdir)/tree-ssa-operands.c \ $(srcdir)/tree-ssa-operands.h $(srcdir)/tree-ssa-operands.c \
$(srcdir)/tree-profile.c $(srcdir)/rtl-profile.c $(srcdir)/tree-nested.c \ $(srcdir)/tree-profile.c $(srcdir)/tree-nested.c \
$(srcdir)/ipa-reference.c \ $(srcdir)/ipa-reference.c \
$(srcdir)/targhooks.c $(out_file) \ $(srcdir)/targhooks.c $(out_file) \
@all_gtfiles@ @all_gtfiles@

View File

@ -779,10 +779,6 @@ fsingle-precision-constant
Common Report Var(flag_single_precision_constant) Common Report Var(flag_single_precision_constant)
Convert floating point constants to single precision constants Convert floating point constants to single precision constants
fspeculative-prefetching
Common Report Var(flag_speculative_prefetching)
Use value profiling for speculative prefetching
fsplit-ivs-in-unroller fsplit-ivs-in-unroller
Common Report Var(flag_split_ivs_in_unroller) Init(1) Common Report Var(flag_split_ivs_in_unroller) Init(1)
Split lifetimes of induction variables when loops are unrolled Split lifetimes of induction variables when loops are unrolled
@ -863,10 +859,6 @@ ftrapv
Common Report Var(flag_trapv) Common Report Var(flag_trapv)
Trap for signed overflow in addition, subtraction and multiplication Trap for signed overflow in addition, subtraction and multiplication
ftree-based-profiling
Common Report Var(flag_tree_based_profiling)
Use tree-ssa based implementation of profiling
ftree-ccp ftree-ccp
Common Report Var(flag_tree_ccp) Common Report Var(flag_tree_ccp)
Enable SSA-CCP optimization on trees Enable SSA-CCP optimization on trees

View File

@ -410,32 +410,6 @@ coverage_counter_alloc (unsigned counter, unsigned num)
return 1; return 1;
} }
/* Generate a MEM rtl to access COUNTER NO. */
rtx
rtl_coverage_counter_ref (unsigned counter, unsigned no)
{
enum machine_mode mode = mode_for_size (GCOV_TYPE_SIZE, MODE_INT, 0);
rtx ref;
gcc_assert (no < fn_n_ctrs[counter] - fn_b_ctrs[counter]);
no += prg_n_ctrs[counter] + fn_b_ctrs[counter];
if (!ctr_labels[counter])
{
ctr_labels[counter] = gen_rtx_SYMBOL_REF (Pmode,
ggc_strdup (IDENTIFIER_POINTER (DECL_NAME
(tree_ctr_tables[counter]))));
SYMBOL_REF_FLAGS (ctr_labels[counter]) = SYMBOL_FLAG_LOCAL;
}
ref = plus_constant (ctr_labels[counter],
GCOV_TYPE_SIZE / BITS_PER_UNIT * no);
ref = gen_rtx_MEM (mode, ref);
set_mem_alias_set (ref, new_alias_set ());
MEM_NOTRAP_P (ref) = 1;
return ref;
}
/* Generate a tree to access COUNTER NO. */ /* Generate a tree to access COUNTER NO. */
tree tree

View File

@ -38,8 +38,6 @@ extern int coverage_begin_output (void);
/* Allocate some counters. Repeatable per function. */ /* Allocate some counters. Repeatable per function. */
extern int coverage_counter_alloc (unsigned /*counter*/, unsigned/*num*/); extern int coverage_counter_alloc (unsigned /*counter*/, unsigned/*num*/);
/* Use a counter from the most recent allocation. */ /* Use a counter from the most recent allocation. */
extern rtx rtl_coverage_counter_ref (unsigned /*counter*/, unsigned/*num*/);
/* Use a counter from the most recent allocation. */
extern tree tree_coverage_counter_ref (unsigned /*counter*/, unsigned/*num*/); extern tree tree_coverage_counter_ref (unsigned /*counter*/, unsigned/*num*/);
/* Get all the counters for the current function. */ /* Get all the counters for the current function. */

View File

@ -281,7 +281,7 @@ Objective-C and Objective-C++ Dialects}.
-ftree-vectorizer-verbose=@var{n} @gol -ftree-vectorizer-verbose=@var{n} @gol
-fdump-tree-storeccp@r{[}-@var{n}@r{]} @gol -fdump-tree-storeccp@r{[}-@var{n}@r{]} @gol
-feliminate-dwarf2-dups -feliminate-unused-debug-types @gol -feliminate-dwarf2-dups -feliminate-unused-debug-types @gol
-feliminate-unused-debug-symbols -fmem-report -fprofile-arcs -ftree-based-profiling @gol -feliminate-unused-debug-symbols -fmem-report -fprofile-arcs @gol
-frandom-seed=@var{string} -fsched-verbose=@var{n} @gol -frandom-seed=@var{string} -fsched-verbose=@var{n} @gol
-ftest-coverage -ftime-report -fvar-tracking @gol -ftest-coverage -ftime-report -fvar-tracking @gol
-g -g@var{level} -gcoff -gdwarf-2 @gol -g -g@var{level} -gcoff -gdwarf-2 @gol
@ -325,7 +325,7 @@ Objective-C and Objective-C++ Dialects}.
-fsched-stalled-insns=@var{n} -sched-stalled-insns-dep=@var{n} @gol -fsched-stalled-insns=@var{n} -sched-stalled-insns-dep=@var{n} @gol
-fsched2-use-superblocks @gol -fsched2-use-superblocks @gol
-fsched2-use-traces -freschedule-modulo-scheduled-loops @gol -fsched2-use-traces -freschedule-modulo-scheduled-loops @gol
-fsignaling-nans -fsingle-precision-constant -fspeculative-prefetching @gol -fsignaling-nans -fsingle-precision-constant @gol
-fstrength-reduce -fstrict-aliasing -ftracer -fthread-jumps @gol -fstrength-reduce -fstrict-aliasing -ftracer -fthread-jumps @gol
-funroll-all-loops -funroll-loops -fpeel-loops @gol -funroll-all-loops -funroll-loops -fpeel-loops @gol
-fsplit-ivs-in-unroller -funswitch-loops @gol -fsplit-ivs-in-unroller -funswitch-loops @gol
@ -3580,17 +3580,6 @@ executed. When an arc is the only exit or only entrance to a block, the
instrumentation code can be added to the block; otherwise, a new basic instrumentation code can be added to the block; otherwise, a new basic
block must be created to hold the instrumentation code. block must be created to hold the instrumentation code.
@item -ftree-based-profiling
@opindex ftree-based-profiling
This option is used in addition to @option{-fprofile-arcs} or
@option{-fbranch-probabilities} to control whether those optimizations
are performed on a tree-based or rtl-based internal representation.
If you use this option when compiling with @option{-fprofile-arcs},
you must also use it when compiling later with @option{-fbranch-probabilities}.
Currently the tree-based optimization is in an early stage of
development, and this option is recommended only for those people
working on improving it.
@need 2000 @need 2000
@item -ftest-coverage @item -ftest-coverage
@opindex ftest-coverage @opindex ftest-coverage
@ -5329,8 +5318,9 @@ The following options are enabled: @code{-fprofile-arcs}, @code{-fprofile-values
Enable profile feedback directed optimizations, and optimizations Enable profile feedback directed optimizations, and optimizations
generally profitable only with profile feedback available. generally profitable only with profile feedback available.
The following options are enabled: @code{-fbranch-probabilities}, The following options are enabled: @code{-fbranch-probabilities}, @code{-fvpt},
@code{-fvpt}, @code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer}. @code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer},
@code{-fno-loop-optimize}.
@end table @end table
@ -5527,23 +5517,6 @@ and actually performs the optimizations based on them.
Currently the optimizations include specialization of division operation Currently the optimizations include specialization of division operation
using the knowledge about the value of the denominator. using the knowledge about the value of the denominator.
@item -fspeculative-prefetching
@opindex fspeculative-prefetching
If combined with @option{-fprofile-arcs}, it instructs the compiler to add
a code to gather information about addresses of memory references in the
program.
With @option{-fbranch-probabilities}, it reads back the data gathered
and issues prefetch instructions according to them. In addition to the opportunities
noticed by @option{-fprefetch-loop-arrays}, it also notices more complicated
memory access patterns---for example accesses to the data stored in linked
list whose elements are usually allocated sequentially.
In order to prevent issuing double prefetches, usage of
@option{-fspeculative-prefetching} implies @option{-fno-prefetch-loop-arrays}.
Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
@item -frename-registers @item -frename-registers
@opindex frename-registers @opindex frename-registers
Attempt to avoid false dependencies in scheduled code by making use Attempt to avoid false dependencies in scheduled code by making use

View File

@ -94,8 +94,8 @@ static const char undocumented_msg[] = N_("This switch lacks documentation");
static bool profile_arc_flag_set, flag_profile_values_set; static bool profile_arc_flag_set, flag_profile_values_set;
static bool flag_unroll_loops_set, flag_tracer_set; static bool flag_unroll_loops_set, flag_tracer_set;
static bool flag_value_profile_transformations_set; static bool flag_value_profile_transformations_set;
bool flag_speculative_prefetching_set;
static bool flag_peel_loops_set, flag_branch_probabilities_set; static bool flag_peel_loops_set, flag_branch_probabilities_set;
static bool flag_loop_optimize_set;
/* Input file names. */ /* Input file names. */
const char **in_fnames; const char **in_fnames;
@ -807,6 +807,10 @@ common_handle_option (size_t scode, const char *arg, int value)
flag_branch_probabilities_set = true; flag_branch_probabilities_set = true;
break; break;
case OPT_floop_optimize:
flag_loop_optimize_set = true;
break;
case OPT_fcall_used_: case OPT_fcall_used_:
fix_register (arg, 0, 1); fix_register (arg, 0, 1);
break; break;
@ -883,10 +887,9 @@ common_handle_option (size_t scode, const char *arg, int value)
flag_tracer = value; flag_tracer = value;
if (!flag_value_profile_transformations_set) if (!flag_value_profile_transformations_set)
flag_value_profile_transformations = value; flag_value_profile_transformations = value;
#ifdef HAVE_prefetch /* Old loop optimizer is incompatible with tree profiling. */
if (0 && !flag_speculative_prefetching_set) if (!flag_loop_optimize_set)
flag_speculative_prefetching = value; flag_loop_optimize = 0;
#endif
break; break;
case OPT_fprofile_generate: case OPT_fprofile_generate:
@ -896,12 +899,6 @@ common_handle_option (size_t scode, const char *arg, int value)
flag_profile_values = value; flag_profile_values = value;
if (!flag_value_profile_transformations_set) if (!flag_value_profile_transformations_set)
flag_value_profile_transformations = value; flag_value_profile_transformations = value;
if (!flag_unroll_loops_set)
flag_unroll_loops = value;
#ifdef HAVE_prefetch
if (0 && !flag_speculative_prefetching_set)
flag_speculative_prefetching = value;
#endif
break; break;
case OPT_fprofile_values: case OPT_fprofile_values:
@ -927,10 +924,6 @@ common_handle_option (size_t scode, const char *arg, int value)
flag_value_profile_transformations_set = true; flag_value_profile_transformations_set = true;
break; break;
case OPT_fspeculative_prefetching:
flag_speculative_prefetching_set = true;
break;
case OPT_frandom_seed: case OPT_frandom_seed:
/* The real switch is -fno-random-seed. */ /* The real switch is -fno-random-seed. */
if (value) if (value)

View File

@ -600,7 +600,7 @@ init_optimization_passes (void)
NEXT_PASS (pass_loop_optimize); NEXT_PASS (pass_loop_optimize);
NEXT_PASS (pass_jump_bypass); NEXT_PASS (pass_jump_bypass);
NEXT_PASS (pass_cfg); NEXT_PASS (pass_cfg);
NEXT_PASS (pass_profiling); NEXT_PASS (pass_branch_prob);
NEXT_PASS (pass_rtl_ifcvt); NEXT_PASS (pass_rtl_ifcvt);
NEXT_PASS (pass_tracer); NEXT_PASS (pass_tracer);
/* Perform loop optimizations. It might be better to do them a bit /* Perform loop optimizations. It might be better to do them a bit
@ -624,12 +624,6 @@ init_optimization_passes (void)
NEXT_PASS (pass_postreload); NEXT_PASS (pass_postreload);
*p = NULL; *p = NULL;
p = &pass_profiling.sub;
NEXT_PASS (pass_branch_prob);
NEXT_PASS (pass_value_profile_transformations);
NEXT_PASS (pass_remove_death_notes);
*p = NULL;
p = &pass_postreload.sub; p = &pass_postreload.sub;
NEXT_PASS (pass_postreload_cse); NEXT_PASS (pass_postreload_cse);
NEXT_PASS (pass_gcse2); NEXT_PASS (pass_gcse2);

View File

@ -651,7 +651,7 @@ compute_value_histograms (histogram_values values)
gcov_type *histogram_counts[GCOV_N_VALUE_COUNTERS]; gcov_type *histogram_counts[GCOV_N_VALUE_COUNTERS];
gcov_type *act_count[GCOV_N_VALUE_COUNTERS]; gcov_type *act_count[GCOV_N_VALUE_COUNTERS];
gcov_type *aact_count; gcov_type *aact_count;
histogram_value hist; histogram_value hist = 0;
for (t = 0; t < GCOV_N_VALUE_COUNTERS; t++) for (t = 0; t < GCOV_N_VALUE_COUNTERS; t++)
n_histogram_counters[t] = 0; n_histogram_counters[t] = 0;
@ -683,7 +683,8 @@ compute_value_histograms (histogram_values values)
for (i = 0; i < VEC_length (histogram_value, values); i++) for (i = 0; i < VEC_length (histogram_value, values); i++)
{ {
rtx hist_list = NULL_RTX; tree stmt = hist->hvalue.stmt;
stmt_ann_t ann = get_stmt_ann (stmt);
hist = VEC_index (histogram_value, values, i); hist = VEC_index (histogram_value, values, i);
t = (int) hist->type; t = (int) hist->type;
@ -691,29 +692,12 @@ compute_value_histograms (histogram_values values)
aact_count = act_count[t]; aact_count = act_count[t];
act_count[t] += hist->n_counters; act_count[t] += hist->n_counters;
if (!ir_type ()) hist->hvalue.next = ann->histograms;
{ ann->histograms = hist;
for (j = hist->n_counters; j > 0; j--) hist->hvalue.counters =
hist_list = alloc_EXPR_LIST (0, GEN_INT (aact_count[j - 1]), xmalloc (sizeof (gcov_type) * hist->n_counters);
hist_list); for (j = 0; j < hist->n_counters; j++)
hist_list = alloc_EXPR_LIST (0, hist->hvalue.counters[j] = aact_count[j];
copy_rtx (hist->hvalue.rtl.value), hist_list);
hist_list = alloc_EXPR_LIST (0, GEN_INT (hist->type), hist_list);
REG_NOTES (hist->hvalue.rtl.insn) =
alloc_EXPR_LIST (REG_VALUE_PROFILE, hist_list,
REG_NOTES (hist->hvalue.rtl.insn));
}
else
{
tree stmt = hist->hvalue.tree.stmt;
stmt_ann_t ann = get_stmt_ann (stmt);
hist->hvalue.tree.next = ann->histograms;
ann->histograms = hist;
hist->hvalue.tree.counters =
xmalloc (sizeof (gcov_type) * hist->n_counters);
for (j = 0; j < hist->n_counters; j++)
hist->hvalue.tree.counters[j] = aact_count[j];
}
} }
for (t = 0; t < GCOV_N_VALUE_COUNTERS; t++) for (t = 0; t < GCOV_N_VALUE_COUNTERS; t++)
@ -1324,55 +1308,13 @@ tree_register_profile_hooks (void)
profile_hooks = &tree_profile_hooks; profile_hooks = &tree_profile_hooks;
} }
/* Set up hooks to enable RTL-based profiling. */
void
rtl_register_profile_hooks (void)
{
gcc_assert (!ir_type ());
profile_hooks = &rtl_profile_hooks;
}
static bool
gate_handle_profiling (void)
{
return optimize > 0
|| (!flag_tree_based_profiling
&& (profile_arc_flag || flag_test_coverage
|| flag_branch_probabilities));
}
struct tree_opt_pass pass_profiling =
{
NULL, /* name */
gate_handle_profiling, /* gate */
NULL, /* execute */
NULL, /* sub */
NULL, /* next */
0, /* static_pass_number */
0, /* tv_id */
0, /* properties_required */
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
0, /* todo_flags_finish */
0 /* letter */
};
/* Do branch profiling and static profile estimation passes. */ /* Do branch profiling and static profile estimation passes. */
static void static void
rest_of_handle_branch_prob (void) rest_of_handle_branch_prob (void)
{ {
struct loops loops; struct loops loops;
rtl_register_profile_hooks ();
rtl_register_value_prof_hooks ();
if ((profile_arc_flag || flag_test_coverage || flag_branch_probabilities)
&& !flag_tree_based_profiling)
branch_prob ();
/* Discover and record the loop depth at the head of each basic /* Discover and record the loop depth at the head of each basic
block. The loop infrastructure does the real job for us. */ block. The loop infrastructure does the real job for us. */
flow_loops_find (&loops); flow_loops_find (&loops);
@ -1382,8 +1324,7 @@ rest_of_handle_branch_prob (void)
/* Estimate using heuristics if no profiling info is available. */ /* Estimate using heuristics if no profiling info is available. */
if (flag_guess_branch_prob if (flag_guess_branch_prob
&& (profile_status == PROFILE_ABSENT && profile_status == PROFILE_ABSENT)
|| (profile_status == PROFILE_READ && !flag_tree_based_profiling)))
estimate_probability (&loops); estimate_probability (&loops);
flow_loops_free (&loops); flow_loops_free (&loops);

View File

@ -1,5 +1,9 @@
2005-07-28 Jan Hubicka <jh@suse.cz> 2005-07-28 Jan Hubicka <jh@suse.cz>
* inliner-1.c: Do not dump everything.
* tree-prof.exp: Do not pass -ftree-based-profiling.
* bprob.exp: Likewise.
* gcc.dg/tree-prof/update-loopch.c: Fix thinkos. * gcc.dg/tree-prof/update-loopch.c: Fix thinkos.
2005-07-28 Mark Mitchell <mark@codesourcery.com> 2005-07-28 Mark Mitchell <mark@codesourcery.com>

View File

@ -52,10 +52,6 @@ load_lib profopt.exp
set profile_options "-fprofile-arcs" set profile_options "-fprofile-arcs"
set feedback_options "-fbranch-probabilities" set feedback_options "-fbranch-probabilities"
if {[check_profiling_available "-ftree-based-profiling"]} {
lappend profile_options "-ftree-based-profiling -fprofile-arcs"
lappend feedback_options "-ftree-based-profiling -fbranch-probabilities"
}
# Main loop. # Main loop.
foreach profile_option $profile_options feedback_option $feedback_options { foreach profile_option $profile_options feedback_option $feedback_options {

View File

@ -1,4 +1,4 @@
/* { dg-options "-O2 -fdump-tree-optimized -fdump-tree-all" } */ /* { dg-options "-O2 -fdump-tree-optimized" } */
int a; int a;
int b[100]; int b[100];
void abort (void); void abort (void);

View File

@ -20,7 +20,7 @@
load_lib target-supports.exp load_lib target-supports.exp
# Some targets don't support tree profiling. # Some targets don't support tree profiling.
if { ![check_profiling_available "-ftree-based-profiling"] } { if { ![check_profiling_available ""] } {
return return
} }
@ -41,8 +41,8 @@ load_lib profopt.exp
# These are globals used by profopt-execute. The first is options # These are globals used by profopt-execute. The first is options
# needed to generate profile data, the second is options to use the # needed to generate profile data, the second is options to use the
# profile data. # profile data.
set profile_option "-ftree-based-profiling -fprofile-generate" set profile_option "-fprofile-generate"
set feedback_option "-ftree-based-profiling -fprofile-use" set feedback_option "-fprofile-use"
foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.c]] { foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.c]] {
# If we're only testing specific files and this isn't one of them, skip it. # If we're only testing specific files and this isn't one of them, skip it.

View File

@ -49,10 +49,6 @@ load_lib profopt.exp
set profile_options "-fprofile-arcs" set profile_options "-fprofile-arcs"
set feedback_options "-fbranch-probabilities" set feedback_options "-fbranch-probabilities"
if {[check_profiling_available "-ftree-based-profiling"]} {
lappend profile_options "-ftree-based-profiling -fprofile-arcs"
lappend feedback_options "-ftree-based-profiling -fbranch-probabilities"
}
foreach profile_option $profile_options feedback_option $feedback_options { foreach profile_option $profile_options feedback_option $feedback_options {
foreach src [lsort [glob -nocomplain $srcdir/$subdir/bprob-*.c]] { foreach src [lsort [glob -nocomplain $srcdir/$subdir/bprob-*.c]] {

View File

@ -1562,17 +1562,6 @@ process_options (void)
if (flag_value_profile_transformations) if (flag_value_profile_transformations)
flag_profile_values = 1; flag_profile_values = 1;
/* Speculative prefetching implies the value profiling. We also switch off
the prefetching in the loop optimizer, so that we do not emit double
prefetches. TODO -- we should teach these two to cooperate; the loop
based prefetching may sometimes do a better job, especially in connection
with reuse analysis. */
if (flag_speculative_prefetching)
{
flag_profile_values = 1;
flag_prefetch_loop_arrays = 0;
}
/* Warn about options that are not supported on this machine. */ /* Warn about options that are not supported on this machine. */
#ifndef INSN_SCHEDULING #ifndef INSN_SCHEDULING
if (flag_schedule_insns || flag_schedule_insns_after_reload) if (flag_schedule_insns || flag_schedule_insns_after_reload)
@ -1732,24 +1721,12 @@ process_options (void)
warning (0, "-fprefetch-loop-arrays not supported for this target"); warning (0, "-fprefetch-loop-arrays not supported for this target");
flag_prefetch_loop_arrays = 0; flag_prefetch_loop_arrays = 0;
} }
if (flag_speculative_prefetching)
{
if (flag_speculative_prefetching_set)
warning (0, "-fspeculative-prefetching not supported for this target");
flag_speculative_prefetching = 0;
}
#else #else
if (flag_prefetch_loop_arrays && !HAVE_prefetch) if (flag_prefetch_loop_arrays && !HAVE_prefetch)
{ {
warning (0, "-fprefetch-loop-arrays not supported for this target (try -march switches)"); warning (0, "-fprefetch-loop-arrays not supported for this target (try -march switches)");
flag_prefetch_loop_arrays = 0; flag_prefetch_loop_arrays = 0;
} }
if (flag_speculative_prefetching && !HAVE_prefetch)
{
if (flag_speculative_prefetching_set)
warning (0, "-fspeculative-prefetching not supported for this target (try -march switches)");
flag_speculative_prefetching = 0;
}
#endif #endif
/* This combination of options isn't handled for i386 targets and doesn't /* This combination of options isn't handled for i386 targets and doesn't

View File

@ -128,7 +128,6 @@ extern int flag_unroll_all_loops;
extern int flag_unswitch_loops; extern int flag_unswitch_loops;
extern int flag_cprop_registers; extern int flag_cprop_registers;
extern int time_report; extern int time_report;
extern int flag_tree_based_profiling;
/* Things to do with target switches. */ /* Things to do with target switches. */
extern void print_version (FILE *, const char *); extern void print_version (FILE *, const char *);

View File

@ -123,7 +123,7 @@ static tree
prepare_instrumented_value (block_stmt_iterator *bsi, prepare_instrumented_value (block_stmt_iterator *bsi,
histogram_value value) histogram_value value)
{ {
tree val = value->hvalue.tree.value; tree val = value->hvalue.value;
return force_gimple_operand_bsi (bsi, fold_convert (gcov_type_node, val), return force_gimple_operand_bsi (bsi, fold_convert (gcov_type_node, val),
true, NULL_TREE); true, NULL_TREE);
} }
@ -135,7 +135,7 @@ prepare_instrumented_value (block_stmt_iterator *bsi,
static void static void
tree_gen_interval_profiler (histogram_value value, unsigned tag, unsigned base) tree_gen_interval_profiler (histogram_value value, unsigned tag, unsigned base)
{ {
tree stmt = value->hvalue.tree.stmt; tree stmt = value->hvalue.stmt;
block_stmt_iterator bsi = bsi_for_stmt (stmt); block_stmt_iterator bsi = bsi_for_stmt (stmt);
tree ref = tree_coverage_counter_ref (tag, base), ref_ptr; tree ref = tree_coverage_counter_ref (tag, base), ref_ptr;
tree args, call, val; tree args, call, val;
@ -162,7 +162,7 @@ tree_gen_interval_profiler (histogram_value value, unsigned tag, unsigned base)
static void static void
tree_gen_pow2_profiler (histogram_value value, unsigned tag, unsigned base) tree_gen_pow2_profiler (histogram_value value, unsigned tag, unsigned base)
{ {
tree stmt = value->hvalue.tree.stmt; tree stmt = value->hvalue.stmt;
block_stmt_iterator bsi = bsi_for_stmt (stmt); block_stmt_iterator bsi = bsi_for_stmt (stmt);
tree ref = tree_coverage_counter_ref (tag, base), ref_ptr; tree ref = tree_coverage_counter_ref (tag, base), ref_ptr;
tree args, call, val; tree args, call, val;
@ -185,7 +185,7 @@ tree_gen_pow2_profiler (histogram_value value, unsigned tag, unsigned base)
static void static void
tree_gen_one_value_profiler (histogram_value value, unsigned tag, unsigned base) tree_gen_one_value_profiler (histogram_value value, unsigned tag, unsigned base)
{ {
tree stmt = value->hvalue.tree.stmt; tree stmt = value->hvalue.stmt;
block_stmt_iterator bsi = bsi_for_stmt (stmt); block_stmt_iterator bsi = bsi_for_stmt (stmt);
tree ref = tree_coverage_counter_ref (tag, base), ref_ptr; tree ref = tree_coverage_counter_ref (tag, base), ref_ptr;
tree args, call, val; tree args, call, val;
@ -225,8 +225,7 @@ tree_gen_const_delta_profiler (histogram_value value ATTRIBUTE_UNUSED,
static bool static bool
do_tree_profiling (void) do_tree_profiling (void)
{ {
if (flag_tree_based_profiling if (profile_arc_flag || flag_test_coverage || flag_branch_probabilities)
&& (profile_arc_flag || flag_test_coverage || flag_branch_probabilities))
{ {
tree_register_profile_hooks (); tree_register_profile_hooks ();
tree_register_value_prof_hooks (); tree_register_value_prof_hooks ();

File diff suppressed because it is too large Load Diff

View File

@ -40,22 +40,12 @@ enum hist_type
/* The value to measure. */ /* The value to measure. */
struct histogram_value_t struct histogram_value_t
{ {
union struct
{ {
struct tree value; /* The value to profile. */
{ tree stmt; /* Insn containing the value. */
rtx value; /* The value to profile. */ gcov_type *counters; /* Pointer to first counter. */
rtx seq; /* Insns required to count the profiled value. */ struct histogram_value_t *next; /* Linked list pointer. */
rtx insn; /* Insn before that to measure. */
enum machine_mode mode; /* Mode of value to profile. */
} rtl;
struct
{
tree value; /* The value to profile. */
tree stmt; /* Insn containing the value. */
gcov_type *counters; /* Pointer to first counter. */
struct histogram_value_t *next; /* Linked list pointer. */
} tree;
} hvalue; } hvalue;
enum hist_type type; /* Type of information to measure. */ enum hist_type type; /* Type of information to measure. */
unsigned n_counters; /* Number of required counters. */ unsigned n_counters; /* Number of required counters. */
@ -77,7 +67,6 @@ DEF_VEC_ALLOC_P(histogram_value,heap);
typedef VEC(histogram_value,heap) *histogram_values; typedef VEC(histogram_value,heap) *histogram_values;
/* Hooks registration. */ /* Hooks registration. */
extern void rtl_register_value_prof_hooks (void);
extern void tree_register_value_prof_hooks (void); extern void tree_register_value_prof_hooks (void);
/* IR-independent entry points. */ /* IR-independent entry points. */
@ -113,13 +102,9 @@ extern void init_branch_prob (void);
extern void branch_prob (void); extern void branch_prob (void);
extern void end_branch_prob (void); extern void end_branch_prob (void);
extern void tree_register_profile_hooks (void); extern void tree_register_profile_hooks (void);
extern void rtl_register_profile_hooks (void);
/* In tree-profile.c. */ /* In tree-profile.c. */
extern struct profile_hooks tree_profile_hooks; extern struct profile_hooks tree_profile_hooks;
/* In rtl-profile.c. */
extern struct profile_hooks rtl_profile_hooks;
#endif /* GCC_VALUE_PROF_H */ #endif /* GCC_VALUE_PROF_H */