}
update_max_bb_count ();
profile_status_for_fn (cfun) = PROFILE_READ;
+ cfun->cfg->full_profile = true;
if (flag_value_profile_transformations)
{
gimple_value_profile_transformations ();
= ENTRY_BLOCK_PTR_FOR_FN (the_fun);
the_fun->cfg->edge_flags_allocated = EDGE_ALL_FLAGS;
the_fun->cfg->bb_flags_allocated = BB_ALL_FLAGS;
+ the_fun->cfg->full_profile = false;
}
\f
/* Helper function for remove_edge and free_cffg. Frees edge structure
/* Dynamically allocated edge/bb flags. */
int edge_flags_allocated;
int bb_flags_allocated;
+
+ /* Set if the profile is computed on every edge and basic block. */
+ bool full_profile;
};
if (changed)
{
+ /* FIXME: Graphite does not update profile meaningfully currently. */
+ cfun->cfg->full_profile = false;
cleanup_tree_cfg ();
profile_status_for_fn (cfun) = PROFILE_ABSENT;
release_recorded_exits (cfun);
basic_block p_bb;
unsigned int i;
int index;
+ bool full_profile = false;
init_empty_tree_cfg_for_function (fn);
data_in->location_cache.input_location_and_block (&e->goto_locus,
&bp, ib, data_in);
e->probability = profile_probability::stream_in (ib);
+ if (!e->probability.initialized_p ())
+ full_profile = false;
}
/* Rebuild the loop tree. */
flow_loops_find (loops);
+ cfun->cfg->full_profile = full_profile;
}
scev_initialize ();
tree_estimate_probability (false);
+ cfun->cfg->full_profile = true;
if (nb_loops > 1)
scev_finalize ();
? PROFILE_READ : PROFILE_GUESSED;
/* FIXME: C++ FE should stop setting TREE_ASM_WRITTEN on thunks. */
TREE_ASM_WRITTEN (thunk_fndecl) = false;
+ cfun->cfg->full_profile = true;
delete_unreachable_blocks ();
update_ssa (TODO_update_ssa);
checking_verify_flow_info ();
error ("fallthru to exit from bb %d", e->src->index);
err = true;
}
+ if (cfun->cfg->full_profile
+ && !ENTRY_BLOCK_PTR_FOR_FN (cfun)->count.initialized_p ())
+ {
+ error ("entry block count not initialized");
+ err = true;
+ }
+ if (cfun->cfg->full_profile
+ && !EXIT_BLOCK_PTR_FOR_FN (cfun)->count.initialized_p ())
+ {
+ error ("exit block count not initialized");
+ err = true;
+ }
+ if (cfun->cfg->full_profile
+ && !single_succ_edge
+ (ENTRY_BLOCK_PTR_FOR_FN (cfun))->probability.initialized_p ())
+ {
+ error ("probability of edge from entry block not initialized");
+ err = true;
+ }
+
FOR_EACH_BB_FN (bb, cfun)
{
stmt = NULL;
+ if (cfun->cfg->full_profile)
+ {
+ if (!bb->count.initialized_p ())
+ {
+ error ("count of bb %d not initialized", bb->index);
+ err = true;
+ }
+ FOR_EACH_EDGE (e, ei, bb->succs)
+ if (!e->probability.initialized_p ())
+ {
+ error ("probability of edge %d->%d not initialized",
+ bb->index, e->dest->index);
+ err = true;
+ }
+ }
+
/* Skip labels on the start of basic block. */
for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
init_empty_tree_cfg ();
profile_status_for_fn (cfun) = profile_status_for_fn (src_cfun);
+ cfun->cfg->full_profile = src_cfun->cfg->full_profile;
profile_count num = count;
profile_count den = ENTRY_BLOCK_PTR_FOR_FN (src_cfun)->count;
id->src_cfun = DECL_STRUCT_FUNCTION (fn);
id->reset_location = DECL_IGNORED_P (fn);
id->call_stmt = call_stmt;
+ cfun->cfg->full_profile &= id->src_cfun->cfg->full_profile;
/* When inlining into an OpenMP SIMD-on-SIMT loop, arrange for new automatic
variables to be added to IFN_GOMP_SIMT_ENTER argument list. */