summaryrefslogtreecommitdiff
path: root/gcc/rtl-profile.c
diff options
context:
space:
mode:
authorrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>2004-09-01 20:58:55 +0000
committerrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>2004-09-01 20:58:55 +0000
commit8a5df2ceff755c1f799239f751f78e87cbfdcb36 (patch)
tree4f8dfeb1abc654e971b9c4f5130e5a5bacce5cbb /gcc/rtl-profile.c
parent04dc1cf6bb818bdcb404f1e991e5377a39dfee2f (diff)
downloadgcc-8a5df2ceff755c1f799239f751f78e87cbfdcb36.tar.gz
* Makefile.in (rtl-profile.o, value-prof.o): Add GCC_H dependency.
* common.opt (fspeculative-prefetching): New. * flags.h (flag_speculative_prefetching_set): Declare. * gcov-io.c (gcov_write_counter, gcov_read_counter): Allow negative values. * opts.c (flag_sepculative_prefetching_set): New variable. (common_handle_option): Handle -fspeculative-prefetching. * passes.c (rest_of_compilation): Ditto. * profile.c (instrument_values, compute_value_histograms, branch_prob): Use vectors instead of arrays. * toplev.c (process_options): Handle -fspeculative-prefetching. * rtl-profile.c: Include ggc.h. (rtl_gen_interval_profiler, rtl_gen_pow2_profiler, rtl_gen_one_value_profiler_no_edge_manipulation, rtl_gen_one_value_profiler, rtl_gen_const_delta_profiler): Type of argument changed. * tree-profile.c (tree_gen_interval_profiler, tree_gen_pow2_profiler, tree_gen_one_value_profiler, tree_gen_const_delta_profiler): Type of argument changed. * value-prof.c: Include ggc.h. (NOPREFETCH_RANGE_MIN, NOPREFETCH_RANGE_MAX): New macros. (insn_prefetch_values_to_profile, find_mem_reference_1, find_mem_reference_2, find_mem_reference, gen_speculative_prefetch, speculative_prefetching_transform): New. (value_profile_transformations): Call speculative_prefetching_transform. (insn_values_to_profile): Call insn_prefetch_values_to_profile. (insn_divmod_values_to_profile, rtl_find_values_to_profile, tree_find_values_to_profile, find_values to profile): Use vectors instead of arrays. (free_profiled_values): Removed. * value-prof.h (struct histogram_value): Renamed to struct histogram_value_t. (histogram_value, histogram_values): New types. (find_values_to_profile): Declaration changed. (free_profiled_values): Removed. (struct profile_hooks): Type of argument of the hooks changed to histogram_value. * doc/invoke.texi (-fspeculative-prefetching): Document. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@86930 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/rtl-profile.c')
-rw-r--r--gcc/rtl-profile.c34
1 files changed, 16 insertions, 18 deletions
diff --git a/gcc/rtl-profile.c b/gcc/rtl-profile.c
index a53a00464a9..2d0c69ccb91 100644
--- a/gcc/rtl-profile.c
+++ b/gcc/rtl-profile.c
@@ -62,6 +62,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "coverage.h"
#include "value-prof.h"
#include "tree.h"
+#include "ggc.h"
/* Output instructions as RTL to increment the edge execution count. */
@@ -93,8 +94,7 @@ rtl_gen_edge_profiler (int edgeno, edge e)
section for counters, BASE is offset of the counter position. */
static void
-rtl_gen_interval_profiler (struct histogram_value *value, unsigned tag,
- unsigned base)
+rtl_gen_interval_profiler (histogram_value value, unsigned tag, unsigned base)
{
unsigned gcov_size = tree_low_cst (TYPE_SIZE (GCOV_TYPE_NODE), 1);
enum machine_mode mode = mode_for_size (gcov_size, MODE_INT, 0);
@@ -196,8 +196,7 @@ rtl_gen_interval_profiler (struct histogram_value *value, unsigned tag,
section for counters, BASE is offset of the counter position. */
static void
-rtl_gen_pow2_profiler (struct histogram_value *value, unsigned tag,
- unsigned base)
+rtl_gen_pow2_profiler (histogram_value value, unsigned tag, unsigned base)
{
unsigned gcov_size = tree_low_cst (TYPE_SIZE (GCOV_TYPE_NODE), 1);
enum machine_mode mode = mode_for_size (gcov_size, MODE_INT, 0);
@@ -272,8 +271,8 @@ rtl_gen_pow2_profiler (struct histogram_value *value, unsigned tag,
section for counters, BASE is offset of the counter position. */
static rtx
-rtl_gen_one_value_profiler_no_edge_manipulation (struct histogram_value *value,
- unsigned tag, unsigned base)
+rtl_gen_one_value_profiler_no_edge_manipulation (histogram_value value,
+ unsigned tag, unsigned base)
{
unsigned gcov_size = tree_low_cst (TYPE_SIZE (GCOV_TYPE_NODE), 1);
enum machine_mode mode = mode_for_size (gcov_size, MODE_INT, 0);
@@ -351,8 +350,7 @@ rtl_gen_one_value_profiler_no_edge_manipulation (struct histogram_value *value,
section for counters, BASE is offset of the counter position. */
static void
-rtl_gen_one_value_profiler (struct histogram_value *value, unsigned tag,
- unsigned base)
+rtl_gen_one_value_profiler (histogram_value value, unsigned tag, unsigned base)
{
edge e = split_block (BLOCK_FOR_INSN ((rtx)value->insn),
PREV_INSN ((rtx)value->insn));
@@ -368,10 +366,9 @@ rtl_gen_one_value_profiler (struct histogram_value *value, unsigned tag,
section for counters, BASE is offset of the counter position. */
static void
-rtl_gen_const_delta_profiler (struct histogram_value *value, unsigned tag,
- unsigned base)
+rtl_gen_const_delta_profiler (histogram_value value, unsigned tag, unsigned base)
{
- struct histogram_value one_value_delta;
+ histogram_value one_value_delta;
unsigned gcov_size = tree_low_cst (TYPE_SIZE (GCOV_TYPE_NODE), 1);
enum machine_mode mode = mode_for_size (gcov_size, MODE_INT, 0);
rtx stored_value_ref, stored_value, tmp, uval;
@@ -393,13 +390,14 @@ rtl_gen_const_delta_profiler (struct histogram_value *value, unsigned tag,
copy_rtx (uval), copy_rtx (stored_value),
NULL_RTX, 0, OPTAB_WIDEN);
- one_value_delta.value = tmp;
- one_value_delta.mode = mode;
- one_value_delta.seq = NULL_RTX;
- one_value_delta.insn = value->insn;
- one_value_delta.type = HIST_TYPE_SINGLE_VALUE;
- emit_insn (rtl_gen_one_value_profiler_no_edge_manipulation (&one_value_delta,
- tag, base + 1));
+ one_value_delta = ggc_alloc (sizeof (*one_value_delta));
+ one_value_delta->value = tmp;
+ one_value_delta->mode = mode;
+ one_value_delta->seq = NULL_RTX;
+ one_value_delta->insn = value->insn;
+ one_value_delta->type = HIST_TYPE_SINGLE_VALUE;
+ emit_insn (rtl_gen_one_value_profiler_no_edge_manipulation (one_value_delta,
+ tag, base + 1));
emit_move_insn (copy_rtx (stored_value), uval);
sequence = get_insns ();
end_sequence ();