gcc-8.3/gcc/pass_expand/execute()
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
*参照元 [#m85f98c1]
#backlinks
*説明 [#z9fe61e6]
-パス: [[gcc-8.3/gcc/cfgexpand.c]]
-FIXME: これは何?
--説明
**引数 [#t8f1ab3e]
-function *fun
--
--[[gcc-8.3/gcc/function]]
**返り値 [#i5f20c02]
-unsigned int
--
**参考 [#oac2a942]
*実装 [#o8b32ca0]
unsigned int
pass_expand::execute (function *fun)
{
basic_block bb, init_block;
edge_iterator ei;
edge e;
rtx_insn *var_seq, *var_ret_seq;
unsigned i;
-
--[[gcc-8.3/gcc/basic_block]]
--[[gcc-8.3/gcc/edge_interator]]
--[[gcc-8.3/gcc/edge]]
--[[gcc-8.3/gcc/rtx_insn]]
timevar_push (TV_OUT_OF_SSA);
rewrite_out_of_ssa (&SA);
timevar_pop (TV_OUT_OF_SSA);
SA.partition_to_pseudo = XCNEWVEC (rtx, SA.map->num_pa...
-
--[[gcc-8.3/gcc/timevar_push()]]
--[[gcc-8.3/gcc/rewrite_out_of_ssa()]]
--[[gcc-8.3/gcc/timevar_pop()]]
--[[gcc-8.3/gcc/XCNEWVEC()]]
--[[gcc-8.3/gcc/SA(global)]]
if (MAY_HAVE_DEBUG_BIND_STMTS && flag_tree_ter)
{
gimple_stmt_iterator gsi;
FOR_EACH_BB_FN (bb, cfun)
for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_nex...
if (gimple_debug_bind_p (gsi_stmt (gsi)))
avoid_deep_ter_for_debug (gsi_stmt (gsi), 0);
}
-
--[[gcc-8.3/gcc/gimple_stmt_iterator]]
--[[gcc-8.3/gcc/FOR_EACH_BB_FN()]]
--[[gcc-8.3/gcc/gsi_start_bb()]]
--[[gcc-8.3/gcc/gsi_end_p()]]
--[[gcc-8.3/gcc/gsi_next()]]
--[[gcc-8.3/gcc/gimple_debug_bind_p()]]
--[[gcc-8.3/gcc/gsi_stmt()]]
--[[gcc-8.3/gcc/avoid_deep_ter_for_debug()]]
/* Make sure all values used by the optimization passe...
defaults. */
reg_renumber = 0;
/* Some backends want to know that we are expanding to...
currently_expanding_to_rtl = 1;
/* Dominators are not kept up-to-date as we may create...
free_dominance_info (CDI_DOMINATORS);
rtl_profile_for_bb (ENTRY_BLOCK_PTR_FOR_FN (fun));
-
--[[gcc-8.3/gcc/free_dominance_info()]]
--[[gcc-8.3/gcc/rtl_profile_for_bb()]]
--[[gcc-8.3/gcc/ENTRY_BLOCK_PTR_FOR_FN()]]
if (chkp_function_instrumented_p (current_function_dec...
chkp_reset_rtl_bounds ();
-
--[[gcc-8.3/gcc/chkp_function_instrumented_p()]]
--[[gcc-8.3/gcc/chkp_reset_rtl_bounds()]]
insn_locations_init ();
if (!DECL_IS_BUILTIN (current_function_decl))
{
/* Eventually, all FEs should explicitly set funct...
if (LOCATION_LOCUS (fun->function_start_locus) == ...
set_curr_insn_location
(DECL_SOURCE_LOCATION (current_function_decl));
else
set_curr_insn_location (fun->function_start_locus);
}
else
set_curr_insn_location (UNKNOWN_LOCATION);
prologue_location = curr_insn_location ();
-
--[[gcc-8.3/gcc/insn_locations_init()]]
--[[gcc-8.3/gcc/DECL_IS_BUILTIN()]]
--[[gcc-8.3/gcc/LOCATION_LOCUS()]]
--[[gcc-8.3/gcc/set_curr_insn_location()]]
--[[gcc-8.3/gcc/DECL_SOURCE_LOCATION()]]
--[[gcc-8.3/gcc/curr_insn_location()]]
#ifdef INSN_SCHEDULING
init_sched_attrs ();
#endif
-
--[[gcc-8.3/gcc/init_sched_attrs()]]
/* Make sure first insn is a note even if we don't wan...
This makes sure the first insn will never be deleted.
Also, final expects a note to appear there. */
emit_note (NOTE_INSN_DELETED);
-
--[[gcc-8.3/gcc/emit_note()]]
/* Mark arrays indexed with non-constant indices with ...
discover_nonconstant_array_refs ();
targetm.expand_to_rtl_hook ();
crtl->init_stack_alignment ();
fun->cfg->max_jumptable_ents = 0;
-
--[[gcc-8.3/gcc/discover_nonconstant_array_refs()]]
/* Resovle the function section. Some targets, like A...
of the function section at exapnsion time to predic...
resolve_unique_section (current_function_decl, 0, flag...
-
--[[gcc-8.3/gcc/resolve_unique_section()]]
/* Expand the variables recorded during gimple lowerin...
timevar_push (TV_VAR_EXPAND);
start_sequence ();
var_ret_seq = expand_used_vars ();
var_seq = get_insns ();
end_sequence ();
timevar_pop (TV_VAR_EXPAND);
-
--[[gcc-8.3/gcc/start_sequence()]]
--[[gcc-8.3/gcc/expand_used_vars()]]
--[[gcc-8.3/gcc/get_insns()]]
--[[gcc-8.3/gcc/end_sequence()]]
/* Honor stack protection warnings. */
if (warn_stack_protect)
{
if (fun->calls_alloca)
warning (OPT_Wstack_protector,
"stack protector not protecting local variables: "
"variable length buffer");
if (has_short_buffer && !crtl->stack_protect_guard)
warning (OPT_Wstack_protector,
"stack protector not protecting function: "
"all local arrays are less than %d bytes long",
(int) PARAM_VALUE (PARAM_SSP_BUFFER_SIZE));
}
-
--[[gcc-8.3/gcc/warning()]]
/* Set up parameters and prepare for return, for the f...
expand_function_start (current_function_decl);
-
--[[gcc-8.3/gcc/expand_function_start()]]
/* If we emitted any instructions for setting up the v...
emit them before the FUNCTION_START note. */
if (var_seq)
{
emit_insn_before (var_seq, parm_birth_insn);
/* In expand_function_end we'll insert the alloca ...
before parm_birth_insn. We've just insertted an alloc...
Adjust the pointer to match. */
parm_birth_insn = var_seq;
}
-
--[[gcc-8.3/gcc/emit_insn_before()]]
/* Now propagate the RTL assignment of each partition ...
underlying var of each SSA_NAME. */
tree name;
FOR_EACH_SSA_NAME (i, name, cfun)
{
/* We might have generated new SSA names in
update_alias_info_with_stack_vars. They will have a N...
defining statements, and won't be part of the partitio...
so ignore those. */
if (!SSA_NAME_DEF_STMT (name))
continue;
adjust_one_expanded_partition_var (name);
}
-
--[[gcc-8.3/gcc/tree]]
--[[gcc-8.3/gcc/FOR_EACH_SSA_NAME()]]
--[[gcc-8.3/gcc/SSA_NAME_DEF_STMT()]]
--[[gcc-8.3/gcc/adjust_one_expanded_partition_var()]]
/* Clean up RTL of variables that straddle across mult...
partitions, and check that the rtl of any PARM_DECL...
cleaned up is that of their default defs. */
FOR_EACH_SSA_NAME (i, name, cfun)
{
int part;
/* We might have generated new SSA names in
update_alias_info_with_stack_vars. They will have a N...
defining statements, and won't be part of the partitio...
so ignore those. */
if (!SSA_NAME_DEF_STMT (name))
continue;
part = var_to_partition (SA.map, name);
if (part == NO_PARTITION)
continue;
-
--[[gcc-8.3/gcc/SSA_NAME_DEF_STMT()]]
--[[gcc-8.3/gcc/var_to_partition()]]
/* If this decl was marked as living in multiple p...
this now to NULL. */
tree var = SSA_NAME_VAR (name);
if (var && DECL_RTL_IF_SET (var) == pc_rtx)
SET_DECL_RTL (var, NULL);
/* Check that the pseudos chosen by assign_parms a...
the corresponding default defs. */
else if (SSA_NAME_IS_DEFAULT_DEF (name)
&& (TREE_CODE (var) == PARM_DECL
|| TREE_CODE (var) == RESULT_DECL))
{
rtx in = DECL_RTL_IF_SET (var);
gcc_assert (in);
rtx out = SA.partition_to_pseudo[part];
gcc_assert (in == out);
/* Now reset VAR's RTL to IN, so that the _EXPR attrs...
those expected by debug backends for each parm and...
the result. This is particularly important for st...
whose register elimination from parm's DECL_RTL ma...
-fcompare-debug differences as SET_DECL_RTL change...
attrs. So, make sure the RTL already has the parm...
EXPR, so that it won't change. */
SET_DECL_RTL (var, NULL_RTX);
if (MEM_P (in))
set_mem_attributes (in, var, true);
SET_DECL_RTL (var, in);
}
}
-
--[[gcc-8.3/gcc/tree]]
--[[gcc-8.3/gcc/SSA_NAME_VAR()]]
--[[gcc-8.3/gcc/DECL_RTL_IF_SET()]]
--[[gcc-8.3/gcc/SET_DECL_RTL()]]
--[[gcc-8.3/gcc/SSA_NAME_IS_DEFAULT_DEF()]]
--[[gcc-8.3/gcc/TREE_CODE()]]
--[[gcc-8.3/gcc/rtx]]
--[[gcc-8.3/gcc/DECL_RTL_IF_SET()]]
--[[gcc-8.3/gcc/gcc_assert()]]
--[[gcc-8.3/gcc/SET_DECL_RTL()]]
--[[gcc-8.3/gcc/MEM_P()]]
--[[gcc-8.3/gcc/set_mem_attributes()]]
/* If this function is `main', emit a call to `__main'
to run global initializers, etc. */
if (DECL_NAME (current_function_decl)
&& MAIN_NAME_P (DECL_NAME (current_function_decl))
&& DECL_FILE_SCOPE_P (current_function_decl))
expand_main_function ();
-
--[[gcc-8.3/gcc/DECL_NAME()]]
--[[gcc-8.3/gcc/MAIN_NAME_P()]]
--[[gcc-8.3/gcc/DECL_FILE_SCOPE_P()]]
--[[gcc-8.3/gcc/expand_main_function()]]
/* Initialize the stack_protect_guard field. This mus...
call to __main (if any) so that the external decl i...
if (crtl->stack_protect_guard && targetm.stack_protect...
stack_protect_prologue ();
expand_phi_nodes (&SA);
-
--[[gcc-8.3/gcc/stack_protect_prologue()]]
--[[gcc-8.3/gcc/expand_phi_nodes()]]
/* Release any stale SSA redirection data. */
redirect_edge_var_map_empty ();
/* Register rtl specific functions for cfg. */
rtl_register_cfg_hooks ();
init_block = construct_init_block ();
-
--[[gcc-8.3/gcc/redirect_edge_var_map_empty()]]
--[[gcc-8.3/gcc/rtl_register_cfg_hooks()]]
--[[gcc-8.3/gcc/construct_init_block()]]
/* Clear EDGE_EXECUTABLE on the entry edge(s). It is ...
remaining edges later. */
FOR_EACH_EDGE (e, ei, ENTRY_BLOCK_PTR_FOR_FN (fun)->su...
e->flags &= ~EDGE_EXECUTABLE;
-
--[[gcc-8.3/gcc/FOR_EACH_EDGE()]]
--[[gcc-8.3/gcc/ENTRY_BLOCK_PTR_FOR_FN()]]
/* If the function has too many markers, drop them whi...
if (cfun->debug_marker_count
>= PARAM_VALUE (PARAM_MAX_DEBUG_MARKER_COUNT))
cfun->debug_nonbind_markers = false;
lab_rtx_for_bb = new hash_map<basic_block, rtx_code_la...
FOR_BB_BETWEEN (bb, init_block->next_bb, EXIT_BLOCK_PT...
next_bb)
bb = expand_gimple_basic_block (bb, var_ret_seq != N...
if (MAY_HAVE_DEBUG_BIND_INSNS)
expand_debug_locations ();
if (deep_ter_debug_map)
{
delete deep_ter_debug_map;
deep_ter_debug_map = NULL;
}
-
--[[gcc-8.3/gcc/PARAM_VALUE()]]
--[[gcc-8.3/gcc/lab_rtx_for_bb]]
--[[gcc-8.3/gcc/hashmap]]
--[[gcc-8.3/gcc/basic_block]]
--[[gcc-8.3/gcc/rtx_code_label]]
--[[gcc-8.3/gcc/FOR_BB_BETWEEN()]]
--[[gcc-8.3/gcc/EXIT_BLOCK_PTR_FOR_FN()]]
--[[gcc-8.3/gcc/expand_gimple_basic_block()]]
--[[gcc-8.3/gcc/expand_debug_locations()]]
/* Free stuff we no longer need after GIMPLE optimizat...
free_dominance_info (CDI_DOMINATORS);
free_dominance_info (CDI_POST_DOMINATORS);
delete_tree_cfg_annotations (fun);
timevar_push (TV_OUT_OF_SSA);
finish_out_of_ssa (&SA);
timevar_pop (TV_OUT_OF_SSA);
timevar_push (TV_POST_EXPAND);
/* We are no longer in SSA form. */
fun->gimple_df->in_ssa_p = false;
loops_state_clear (LOOP_CLOSED_SSA);
-
--[[gcc-8.3/gcc/free_dominance_info()]]
--[[gcc-8.3/gcc/delete_tree_cfg_annotations()]]
--[[gcc-8.3/gcc/finish_out_of_ssa()]]
--[[gcc-8.3/gcc/loops_state_clear()]]
/* Expansion is used by optimization passes too, set m...
conservatively to true until they are all profile a...
delete lab_rtx_for_bb;
free_histograms (fun);
construct_exit_block ();
insn_locations_finalize ();
if (var_ret_seq)
{
rtx_insn *after = return_label;
rtx_insn *next = NEXT_INSN (after);
if (next && NOTE_INSN_BASIC_BLOCK_P (next))
after = next;
emit_insn_after (var_ret_seq, after);
}
-
--[[gcc-8.3/gcc/free_histograms()]]
--[[gcc-8.3/gcc/construct_exit_block()]]
--[[gcc-8.3/gcc/insn_locations_finalize()]]
--[[gcc-8.3/gcc/rtx_insn]]
--[[gcc-8.3/gcc/NEXT_INSN()]]
--[[gcc-8.3/gcc/NOTE_INSN_BASIC_BLOCK_P()]]
--[[gcc-8.3/gcc/emit_insn_after()]]
/* Zap the tree EH table. */
set_eh_throw_stmt_table (fun, NULL);
-
--[[gcc-8.3/gcc/set_eh_throw_stmt_table()]]
/* We need JUMP_LABEL be set in order to redirect jump...
split edges which edge insertions might do. */
rebuild_jump_labels (get_insns ());
-
--[[gcc-8.3/gcc/rebuild_jump_labels()]]
--[[gcc-8.3/gcc/get_insns()]]
FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR_FOR_FN (fun),
EXIT_BLOCK_PTR_FOR_FN (fun), next_bb)
{
edge e;
edge_iterator ei;
for (ei = ei_start (bb->succs); (e = ei_safe_edge ...
{
if (e->insns.r)
{
rebuild_jump_labels_chain (e->insns.r);
/* Put insns after parm birth, but before
NOTE_INSNS_FUNCTION_BEG. */
if (e->src == ENTRY_BLOCK_PTR_FOR_FN (fun)
&& single_succ_p (ENTRY_BLOCK_PTR_FOR_FN (fun)))
{
rtx_insn *insns = e->insns.r;
e->insns.r = NULL;
if (NOTE_P (parm_birth_insn)
&& NOTE_KIND (parm_birth_insn) == NOTE_INSN_FUNC...
emit_insn_before_noloc (insns, parm_birth_insn, e-...
else
emit_insn_after_noloc (insns, parm_birth_insn, e->...
}
else
commit_one_edge_insertion (e);
}
else
ei_next (&ei);
}
}
-
--[[gcc-8.3/gcc/FOR_BB_BETWEEN()]]
--[[gcc-8.3/gcc/ENTRY_BLOCK_PTR_FOR_FN()]]
--[[gcc-8.3/gcc/edge]]
--[[gcc-8.3/gcc/edge_iterator]]
--[[gcc-8.3/gcc/ei_start()]]
--[[gcc-8.3/gcc/ei_safe_edge()]]
--[[gcc-8.3/gcc/rebuild_jump_labels_chain()]]
--[[gcc-8.3/gcc/single_succ_p()]]
--[[gcc-8.3/gcc/rtx_insn]]
--[[gcc-8.3/gcc/NOTE_P()]]
--[[gcc-8.3/gcc/NOTE_KIND()]]
--[[gcc-8.3/gcc/emit_insn_before_noloc()]]
--[[gcc-8.3/gcc/emit_insn_after_noloc()]]
--[[gcc-8.3/gcc/commit_one_edge_insertion()]]
--[[gcc-8.3/gcc/ei_next()]]
/* We're done expanding trees to RTL. */
currently_expanding_to_rtl = 0;
flush_mark_addressable_queue ();
FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR_FOR_FN (fun)->next...
EXIT_BLOCK_PTR_FOR_FN (fun), next_bb)
{
edge e;
edge_iterator ei;
for (ei = ei_start (bb->succs); (e = ei_safe_edge ...
{
/* Clear EDGE_EXECUTABLE. This flag is never used in...
e->flags &= ~EDGE_EXECUTABLE;
/* At the moment not all abnormal edges match the RTL
representation. It is safe to remove them here as
find_many_sub_basic_blocks will rediscover them.
In the future we should get this fixed properly. */
if ((e->flags & EDGE_ABNORMAL)
&& !(e->flags & EDGE_SIBCALL))
remove_edge (e);
else
ei_next (&ei);
}
}
auto_sbitmap blocks (last_basic_block_for_fn (fun));
bitmap_ones (blocks);
find_many_sub_basic_blocks (blocks);
purge_all_dead_edges ();
-
--[[gcc-8.3/gcc/flush_mark_addressable_queue()]]
--[[gcc-8.3/gcc/FOR_BB_BETWEEN()]]
--[[gcc-8.3/gcc/ENTRY_BLOCK_PTR_FOR_FN()]]
--[[gcc-8.3/gcc/edge]]
--[[gcc-8.3/gcc/edge_iterator]]
--[[gcc-8.3/gcc/ei_start()]]
--[[gcc-8.3/gcc/ei_safe_edge()]]
--[[gcc-8.3/gcc/remove_edge()]]
--[[gcc-8.3/gcc/ei_next()]]
--[[gcc-8.3/gcc/auto_sbitmap]]
--[[gcc-8.3/gcc/last_basic_block_for_fn()]]
--[[gcc-8.3/gcc/bitmap_ones()]]
--[[gcc-8.3/gcc/find_many_sub_basic_blocks()]]
--[[gcc-8.3/gcc/purge_all_dead_edges()]]
/* After initial rtl generation, call back to finish g...
exception support code. We need to do this before ...
the CFG as the code does not expect dead landing pa...
if (fun->eh->region_tree != NULL)
finish_eh_generation ();
-
--[[gcc-8.3/gcc/finish_eh_generation()]]
/* Call expand_stack_alignment after finishing all
updates to crtl->preferred_stack_boundary. */
expand_stack_alignment ();
-
--[[gcc-8.3/gcc/expand_stack_alignment()]]
/* Fixup REG_EQUIV notes in the prologue if there are ...
function. */
if (crtl->tail_call_emit)
fixup_tail_calls ();
-
--[[gcc-8.3/gcc/fixup_tail_calls()]]
/* BB subdivision may have created basic blocks that a...
from unlikely bbs but not marked as such in the pro...
if (optimize)
propagate_unlikely_bbs_forward ();
-
--[[gcc-8.3/gcc/propagate_unlikely_bbs_forward()]]
/* Remove unreachable blocks, otherwise we cannot comp...
which are needed for loop state verification. As a...
this also compacts blocks.
??? We cannot remove trivially dead insns here as ...
the DRAP reg on i?86 is not magically live at this ...
gcc.c-torture/execute/ipa-sra-2.c execution, -Os -m...
cleanup_cfg (CLEANUP_NO_INSN_DEL);
checking_verify_flow_info ();
-
--[[gcc-8.3/gcc/cleanup_cfg()]]
--[[gcc-8.3/gcc/checking_verify_flow_info()]]
/* Initialize pseudos allocated for hard registers. */
emit_initial_value_sets ();
/* And finally unshare all RTL. */
unshare_all_rtl ();
-
--[[gcc-8.3/gcc/emit_initial_value_sets()]]
--[[gcc-8.3/gcc/unshare_all_rtl()]]
/* There's no need to defer outputting this function a...
know we want to output it. */
DECL_DEFER_OUTPUT (current_function_decl) = 0;
-
--[[gcc-8.3/gcc/DECL_DEFER_OUTPUT()]]
/* Now that we're done expanding trees to RTL, we shou...
more CONCATs anywhere. */
generating_concat_p = 0;
if (dump_file)
{
fprintf (dump_file,
"\n\n;;\n;; Full RTL generated for this function...
/* And the pass manager will dump RTL for us. */
}
/* If we're emitting a nested function, make sure its ...
emitted as well. Doing otherwise confuses debug in...
{
tree parent;
for (parent = DECL_CONTEXT (current_function_decl);
parent != NULL_TREE;
parent = get_containing_scope (parent))
if (TREE_CODE (parent) == FUNCTION_DECL)
TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (parent))...
}
TREE_ASM_WRITTEN (current_function_decl) = 1;
-
--[[gcc-8.3/gcc/tree]]
--[[gcc-8.3/gcc/DECL_CONTEXT()]]
--[[gcc-8.3/gcc/get_containing_scope()]]
--[[gcc-8.3/gcc/TREE_CODE()]]
--[[gcc-8.3/gcc/TREE_SYMBOL_REFERENCED()]]
--[[gcc-8.3/gcc/DECL_ASSEMBLER_NAME()]]
/* After expanding, the return labels are no longer ne...
return_label = NULL;
naked_return_label = NULL;
/* After expanding, the tm_restart map is no longer ne...
if (fun->gimple_df->tm_restart)
fun->gimple_df->tm_restart = NULL;
/* Tag the blocks with a depth number so that change_s...
the common parent easily. */
set_block_levels (DECL_INITIAL (fun->decl), 0);
default_rtl_profile ();
-
--[[gcc-8.3/gcc/set_block_levels()]]
--[[gcc-8.3/gcc/DECL_INITIAL()]]
--[[gcc-8.3/gcc/default_rtl_profile()]]
/* For -dx discard loops now, otherwise IL verify in c...
ICE. */
if (rtl_dump_and_exit)
{
cfun->curr_properties &= ~PROP_loops;
loop_optimizer_finalize ();
}
timevar_pop (TV_POST_EXPAND);
return 0;
}
-
--[[gcc-8.3/gcc/loop_optimizer_finalize()]]
*コメント [#g3ab2476]
終了行:
*参照元 [#m85f98c1]
#backlinks
*説明 [#z9fe61e6]
-パス: [[gcc-8.3/gcc/cfgexpand.c]]
-FIXME: これは何?
--説明
**引数 [#t8f1ab3e]
-function *fun
--
--[[gcc-8.3/gcc/function]]
**返り値 [#i5f20c02]
-unsigned int
--
**参考 [#oac2a942]
*実装 [#o8b32ca0]
unsigned int
pass_expand::execute (function *fun)
{
basic_block bb, init_block;
edge_iterator ei;
edge e;
rtx_insn *var_seq, *var_ret_seq;
unsigned i;
-
--[[gcc-8.3/gcc/basic_block]]
--[[gcc-8.3/gcc/edge_interator]]
--[[gcc-8.3/gcc/edge]]
--[[gcc-8.3/gcc/rtx_insn]]
timevar_push (TV_OUT_OF_SSA);
rewrite_out_of_ssa (&SA);
timevar_pop (TV_OUT_OF_SSA);
SA.partition_to_pseudo = XCNEWVEC (rtx, SA.map->num_pa...
-
--[[gcc-8.3/gcc/timevar_push()]]
--[[gcc-8.3/gcc/rewrite_out_of_ssa()]]
--[[gcc-8.3/gcc/timevar_pop()]]
--[[gcc-8.3/gcc/XCNEWVEC()]]
--[[gcc-8.3/gcc/SA(global)]]
if (MAY_HAVE_DEBUG_BIND_STMTS && flag_tree_ter)
{
gimple_stmt_iterator gsi;
FOR_EACH_BB_FN (bb, cfun)
for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_nex...
if (gimple_debug_bind_p (gsi_stmt (gsi)))
avoid_deep_ter_for_debug (gsi_stmt (gsi), 0);
}
-
--[[gcc-8.3/gcc/gimple_stmt_iterator]]
--[[gcc-8.3/gcc/FOR_EACH_BB_FN()]]
--[[gcc-8.3/gcc/gsi_start_bb()]]
--[[gcc-8.3/gcc/gsi_end_p()]]
--[[gcc-8.3/gcc/gsi_next()]]
--[[gcc-8.3/gcc/gimple_debug_bind_p()]]
--[[gcc-8.3/gcc/gsi_stmt()]]
--[[gcc-8.3/gcc/avoid_deep_ter_for_debug()]]
/* Make sure all values used by the optimization passe...
defaults. */
reg_renumber = 0;
/* Some backends want to know that we are expanding to...
currently_expanding_to_rtl = 1;
/* Dominators are not kept up-to-date as we may create...
free_dominance_info (CDI_DOMINATORS);
rtl_profile_for_bb (ENTRY_BLOCK_PTR_FOR_FN (fun));
-
--[[gcc-8.3/gcc/free_dominance_info()]]
--[[gcc-8.3/gcc/rtl_profile_for_bb()]]
--[[gcc-8.3/gcc/ENTRY_BLOCK_PTR_FOR_FN()]]
if (chkp_function_instrumented_p (current_function_dec...
chkp_reset_rtl_bounds ();
-
--[[gcc-8.3/gcc/chkp_function_instrumented_p()]]
--[[gcc-8.3/gcc/chkp_reset_rtl_bounds()]]
insn_locations_init ();
if (!DECL_IS_BUILTIN (current_function_decl))
{
/* Eventually, all FEs should explicitly set funct...
if (LOCATION_LOCUS (fun->function_start_locus) == ...
set_curr_insn_location
(DECL_SOURCE_LOCATION (current_function_decl));
else
set_curr_insn_location (fun->function_start_locus);
}
else
set_curr_insn_location (UNKNOWN_LOCATION);
prologue_location = curr_insn_location ();
-
--[[gcc-8.3/gcc/insn_locations_init()]]
--[[gcc-8.3/gcc/DECL_IS_BUILTIN()]]
--[[gcc-8.3/gcc/LOCATION_LOCUS()]]
--[[gcc-8.3/gcc/set_curr_insn_location()]]
--[[gcc-8.3/gcc/DECL_SOURCE_LOCATION()]]
--[[gcc-8.3/gcc/curr_insn_location()]]
#ifdef INSN_SCHEDULING
init_sched_attrs ();
#endif
-
--[[gcc-8.3/gcc/init_sched_attrs()]]
/* Make sure first insn is a note even if we don't wan...
This makes sure the first insn will never be deleted.
Also, final expects a note to appear there. */
emit_note (NOTE_INSN_DELETED);
-
--[[gcc-8.3/gcc/emit_note()]]
/* Mark arrays indexed with non-constant indices with ...
discover_nonconstant_array_refs ();
targetm.expand_to_rtl_hook ();
crtl->init_stack_alignment ();
fun->cfg->max_jumptable_ents = 0;
-
--[[gcc-8.3/gcc/discover_nonconstant_array_refs()]]
/* Resovle the function section. Some targets, like A...
of the function section at exapnsion time to predic...
resolve_unique_section (current_function_decl, 0, flag...
-
--[[gcc-8.3/gcc/resolve_unique_section()]]
/* Expand the variables recorded during gimple lowerin...
timevar_push (TV_VAR_EXPAND);
start_sequence ();
var_ret_seq = expand_used_vars ();
var_seq = get_insns ();
end_sequence ();
timevar_pop (TV_VAR_EXPAND);
-
--[[gcc-8.3/gcc/start_sequence()]]
--[[gcc-8.3/gcc/expand_used_vars()]]
--[[gcc-8.3/gcc/get_insns()]]
--[[gcc-8.3/gcc/end_sequence()]]
/* Honor stack protection warnings. */
if (warn_stack_protect)
{
if (fun->calls_alloca)
warning (OPT_Wstack_protector,
"stack protector not protecting local variables: "
"variable length buffer");
if (has_short_buffer && !crtl->stack_protect_guard)
warning (OPT_Wstack_protector,
"stack protector not protecting function: "
"all local arrays are less than %d bytes long",
(int) PARAM_VALUE (PARAM_SSP_BUFFER_SIZE));
}
-
--[[gcc-8.3/gcc/warning()]]
/* Set up parameters and prepare for return, for the f...
expand_function_start (current_function_decl);
-
--[[gcc-8.3/gcc/expand_function_start()]]
/* If we emitted any instructions for setting up the v...
emit them before the FUNCTION_START note. */
if (var_seq)
{
emit_insn_before (var_seq, parm_birth_insn);
/* In expand_function_end we'll insert the alloca ...
before parm_birth_insn. We've just insertted an alloc...
Adjust the pointer to match. */
parm_birth_insn = var_seq;
}
-
--[[gcc-8.3/gcc/emit_insn_before()]]
/* Now propagate the RTL assignment of each partition ...
underlying var of each SSA_NAME. */
tree name;
FOR_EACH_SSA_NAME (i, name, cfun)
{
/* We might have generated new SSA names in
update_alias_info_with_stack_vars. They will have a N...
defining statements, and won't be part of the partitio...
so ignore those. */
if (!SSA_NAME_DEF_STMT (name))
continue;
adjust_one_expanded_partition_var (name);
}
-
--[[gcc-8.3/gcc/tree]]
--[[gcc-8.3/gcc/FOR_EACH_SSA_NAME()]]
--[[gcc-8.3/gcc/SSA_NAME_DEF_STMT()]]
--[[gcc-8.3/gcc/adjust_one_expanded_partition_var()]]
/* Clean up RTL of variables that straddle across mult...
partitions, and check that the rtl of any PARM_DECL...
cleaned up is that of their default defs. */
FOR_EACH_SSA_NAME (i, name, cfun)
{
int part;
/* We might have generated new SSA names in
update_alias_info_with_stack_vars. They will have a N...
defining statements, and won't be part of the partitio...
so ignore those. */
if (!SSA_NAME_DEF_STMT (name))
continue;
part = var_to_partition (SA.map, name);
if (part == NO_PARTITION)
continue;
-
--[[gcc-8.3/gcc/SSA_NAME_DEF_STMT()]]
--[[gcc-8.3/gcc/var_to_partition()]]
/* If this decl was marked as living in multiple p...
this now to NULL. */
tree var = SSA_NAME_VAR (name);
if (var && DECL_RTL_IF_SET (var) == pc_rtx)
SET_DECL_RTL (var, NULL);
/* Check that the pseudos chosen by assign_parms a...
the corresponding default defs. */
else if (SSA_NAME_IS_DEFAULT_DEF (name)
&& (TREE_CODE (var) == PARM_DECL
|| TREE_CODE (var) == RESULT_DECL))
{
rtx in = DECL_RTL_IF_SET (var);
gcc_assert (in);
rtx out = SA.partition_to_pseudo[part];
gcc_assert (in == out);
/* Now reset VAR's RTL to IN, so that the _EXPR attrs...
those expected by debug backends for each parm and...
the result. This is particularly important for st...
whose register elimination from parm's DECL_RTL ma...
-fcompare-debug differences as SET_DECL_RTL change...
attrs. So, make sure the RTL already has the parm...
EXPR, so that it won't change. */
SET_DECL_RTL (var, NULL_RTX);
if (MEM_P (in))
set_mem_attributes (in, var, true);
SET_DECL_RTL (var, in);
}
}
-
--[[gcc-8.3/gcc/tree]]
--[[gcc-8.3/gcc/SSA_NAME_VAR()]]
--[[gcc-8.3/gcc/DECL_RTL_IF_SET()]]
--[[gcc-8.3/gcc/SET_DECL_RTL()]]
--[[gcc-8.3/gcc/SSA_NAME_IS_DEFAULT_DEF()]]
--[[gcc-8.3/gcc/TREE_CODE()]]
--[[gcc-8.3/gcc/rtx]]
--[[gcc-8.3/gcc/DECL_RTL_IF_SET()]]
--[[gcc-8.3/gcc/gcc_assert()]]
--[[gcc-8.3/gcc/SET_DECL_RTL()]]
--[[gcc-8.3/gcc/MEM_P()]]
--[[gcc-8.3/gcc/set_mem_attributes()]]
/* If this function is `main', emit a call to `__main'
to run global initializers, etc. */
if (DECL_NAME (current_function_decl)
&& MAIN_NAME_P (DECL_NAME (current_function_decl))
&& DECL_FILE_SCOPE_P (current_function_decl))
expand_main_function ();
-
--[[gcc-8.3/gcc/DECL_NAME()]]
--[[gcc-8.3/gcc/MAIN_NAME_P()]]
--[[gcc-8.3/gcc/DECL_FILE_SCOPE_P()]]
--[[gcc-8.3/gcc/expand_main_function()]]
/* Initialize the stack_protect_guard field. This mus...
call to __main (if any) so that the external decl i...
if (crtl->stack_protect_guard && targetm.stack_protect...
stack_protect_prologue ();
expand_phi_nodes (&SA);
-
--[[gcc-8.3/gcc/stack_protect_prologue()]]
--[[gcc-8.3/gcc/expand_phi_nodes()]]
/* Release any stale SSA redirection data. */
redirect_edge_var_map_empty ();
/* Register rtl specific functions for cfg. */
rtl_register_cfg_hooks ();
init_block = construct_init_block ();
-
--[[gcc-8.3/gcc/redirect_edge_var_map_empty()]]
--[[gcc-8.3/gcc/rtl_register_cfg_hooks()]]
--[[gcc-8.3/gcc/construct_init_block()]]
/* Clear EDGE_EXECUTABLE on the entry edge(s). It is ...
remaining edges later. */
FOR_EACH_EDGE (e, ei, ENTRY_BLOCK_PTR_FOR_FN (fun)->su...
e->flags &= ~EDGE_EXECUTABLE;
-
--[[gcc-8.3/gcc/FOR_EACH_EDGE()]]
--[[gcc-8.3/gcc/ENTRY_BLOCK_PTR_FOR_FN()]]
/* If the function has too many markers, drop them whi...
if (cfun->debug_marker_count
>= PARAM_VALUE (PARAM_MAX_DEBUG_MARKER_COUNT))
cfun->debug_nonbind_markers = false;
lab_rtx_for_bb = new hash_map<basic_block, rtx_code_la...
FOR_BB_BETWEEN (bb, init_block->next_bb, EXIT_BLOCK_PT...
next_bb)
bb = expand_gimple_basic_block (bb, var_ret_seq != N...
if (MAY_HAVE_DEBUG_BIND_INSNS)
expand_debug_locations ();
if (deep_ter_debug_map)
{
delete deep_ter_debug_map;
deep_ter_debug_map = NULL;
}
-
--[[gcc-8.3/gcc/PARAM_VALUE()]]
--[[gcc-8.3/gcc/lab_rtx_for_bb]]
--[[gcc-8.3/gcc/hashmap]]
--[[gcc-8.3/gcc/basic_block]]
--[[gcc-8.3/gcc/rtx_code_label]]
--[[gcc-8.3/gcc/FOR_BB_BETWEEN()]]
--[[gcc-8.3/gcc/EXIT_BLOCK_PTR_FOR_FN()]]
--[[gcc-8.3/gcc/expand_gimple_basic_block()]]
--[[gcc-8.3/gcc/expand_debug_locations()]]
/* Free stuff we no longer need after GIMPLE optimizat...
free_dominance_info (CDI_DOMINATORS);
free_dominance_info (CDI_POST_DOMINATORS);
delete_tree_cfg_annotations (fun);
timevar_push (TV_OUT_OF_SSA);
finish_out_of_ssa (&SA);
timevar_pop (TV_OUT_OF_SSA);
timevar_push (TV_POST_EXPAND);
/* We are no longer in SSA form. */
fun->gimple_df->in_ssa_p = false;
loops_state_clear (LOOP_CLOSED_SSA);
-
--[[gcc-8.3/gcc/free_dominance_info()]]
--[[gcc-8.3/gcc/delete_tree_cfg_annotations()]]
--[[gcc-8.3/gcc/finish_out_of_ssa()]]
--[[gcc-8.3/gcc/loops_state_clear()]]
/* Expansion is used by optimization passes too, set m...
conservatively to true until they are all profile a...
delete lab_rtx_for_bb;
free_histograms (fun);
construct_exit_block ();
insn_locations_finalize ();
if (var_ret_seq)
{
rtx_insn *after = return_label;
rtx_insn *next = NEXT_INSN (after);
if (next && NOTE_INSN_BASIC_BLOCK_P (next))
after = next;
emit_insn_after (var_ret_seq, after);
}
-
--[[gcc-8.3/gcc/free_histograms()]]
--[[gcc-8.3/gcc/construct_exit_block()]]
--[[gcc-8.3/gcc/insn_locations_finalize()]]
--[[gcc-8.3/gcc/rtx_insn]]
--[[gcc-8.3/gcc/NEXT_INSN()]]
--[[gcc-8.3/gcc/NOTE_INSN_BASIC_BLOCK_P()]]
--[[gcc-8.3/gcc/emit_insn_after()]]
/* Zap the tree EH table. */
set_eh_throw_stmt_table (fun, NULL);
-
--[[gcc-8.3/gcc/set_eh_throw_stmt_table()]]
/* We need JUMP_LABEL be set in order to redirect jump...
split edges which edge insertions might do. */
rebuild_jump_labels (get_insns ());
-
--[[gcc-8.3/gcc/rebuild_jump_labels()]]
--[[gcc-8.3/gcc/get_insns()]]
FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR_FOR_FN (fun),
EXIT_BLOCK_PTR_FOR_FN (fun), next_bb)
{
edge e;
edge_iterator ei;
for (ei = ei_start (bb->succs); (e = ei_safe_edge ...
{
if (e->insns.r)
{
rebuild_jump_labels_chain (e->insns.r);
/* Put insns after parm birth, but before
NOTE_INSNS_FUNCTION_BEG. */
if (e->src == ENTRY_BLOCK_PTR_FOR_FN (fun)
&& single_succ_p (ENTRY_BLOCK_PTR_FOR_FN (fun)))
{
rtx_insn *insns = e->insns.r;
e->insns.r = NULL;
if (NOTE_P (parm_birth_insn)
&& NOTE_KIND (parm_birth_insn) == NOTE_INSN_FUNC...
emit_insn_before_noloc (insns, parm_birth_insn, e-...
else
emit_insn_after_noloc (insns, parm_birth_insn, e->...
}
else
commit_one_edge_insertion (e);
}
else
ei_next (&ei);
}
}
-
--[[gcc-8.3/gcc/FOR_BB_BETWEEN()]]
--[[gcc-8.3/gcc/ENTRY_BLOCK_PTR_FOR_FN()]]
--[[gcc-8.3/gcc/edge]]
--[[gcc-8.3/gcc/edge_iterator]]
--[[gcc-8.3/gcc/ei_start()]]
--[[gcc-8.3/gcc/ei_safe_edge()]]
--[[gcc-8.3/gcc/rebuild_jump_labels_chain()]]
--[[gcc-8.3/gcc/single_succ_p()]]
--[[gcc-8.3/gcc/rtx_insn]]
--[[gcc-8.3/gcc/NOTE_P()]]
--[[gcc-8.3/gcc/NOTE_KIND()]]
--[[gcc-8.3/gcc/emit_insn_before_noloc()]]
--[[gcc-8.3/gcc/emit_insn_after_noloc()]]
--[[gcc-8.3/gcc/commit_one_edge_insertion()]]
--[[gcc-8.3/gcc/ei_next()]]
/* We're done expanding trees to RTL. */
currently_expanding_to_rtl = 0;
flush_mark_addressable_queue ();
FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR_FOR_FN (fun)->next...
EXIT_BLOCK_PTR_FOR_FN (fun), next_bb)
{
edge e;
edge_iterator ei;
for (ei = ei_start (bb->succs); (e = ei_safe_edge ...
{
/* Clear EDGE_EXECUTABLE. This flag is never used in...
e->flags &= ~EDGE_EXECUTABLE;
/* At the moment not all abnormal edges match the RTL
representation. It is safe to remove them here as
find_many_sub_basic_blocks will rediscover them.
In the future we should get this fixed properly. */
if ((e->flags & EDGE_ABNORMAL)
&& !(e->flags & EDGE_SIBCALL))
remove_edge (e);
else
ei_next (&ei);
}
}
auto_sbitmap blocks (last_basic_block_for_fn (fun));
bitmap_ones (blocks);
find_many_sub_basic_blocks (blocks);
purge_all_dead_edges ();
-
--[[gcc-8.3/gcc/flush_mark_addressable_queue()]]
--[[gcc-8.3/gcc/FOR_BB_BETWEEN()]]
--[[gcc-8.3/gcc/ENTRY_BLOCK_PTR_FOR_FN()]]
--[[gcc-8.3/gcc/edge]]
--[[gcc-8.3/gcc/edge_iterator]]
--[[gcc-8.3/gcc/ei_start()]]
--[[gcc-8.3/gcc/ei_safe_edge()]]
--[[gcc-8.3/gcc/remove_edge()]]
--[[gcc-8.3/gcc/ei_next()]]
--[[gcc-8.3/gcc/auto_sbitmap]]
--[[gcc-8.3/gcc/last_basic_block_for_fn()]]
--[[gcc-8.3/gcc/bitmap_ones()]]
--[[gcc-8.3/gcc/find_many_sub_basic_blocks()]]
--[[gcc-8.3/gcc/purge_all_dead_edges()]]
/* After initial rtl generation, call back to finish g...
exception support code. We need to do this before ...
the CFG as the code does not expect dead landing pa...
if (fun->eh->region_tree != NULL)
finish_eh_generation ();
-
--[[gcc-8.3/gcc/finish_eh_generation()]]
/* Call expand_stack_alignment after finishing all
updates to crtl->preferred_stack_boundary. */
expand_stack_alignment ();
-
--[[gcc-8.3/gcc/expand_stack_alignment()]]
/* Fixup REG_EQUIV notes in the prologue if there are ...
function. */
if (crtl->tail_call_emit)
fixup_tail_calls ();
-
--[[gcc-8.3/gcc/fixup_tail_calls()]]
/* BB subdivision may have created basic blocks that a...
from unlikely bbs but not marked as such in the pro...
if (optimize)
propagate_unlikely_bbs_forward ();
-
--[[gcc-8.3/gcc/propagate_unlikely_bbs_forward()]]
/* Remove unreachable blocks, otherwise we cannot comp...
which are needed for loop state verification. As a...
this also compacts blocks.
??? We cannot remove trivially dead insns here as ...
the DRAP reg on i?86 is not magically live at this ...
gcc.c-torture/execute/ipa-sra-2.c execution, -Os -m...
cleanup_cfg (CLEANUP_NO_INSN_DEL);
checking_verify_flow_info ();
-
--[[gcc-8.3/gcc/cleanup_cfg()]]
--[[gcc-8.3/gcc/checking_verify_flow_info()]]
/* Initialize pseudos allocated for hard registers. */
emit_initial_value_sets ();
/* And finally unshare all RTL. */
unshare_all_rtl ();
-
--[[gcc-8.3/gcc/emit_initial_value_sets()]]
--[[gcc-8.3/gcc/unshare_all_rtl()]]
/* There's no need to defer outputting this function a...
know we want to output it. */
DECL_DEFER_OUTPUT (current_function_decl) = 0;
-
--[[gcc-8.3/gcc/DECL_DEFER_OUTPUT()]]
/* Now that we're done expanding trees to RTL, we shou...
more CONCATs anywhere. */
generating_concat_p = 0;
if (dump_file)
{
fprintf (dump_file,
"\n\n;;\n;; Full RTL generated for this function...
/* And the pass manager will dump RTL for us. */
}
/* If we're emitting a nested function, make sure its ...
emitted as well. Doing otherwise confuses debug in...
{
tree parent;
for (parent = DECL_CONTEXT (current_function_decl);
parent != NULL_TREE;
parent = get_containing_scope (parent))
if (TREE_CODE (parent) == FUNCTION_DECL)
TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (parent))...
}
TREE_ASM_WRITTEN (current_function_decl) = 1;
-
--[[gcc-8.3/gcc/tree]]
--[[gcc-8.3/gcc/DECL_CONTEXT()]]
--[[gcc-8.3/gcc/get_containing_scope()]]
--[[gcc-8.3/gcc/TREE_CODE()]]
--[[gcc-8.3/gcc/TREE_SYMBOL_REFERENCED()]]
--[[gcc-8.3/gcc/DECL_ASSEMBLER_NAME()]]
/* After expanding, the return labels are no longer ne...
return_label = NULL;
naked_return_label = NULL;
/* After expanding, the tm_restart map is no longer ne...
if (fun->gimple_df->tm_restart)
fun->gimple_df->tm_restart = NULL;
/* Tag the blocks with a depth number so that change_s...
the common parent easily. */
set_block_levels (DECL_INITIAL (fun->decl), 0);
default_rtl_profile ();
-
--[[gcc-8.3/gcc/set_block_levels()]]
--[[gcc-8.3/gcc/DECL_INITIAL()]]
--[[gcc-8.3/gcc/default_rtl_profile()]]
/* For -dx discard loops now, otherwise IL verify in c...
ICE. */
if (rtl_dump_and_exit)
{
cfun->curr_properties &= ~PROP_loops;
loop_optimizer_finalize ();
}
timevar_pop (TV_POST_EXPAND);
return 0;
}
-
--[[gcc-8.3/gcc/loop_optimizer_finalize()]]
*コメント [#g3ab2476]
ページ名: