summaryrefslogtreecommitdiff
path: root/gcc/gimple-streamer-in.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2013-03-28 15:29:40 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2013-03-28 15:29:40 +0000
commitfc44a215aec90430e9d4b4c066c6b93f7ebc915d (patch)
tree35ba8ad462caf0907fefeff0406e6ef831248073 /gcc/gimple-streamer-in.c
parenta706be2ea60dedff74ab4a1589b6e7acad2a34c7 (diff)
downloadgcc-fc44a215aec90430e9d4b4c066c6b93f7ebc915d.tar.gz
* data-streamer-in.c (streamer_read_gcov_count): New function.
* gimple-streamer-out.c: Include value-prof.h. (output_gimple_stmt): Output histogram. (output_bb): Use streamer_write_gcov_count. * value-prof.c: Include data-streamer.h (dump_histogram_value): Add HIST_TYPE_MAX. (stream_out_histogram_value): New function. (stream_in_histogram_value): New function. * value-prof.h (enum hist_type): Add HIST_TYPE_MAX. (stream_out_histogram_value, stream_in_histogram_value): Declare. * data-streamer-out.c (streamer_write_gcov_count): New function. (streamer_write_gcov_count_stream): New function. * lto-cgraph.c (lto_output_edge): Update counter streaming. (lto_output_node): Likewise. (input_node, input_edge): Likewise. * lto-streamer-out.c (output_cfg): Update streaming. * lto-streamer-in.c (input_cfg): Likewise. * data-streamer.h (streamer_write_gcov_count, streamer_write_gcov_count_stream, streamer_read_gcov_count): Declare. * gimple-streamer-in.c: Include value-prof.h (input_gimple_stmt): Input histograms. (input_bb): Update profile streaming. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@197205 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gimple-streamer-in.c')
-rw-r--r--gcc/gimple-streamer-in.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/gimple-streamer-in.c b/gcc/gimple-streamer-in.c
index aff589a4c8f..cedacb6642c 100644
--- a/gcc/gimple-streamer-in.c
+++ b/gcc/gimple-streamer-in.c
@@ -28,6 +28,7 @@ along with GCC; see the file COPYING3. If not see
#include "data-streamer.h"
#include "tree-streamer.h"
#include "gimple-streamer.h"
+#include "value-prof.h"
/* Read a PHI function for basic block BB in function FN. DATA_IN is
the file being read. IB is the input block to use for reading. */
@@ -86,6 +87,7 @@ input_gimple_stmt (struct lto_input_block *ib, struct data_in *data_in,
unsigned HOST_WIDE_INT num_ops;
size_t i;
struct bitpack_d bp;
+ bool has_hist;
code = lto_tag_to_gimple_code (tag);
@@ -97,6 +99,7 @@ input_gimple_stmt (struct lto_input_block *ib, struct data_in *data_in,
if (is_gimple_assign (stmt))
stmt->gsbase.nontemporal_move = bp_unpack_value (&bp, 1);
stmt->gsbase.has_volatile_ops = bp_unpack_value (&bp, 1);
+ has_hist = bp_unpack_value (&bp, 1);
stmt->gsbase.subcode = bp_unpack_var_len_unsigned (&bp);
/* Read location information. */
@@ -300,6 +303,8 @@ input_gimple_stmt (struct lto_input_block *ib, struct data_in *data_in,
/* Mark the statement modified so its operand vectors can be filled in. */
gimple_set_modified (stmt, true);
+ if (has_hist)
+ stream_in_histogram_value (ib, stmt);
return stmt;
}
@@ -324,7 +329,7 @@ input_bb (struct lto_input_block *ib, enum LTO_tags tag,
index = streamer_read_uhwi (ib);
bb = BASIC_BLOCK_FOR_FUNCTION (fn, index);
- bb->count = (streamer_read_hwi (ib) * count_materialization_scale
+ bb->count = (streamer_read_gcov_count (ib) * count_materialization_scale
+ REG_BR_PROB_BASE / 2) / REG_BR_PROB_BASE;
bb->frequency = streamer_read_hwi (ib);
bb->flags = streamer_read_hwi (ib);