/* Routines for reading GIMPLE from a file stream.
- Copyright (C) 2011-2015 Free Software Foundation, Inc.
+ Copyright (C) 2011-2020 Free Software Foundation, Inc.
Contributed by Diego Novillo <dnovillo@google.com>
This file is part of GCC.
#include "config.h"
#include "system.h"
#include "coretypes.h"
-#include "diagnostic.h"
-#include "alias.h"
#include "backend.h"
#include "tree.h"
#include "gimple.h"
-#include "hard-reg-set.h"
#include "ssa.h"
-#include "options.h"
-#include "fold-const.h"
-#include "internal-fn.h"
+#include "gimple-streamer.h"
#include "tree-eh.h"
#include "gimple-iterator.h"
#include "cgraph.h"
-#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. */
static gphi *
-input_phi (struct lto_input_block *ib, basic_block bb, struct data_in *data_in,
+input_phi (class lto_input_block *ib, basic_block bb, class data_in *data_in,
struct function *fn)
{
unsigned HOST_WIDE_INT ix;
/* Read a statement with tag TAG in function FN from block IB using
descriptors in DATA_IN. */
-static gimple
-input_gimple_stmt (struct lto_input_block *ib, struct data_in *data_in,
+static gimple *
+input_gimple_stmt (class lto_input_block *ib, class data_in *data_in,
enum LTO_tags tag)
{
- gimple stmt;
+ gimple *stmt;
enum gimple_code code;
unsigned HOST_WIDE_INT num_ops;
size_t i;
break;
case GIMPLE_TRANSACTION:
- gimple_transaction_set_label (as_a <gtransaction *> (stmt),
- stream_read_tree (ib, data_in));
+ gimple_transaction_set_label_norm (as_a <gtransaction *> (stmt),
+ stream_read_tree (ib, data_in));
+ gimple_transaction_set_label_uninst (as_a <gtransaction *> (stmt),
+ stream_read_tree (ib, data_in));
+ gimple_transaction_set_label_over (as_a <gtransaction *> (stmt),
+ stream_read_tree (ib, data_in));
break;
default:
FN is the function being processed. */
void
-input_bb (struct lto_input_block *ib, enum LTO_tags tag,
- struct data_in *data_in, struct function *fn,
+input_bb (class lto_input_block *ib, enum LTO_tags tag,
+ class data_in *data_in, struct function *fn,
int count_materialization_scale)
{
unsigned int index;
index = streamer_read_uhwi (ib);
bb = BASIC_BLOCK_FOR_FN (fn, index);
- bb->count = apply_scale (streamer_read_gcov_count (ib),
- count_materialization_scale);
- bb->frequency = streamer_read_hwi (ib);
+ bb->count = profile_count::stream_in (ib);
+ if (count_materialization_scale != REG_BR_PROB_BASE
+ && bb->count.ipa ().nonzero_p ())
+ bb->count
+ = bb->count.apply_scale (count_materialization_scale, REG_BR_PROB_BASE);
bb->flags = streamer_read_hwi (ib);
+ bb->discriminator = streamer_read_hwi (ib);
/* LTO_bb1 has statements. LTO_bb0 does not. */
if (tag == LTO_bb0)
tag = streamer_read_record_start (ib);
while (tag)
{
- gimple stmt = input_gimple_stmt (ib, data_in, tag);
+ gimple *stmt = input_gimple_stmt (ib, data_in, tag);
gsi_insert_after (&bsi, stmt, GSI_NEW_STMT);
/* After the statement, expect a 0 delimiter or the EH region