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:
parent
c5a4444c50
commit
8a76829ccf
|
@ -1,5 +1,43 @@
|
|||
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_clone_node): Likewise.
|
||||
* cgraph.h (cgraph_clone_edge): Update prototype.
|
||||
|
|
|
@ -966,7 +966,7 @@ OBJS-common = \
|
|||
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 \
|
||||
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 \
|
||||
tree-vrp.o tree-stdarg.o tree-cfgcleanup.o tree-ssa-reassoc.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) \
|
||||
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
|
||||
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) \
|
||||
$(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) \
|
||||
|
@ -2732,7 +2729,7 @@ GTFILES = $(srcdir)/input.h $(srcdir)/coretypes.h \
|
|||
$(srcdir)/tree-iterator.c $(srcdir)/gimplify.c \
|
||||
$(srcdir)/tree-chrec.h $(srcdir)/tree-vect-generic.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)/targhooks.c $(out_file) \
|
||||
@all_gtfiles@
|
||||
|
|
|
@ -779,10 +779,6 @@ fsingle-precision-constant
|
|||
Common Report Var(flag_single_precision_constant)
|
||||
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
|
||||
Common Report Var(flag_split_ivs_in_unroller) Init(1)
|
||||
Split lifetimes of induction variables when loops are unrolled
|
||||
|
@ -863,10 +859,6 @@ ftrapv
|
|||
Common Report Var(flag_trapv)
|
||||
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
|
||||
Common Report Var(flag_tree_ccp)
|
||||
Enable SSA-CCP optimization on trees
|
||||
|
|
|
@ -410,32 +410,6 @@ coverage_counter_alloc (unsigned counter, unsigned num)
|
|||
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. */
|
||||
|
||||
tree
|
||||
|
|
|
@ -38,8 +38,6 @@ extern int coverage_begin_output (void);
|
|||
/* Allocate some counters. Repeatable per function. */
|
||||
extern int coverage_counter_alloc (unsigned /*counter*/, unsigned/*num*/);
|
||||
/* 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*/);
|
||||
|
||||
/* Get all the counters for the current function. */
|
||||
|
|
|
@ -281,7 +281,7 @@ Objective-C and Objective-C++ Dialects}.
|
|||
-ftree-vectorizer-verbose=@var{n} @gol
|
||||
-fdump-tree-storeccp@r{[}-@var{n}@r{]} @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
|
||||
-ftest-coverage -ftime-report -fvar-tracking @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
|
||||
-fsched2-use-superblocks @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
|
||||
-funroll-all-loops -funroll-loops -fpeel-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
|
||||
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
|
||||
@item -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
|
||||
generally profitable only with profile feedback available.
|
||||
|
||||
The following options are enabled: @code{-fbranch-probabilities},
|
||||
@code{-fvpt}, @code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer}.
|
||||
The following options are enabled: @code{-fbranch-probabilities}, @code{-fvpt},
|
||||
@code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer},
|
||||
@code{-fno-loop-optimize}.
|
||||
|
||||
@end table
|
||||
|
||||
|
@ -5527,23 +5517,6 @@ and actually performs the optimizations based on them.
|
|||
Currently the optimizations include specialization of division operation
|
||||
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
|
||||
@opindex frename-registers
|
||||
Attempt to avoid false dependencies in scheduled code by making use
|
||||
|
|
23
gcc/opts.c
23
gcc/opts.c
|
@ -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 flag_unroll_loops_set, flag_tracer_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_loop_optimize_set;
|
||||
|
||||
/* Input file names. */
|
||||
const char **in_fnames;
|
||||
|
@ -807,6 +807,10 @@ common_handle_option (size_t scode, const char *arg, int value)
|
|||
flag_branch_probabilities_set = true;
|
||||
break;
|
||||
|
||||
case OPT_floop_optimize:
|
||||
flag_loop_optimize_set = true;
|
||||
break;
|
||||
|
||||
case OPT_fcall_used_:
|
||||
fix_register (arg, 0, 1);
|
||||
break;
|
||||
|
@ -883,10 +887,9 @@ common_handle_option (size_t scode, const char *arg, int value)
|
|||
flag_tracer = value;
|
||||
if (!flag_value_profile_transformations_set)
|
||||
flag_value_profile_transformations = value;
|
||||
#ifdef HAVE_prefetch
|
||||
if (0 && !flag_speculative_prefetching_set)
|
||||
flag_speculative_prefetching = value;
|
||||
#endif
|
||||
/* Old loop optimizer is incompatible with tree profiling. */
|
||||
if (!flag_loop_optimize_set)
|
||||
flag_loop_optimize = 0;
|
||||
break;
|
||||
|
||||
case OPT_fprofile_generate:
|
||||
|
@ -896,12 +899,6 @@ common_handle_option (size_t scode, const char *arg, int value)
|
|||
flag_profile_values = value;
|
||||
if (!flag_value_profile_transformations_set)
|
||||
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;
|
||||
|
||||
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;
|
||||
break;
|
||||
|
||||
case OPT_fspeculative_prefetching:
|
||||
flag_speculative_prefetching_set = true;
|
||||
break;
|
||||
|
||||
case OPT_frandom_seed:
|
||||
/* The real switch is -fno-random-seed. */
|
||||
if (value)
|
||||
|
|
|
@ -600,7 +600,7 @@ init_optimization_passes (void)
|
|||
NEXT_PASS (pass_loop_optimize);
|
||||
NEXT_PASS (pass_jump_bypass);
|
||||
NEXT_PASS (pass_cfg);
|
||||
NEXT_PASS (pass_profiling);
|
||||
NEXT_PASS (pass_branch_prob);
|
||||
NEXT_PASS (pass_rtl_ifcvt);
|
||||
NEXT_PASS (pass_tracer);
|
||||
/* Perform loop optimizations. It might be better to do them a bit
|
||||
|
@ -624,12 +624,6 @@ init_optimization_passes (void)
|
|||
NEXT_PASS (pass_postreload);
|
||||
*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;
|
||||
NEXT_PASS (pass_postreload_cse);
|
||||
NEXT_PASS (pass_gcse2);
|
||||
|
|
|
@ -651,7 +651,7 @@ compute_value_histograms (histogram_values values)
|
|||
gcov_type *histogram_counts[GCOV_N_VALUE_COUNTERS];
|
||||
gcov_type *act_count[GCOV_N_VALUE_COUNTERS];
|
||||
gcov_type *aact_count;
|
||||
histogram_value hist;
|
||||
histogram_value hist = 0;
|
||||
|
||||
for (t = 0; t < GCOV_N_VALUE_COUNTERS; t++)
|
||||
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++)
|
||||
{
|
||||
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);
|
||||
t = (int) hist->type;
|
||||
|
@ -691,29 +692,12 @@ compute_value_histograms (histogram_values values)
|
|||
aact_count = act_count[t];
|
||||
act_count[t] += hist->n_counters;
|
||||
|
||||
if (!ir_type ())
|
||||
{
|
||||
for (j = hist->n_counters; j > 0; j--)
|
||||
hist_list = alloc_EXPR_LIST (0, GEN_INT (aact_count[j - 1]),
|
||||
hist_list);
|
||||
hist_list = alloc_EXPR_LIST (0,
|
||||
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];
|
||||
}
|
||||
hist->hvalue.next = ann->histograms;
|
||||
ann->histograms = hist;
|
||||
hist->hvalue.counters =
|
||||
xmalloc (sizeof (gcov_type) * hist->n_counters);
|
||||
for (j = 0; j < hist->n_counters; j++)
|
||||
hist->hvalue.counters[j] = aact_count[j];
|
||||
}
|
||||
|
||||
for (t = 0; t < GCOV_N_VALUE_COUNTERS; t++)
|
||||
|
@ -1324,55 +1308,13 @@ tree_register_profile_hooks (void)
|
|||
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. */
|
||||
static void
|
||||
rest_of_handle_branch_prob (void)
|
||||
{
|
||||
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
|
||||
block. The loop infrastructure does the real job for us. */
|
||||
flow_loops_find (&loops);
|
||||
|
@ -1382,8 +1324,7 @@ rest_of_handle_branch_prob (void)
|
|||
|
||||
/* Estimate using heuristics if no profiling info is available. */
|
||||
if (flag_guess_branch_prob
|
||||
&& (profile_status == PROFILE_ABSENT
|
||||
|| (profile_status == PROFILE_READ && !flag_tree_based_profiling)))
|
||||
&& profile_status == PROFILE_ABSENT)
|
||||
estimate_probability (&loops);
|
||||
|
||||
flow_loops_free (&loops);
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
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.
|
||||
|
||||
2005-07-28 Mark Mitchell <mark@codesourcery.com>
|
||||
|
|
|
@ -52,10 +52,6 @@ load_lib profopt.exp
|
|||
|
||||
set profile_options "-fprofile-arcs"
|
||||
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.
|
||||
foreach profile_option $profile_options feedback_option $feedback_options {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* { dg-options "-O2 -fdump-tree-optimized -fdump-tree-all" } */
|
||||
/* { dg-options "-O2 -fdump-tree-optimized" } */
|
||||
int a;
|
||||
int b[100];
|
||||
void abort (void);
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
load_lib target-supports.exp
|
||||
|
||||
# Some targets don't support tree profiling.
|
||||
if { ![check_profiling_available "-ftree-based-profiling"] } {
|
||||
if { ![check_profiling_available ""] } {
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -41,8 +41,8 @@ load_lib profopt.exp
|
|||
# These are globals used by profopt-execute. The first is options
|
||||
# needed to generate profile data, the second is options to use the
|
||||
# profile data.
|
||||
set profile_option "-ftree-based-profiling -fprofile-generate"
|
||||
set feedback_option "-ftree-based-profiling -fprofile-use"
|
||||
set profile_option "-fprofile-generate"
|
||||
set feedback_option "-fprofile-use"
|
||||
|
||||
foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.c]] {
|
||||
# If we're only testing specific files and this isn't one of them, skip it.
|
||||
|
|
|
@ -49,10 +49,6 @@ load_lib profopt.exp
|
|||
|
||||
set profile_options "-fprofile-arcs"
|
||||
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 src [lsort [glob -nocomplain $srcdir/$subdir/bprob-*.c]] {
|
||||
|
|
23
gcc/toplev.c
23
gcc/toplev.c
|
@ -1562,17 +1562,6 @@ process_options (void)
|
|||
if (flag_value_profile_transformations)
|
||||
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. */
|
||||
#ifndef INSN_SCHEDULING
|
||||
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");
|
||||
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
|
||||
if (flag_prefetch_loop_arrays && !HAVE_prefetch)
|
||||
{
|
||||
warning (0, "-fprefetch-loop-arrays not supported for this target (try -march switches)");
|
||||
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
|
||||
|
||||
/* This combination of options isn't handled for i386 targets and doesn't
|
||||
|
|
|
@ -128,7 +128,6 @@ extern int flag_unroll_all_loops;
|
|||
extern int flag_unswitch_loops;
|
||||
extern int flag_cprop_registers;
|
||||
extern int time_report;
|
||||
extern int flag_tree_based_profiling;
|
||||
|
||||
/* Things to do with target switches. */
|
||||
extern void print_version (FILE *, const char *);
|
||||
|
|
|
@ -123,7 +123,7 @@ static tree
|
|||
prepare_instrumented_value (block_stmt_iterator *bsi,
|
||||
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),
|
||||
true, NULL_TREE);
|
||||
}
|
||||
|
@ -135,7 +135,7 @@ prepare_instrumented_value (block_stmt_iterator *bsi,
|
|||
static void
|
||||
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);
|
||||
tree ref = tree_coverage_counter_ref (tag, base), ref_ptr;
|
||||
tree args, call, val;
|
||||
|
@ -162,7 +162,7 @@ tree_gen_interval_profiler (histogram_value value, unsigned tag, unsigned base)
|
|||
static void
|
||||
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);
|
||||
tree ref = tree_coverage_counter_ref (tag, base), ref_ptr;
|
||||
tree args, call, val;
|
||||
|
@ -185,7 +185,7 @@ tree_gen_pow2_profiler (histogram_value value, unsigned tag, unsigned base)
|
|||
static void
|
||||
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);
|
||||
tree ref = tree_coverage_counter_ref (tag, base), ref_ptr;
|
||||
tree args, call, val;
|
||||
|
@ -225,8 +225,7 @@ tree_gen_const_delta_profiler (histogram_value value ATTRIBUTE_UNUSED,
|
|||
static bool
|
||||
do_tree_profiling (void)
|
||||
{
|
||||
if (flag_tree_based_profiling
|
||||
&& (profile_arc_flag || flag_test_coverage || flag_branch_probabilities))
|
||||
if (profile_arc_flag || flag_test_coverage || flag_branch_probabilities)
|
||||
{
|
||||
tree_register_profile_hooks ();
|
||||
tree_register_value_prof_hooks ();
|
||||
|
|
1058
gcc/value-prof.c
1058
gcc/value-prof.c
File diff suppressed because it is too large
Load Diff
|
@ -40,22 +40,12 @@ enum hist_type
|
|||
/* The value to measure. */
|
||||
struct histogram_value_t
|
||||
{
|
||||
union
|
||||
struct
|
||||
{
|
||||
struct
|
||||
{
|
||||
rtx value; /* The value to profile. */
|
||||
rtx seq; /* Insns required to count the profiled value. */
|
||||
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;
|
||||
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. */
|
||||
} hvalue;
|
||||
enum hist_type type; /* Type of information to measure. */
|
||||
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;
|
||||
|
||||
/* Hooks registration. */
|
||||
extern void rtl_register_value_prof_hooks (void);
|
||||
extern void tree_register_value_prof_hooks (void);
|
||||
|
||||
/* IR-independent entry points. */
|
||||
|
@ -113,13 +102,9 @@ extern void init_branch_prob (void);
|
|||
extern void branch_prob (void);
|
||||
extern void end_branch_prob (void);
|
||||
extern void tree_register_profile_hooks (void);
|
||||
extern void rtl_register_profile_hooks (void);
|
||||
|
||||
/* In tree-profile.c. */
|
||||
extern struct profile_hooks tree_profile_hooks;
|
||||
|
||||
/* In rtl-profile.c. */
|
||||
extern struct profile_hooks rtl_profile_hooks;
|
||||
|
||||
#endif /* GCC_VALUE_PROF_H */
|
||||
|
||||
|
|
Loading…
Reference in New Issue