/* Call from the debugger to get the current pass name. */
-void
+DEBUG_FUNCTION void
debug_pass (void)
{
print_current_pass (stderr);
;
else if (TREE_CODE (decl) != FUNCTION_DECL)
varpool_finalize_decl (decl);
- else
- assemble_variable (decl, top_level, at_end, 0);
}
#ifdef ASM_FINISH_DECLARE_OBJECT
NEXT_PASS (pass_cleanup_eh);
NEXT_PASS (pass_profile);
NEXT_PASS (pass_local_pure_const);
+ /* Split functions creates parts that are not run through
+ early optimizations again. It is thus good idea to do this
+ late. */
+ NEXT_PASS (pass_split_functions);
}
NEXT_PASS (pass_release_ssa_names);
NEXT_PASS (pass_rebuild_cgraph_edges);
}
NEXT_PASS (pass_ipa_increase_alignment);
NEXT_PASS (pass_ipa_matrix_reorg);
+ NEXT_PASS (pass_ipa_lower_emutls);
*p = NULL;
p = &all_regular_ipa_passes;
NEXT_PASS (pass_ipa_whole_program_visibility);
NEXT_PASS (pass_ipa_profile);
NEXT_PASS (pass_ipa_cp);
+ NEXT_PASS (pass_ipa_cdtor_merge);
NEXT_PASS (pass_ipa_inline);
- NEXT_PASS (pass_ipa_reference);
NEXT_PASS (pass_ipa_pure_const);
+ NEXT_PASS (pass_ipa_reference);
NEXT_PASS (pass_ipa_type_escape);
NEXT_PASS (pass_ipa_pta);
NEXT_PASS (pass_ipa_struct_reorg);
NEXT_PASS (pass_check_data_deps);
NEXT_PASS (pass_loop_distribution);
NEXT_PASS (pass_linear_transform);
- NEXT_PASS (pass_graphite_transforms);
+ NEXT_PASS (pass_copy_prop);
+ NEXT_PASS (pass_graphite);
{
- struct opt_pass **p = &pass_graphite_transforms.pass.sub;
+ struct opt_pass **p = &pass_graphite.pass.sub;
+ NEXT_PASS (pass_copy_prop);
+ NEXT_PASS (pass_graphite_transforms);
NEXT_PASS (pass_copy_prop);
NEXT_PASS (pass_dce_loop);
NEXT_PASS (pass_lim);
keep the array visible to garbage collector to avoid reading collected
out nodes. */
static int nnodes;
-static GTY ((length ("nnodes"))) struct cgraph_node **order;
+static GTY ((length ("nnodes"))) cgraph_node_ptr *order;
/* If we are in IPA mode (i.e., current_function_decl is NULL), call
function CALLBACK for every function in the call graph. Otherwise,
else
{
gcc_assert (!order);
- order = GGC_NEWVEC (struct cgraph_node *, cgraph_n_nodes);
+ order = ggc_alloc_vec_cgraph_node_ptr (cgraph_n_nodes);
nnodes = cgraph_postorder (order);
for (i = nnodes - 1; i >= 0; i--)
order[i]->process = 1;
execute_function_todo (void *data)
{
unsigned int flags = (size_t)data;
- if (cfun->curr_properties & PROP_ssa)
- flags |= TODO_verify_ssa;
flags &= ~cfun->last_verified;
if (!flags)
return;
- statistics_fini_pass ();
-
/* Always cleanup the CFG before trying to update SSA. */
if (flags & TODO_cleanup_cfg)
{
}
if (flags & TODO_rebuild_frequencies)
- {
- if (profile_status == PROFILE_GUESSED)
- {
- loop_optimizer_init (0);
- add_noreturn_fake_exit_edges ();
- mark_irreducible_loops ();
- connect_infinite_loops_to_exit ();
- estimate_bb_frequencies ();
- remove_fake_exit_edges ();
- loop_optimizer_finalize ();
- }
- else if (profile_status == PROFILE_READ)
- counts_to_freqs ();
- else
- gcc_unreachable ();
- }
+ rebuild_frequencies ();
#if defined ENABLE_CHECKING
if (flags & TODO_verify_ssa
/* Inform the pass whether it is the first time it is run. */
first_pass_instance = (flags & TODO_mark_first_instance) != 0;
+ statistics_fini_pass ();
+
do_per_function (execute_function_todo, (void *)(size_t) flags);
/* Always remove functions just as before inlining: IPA passes might be
void
execute_all_ipa_transforms (void)
{
- enum cgraph_state old_state = cgraph_state;
struct cgraph_node *node;
if (!cfun)
return;
node = cgraph_node (current_function_decl);
- /* Statement verification skip verification of nothorw when
- state is IPA_SSA because we do not modify function bodies
- after setting the flag on function. Instead we leave it
- to fixup_cfg to do such a transformation. We need to temporarily
- change the cgraph state so statement verifier before
- transform do not fire. */
- cgraph_state = CGRAPH_STATE_IPA_SSA;
-
if (node->ipa_transforms_to_apply)
{
unsigned int i;
VEC_free (ipa_opt_pass, heap, node->ipa_transforms_to_apply);
node->ipa_transforms_to_apply = NULL;
}
- cgraph_state = old_state;
}
/* Execute PASS. */
if (pass->tv_id)
timevar_push (pass->tv_id);
+ pass_init_dump_file (pass);
+
ipa_pass->write_summary (set,vset);
+ pass_fini_dump_file (pass);
+
/* If a timevar is present, start it. */
if (pass->tv_id)
timevar_pop (pass->tv_id);
if (pass->tv_id)
timevar_push (pass->tv_id);
+ pass_init_dump_file (pass);
+
ipa_pass->write_optimization_summary (set, vset);
+ pass_fini_dump_file (pass);
+
/* If a timevar is present, start it. */
if (pass->tv_id)
timevar_pop (pass->tv_id);
ipa_write_optimization_summaries (cgraph_node_set set, varpool_node_set vset)
{
struct lto_out_decl_state *state = lto_new_out_decl_state ();
+ cgraph_node_set_iterator csi;
compute_ltrans_boundary (state, set, vset);
lto_push_out_decl_state (state);
+ for (csi = csi_start (set); !csi_end_p (csi); csi_next (&csi))
+ {
+ struct cgraph_node *node = csi_node (csi);
+ /* When streaming out references to statements as part of some IPA
+ pass summary, the statements need to have uids assigned.
+
+ For functions newly born at WPA stage we need to initialize
+ the uids here. */
+ if (node->analyzed
+ && gimple_has_body_p (node->decl))
+ {
+ push_cfun (DECL_STRUCT_FUNCTION (node->decl));
+ renumber_gimple_stmt_uids ();
+ pop_cfun ();
+ }
+ }
gcc_assert (flag_wpa);
ipa_write_optimization_summaries_1 (all_regular_ipa_passes, set, vset, state);
if (pass->tv_id)
timevar_push (pass->tv_id);
+ pass_init_dump_file (pass);
+
ipa_pass->read_summary ();
+ pass_fini_dump_file (pass);
+
/* Stop timevar. */
if (pass->tv_id)
timevar_pop (pass->tv_id);
if (pass->tv_id)
timevar_push (pass->tv_id);
+ pass_init_dump_file (pass);
+
ipa_pass->read_optimization_summary ();
+ pass_fini_dump_file (pass);
+
/* Stop timevar. */
if (pass->tv_id)
timevar_pop (pass->tv_id);
extern void debug_properties (unsigned int);
extern void dump_properties (FILE *, unsigned int);
-void
+DEBUG_FUNCTION void
dump_properties (FILE *dump, unsigned int props)
{
fprintf (dump, "Properties:\n");
fprintf (dump, "PROP_gimple_lomp\n");
if (props & PROP_gimple_lcx)
fprintf (dump, "PROP_gimple_lcx\n");
+ if (props & PROP_cfglayout)
+ fprintf (dump, "PROP_cfglayout\n");
}
-void
+DEBUG_FUNCTION void
debug_properties (unsigned int props)
{
dump_properties (stderr, props);