GCC Middle and Back End API Reference
|
Functions | |
static void * | df_get_bb_info (struct dataflow *, unsigned int) |
static void | df_set_bb_info (struct dataflow *, unsigned int, void *) |
static void | df_clear_bb_info (struct dataflow *, unsigned int) |
static void | df_set_clean_cfg (void) |
void | df_add_problem () |
int | df_set_flags () |
int | df_clear_flags () |
void | df_set_blocks () |
void | df_remove_problem () |
void | df_finish_pass () |
static unsigned int | rest_of_handle_df_initialize () |
static bool | gate_opt () |
rtl_opt_pass * | make_pass_df_initialize_opt () |
static bool | gate_no_opt () |
rtl_opt_pass * | make_pass_df_initialize_no_opt () |
static unsigned int | rest_of_handle_df_finish () |
rtl_opt_pass * | make_pass_df_finish () |
static bool | df_worklist_propagate_forward (struct dataflow *dataflow, unsigned bb_index, unsigned *bbindex_to_postorder, bitmap pending, sbitmap considered, ptrdiff_t age) |
static bool | df_worklist_propagate_backward (struct dataflow *dataflow, unsigned bb_index, unsigned *bbindex_to_postorder, bitmap pending, sbitmap considered, ptrdiff_t age) |
static void | df_worklist_dataflow_doublequeue (struct dataflow *dataflow, bitmap pending, sbitmap considered, int *blocks_in_postorder, unsigned *bbindex_to_postorder, int n_blocks) |
void | df_worklist_dataflow (struct dataflow *dataflow, bitmap blocks_to_consider, int *blocks_in_postorder, int n_blocks) |
static unsigned | df_prune_to_subcfg () |
void | df_analyze_problem (struct dataflow *dflow, bitmap blocks_to_consider, int *postorder, int n_blocks) |
void | df_analyze () |
int | df_get_n_blocks () |
int * | df_get_postorder () |
void | df_simple_dataflow (enum df_flow_dir dir, df_init_function init_fun, df_confluence_function_0 con_fun_0, df_confluence_function_n con_fun_n, df_transfer_function trans_fun, bitmap blocks, int *postorder, int n_blocks) |
static void * | df_get_bb_info () |
static void | df_clear_bb_info () |
void | df_mark_solutions_dirty () |
bool | df_get_bb_dirty () |
void | df_set_bb_dirty () |
void | df_grow_bb_info () |
static void | df_clear_bb_dirty () |
void | df_compact_blocks () |
void | df_bb_replace () |
void | df_bb_delete () |
void | df_verify () |
static int * | df_compute_cfg_image () |
void | df_check_cfg_clean () |
df_ref | df_bb_regno_first_def_find () |
df_ref | df_bb_regno_last_def_find () |
df_ref | df_find_def () |
bool | df_reg_defined () |
df_ref | df_find_use () |
bool | df_reg_used () |
void | dump_regset () |
void | debug_regset (regset) |
DEBUG_FUNCTION void | debug_regset () |
void | df_print_regset () |
void | df_print_word_regset () |
void | df_dump () |
void | df_dump_region () |
void | df_dump_start () |
static void | df_dump_bb_problem_data () |
void | df_dump_top () |
void | df_dump_bottom () |
static void | df_dump_insn_problem_data () |
void | df_dump_insn_top () |
void | df_dump_insn_bottom () |
static void | df_ref_dump () |
void | df_refs_chain_dump () |
void | df_regs_chain_dump () |
static void | df_mws_dump () |
static void | df_insn_uid_debug (unsigned int uid, bool follow_chain, FILE *file) |
DEBUG_FUNCTION void | df_insn_debug () |
DEBUG_FUNCTION void | df_insn_debug_regno () |
DEBUG_FUNCTION void | df_regno_debug () |
DEBUG_FUNCTION void | df_ref_debug () |
DEBUG_FUNCTION void | debug_df_insn () |
DEBUG_FUNCTION void | debug_df_reg () |
DEBUG_FUNCTION void | debug_df_regno () |
DEBUG_FUNCTION void | debug_df_ref () |
DEBUG_FUNCTION void | debug_df_defno () |
DEBUG_FUNCTION void | debug_df_useno () |
DEBUG_FUNCTION void | debug_df_chain () |
Variables | |
struct bitmap_obstack | reg_obstack |
bitmap_obstack | df_bitmap_obstack |
struct df_d * | df |
static struct df_problem | user_problem |
static struct dataflow | user_dflow |
static int * | saved_cfg = NULL |
DEBUG_FUNCTION void debug_df_chain | ( | ) |
References df_chain_dump().
DEBUG_FUNCTION void debug_df_defno | ( | ) |
References df_ref_debug().
DEBUG_FUNCTION void debug_df_insn | ( | ) |
Functions for debugging from GDB.
References debug_rtx(), and df_insn_debug().
DEBUG_FUNCTION void debug_df_ref | ( | ) |
References df_ref_debug().
DEBUG_FUNCTION void debug_df_reg | ( | ) |
References df_regno_debug().
DEBUG_FUNCTION void debug_df_regno | ( | ) |
References df_regno_debug().
DEBUG_FUNCTION void debug_df_useno | ( | ) |
References df_ref_debug().
void debug_regset | ( | regset | ) |
Print a human-readable representation of R on the standard error stream. This function is designed to be used from within the debugger.
DEBUG_FUNCTION void debug_regset | ( | ) |
References dump_regset().
void df_add_problem | ( | ) |
Add PROBLEM (and any dependent problems) to the DF instance.
References dataflow::computed, df_problem::dependent_problem, df_problem::id, df_d::num_problems_defined, dataflow::problem, df_d::problems_by_index, df_d::problems_in_order, and dataflow::solutions_dirty.
Referenced by df_chain_add_problem(), df_live_add_problem(), df_lr_add_problem(), df_md_add_problem(), df_note_add_problem(), df_rd_add_problem(), df_scan_add_problem(), and df_word_lr_add_problem().
void df_analyze | ( | void | ) |
Analyze dataflow info for the basic blocks specified by the bitmap BLOCKS, or for the whole CFG if BLOCKS is zero.
References df_d::analyze_subset, bitmap_and_into(), bitmap_bit_p(), bitmap_set_bit(), df_d::blocks_to_analyze, df_d::changeable_flags, df_analyze_problem(), df_compute_regs_ever_live(), DF_FORWARD, df_process_deferred_rescans(), df_prune_to_subcfg(), df_set_clean_cfg(), df_verify(), DF_VERIFY_SCHEDULED, df_problem::dir, dump_file, free(), inverted_post_order_compute(), df_d::n_blocks, df_d::n_blocks_inverted, df_d::num_problems_defined, post_order_compute(), df_d::postorder, df_d::postorder_inverted, dataflow::problem, df_d::problems_in_order, and dataflow::solutions_dirty.
Referenced by branch_target_load_optimize(), build_single_def_use_links(), copyprop_hardreg_forward(), cse_main(), do_reload(), execute_compare_elim_after_reload(), execute_rtl_cprop(), execute_rtl_hoist(), execute_rtl_pre(), execute_rtl_store_motion(), find_and_remove_re(), find_defs(), find_moveable_pseudos(), if_convert(), init_dce(), initialize_uninitialized_regs(), ira(), ira_build(), iv_analysis_loop_init(), move_loop_invariants(), one_cprop_pass(), optimize_mode_switching(), partition_hot_cold_basic_blocks(), peephole2_optimize(), reg_to_stack(), regmove_optimize(), regrename_optimize(), reorder_loops(), reorg_loops(), rest_of_handle_auto_inc_dec(), rest_of_handle_combine(), rest_of_handle_dse(), rest_of_handle_stack_adjustments(), rest_of_pass_free_cfg(), sched_init(), thread_prologue_and_epilogue_insns(), try_optimize_cfg(), and web_main().
void df_analyze_problem | ( | struct dataflow * | dflow, |
bitmap | blocks_to_consider, | ||
int * | postorder, | ||
int | n_blocks | ||
) |
Execute dataflow analysis on a single dataflow problem. BLOCKS_TO_CONSIDER are the blocks whose solution can either be examined or will be computed. For calls from DF_ANALYZE, this is the set of blocks that has been passed to DF_SET_BLOCKS.
References df_problem::alloc_fun, dataflow::computed, df_problem::dataflow_fun, df_problem::finalize_fun, df_problem::local_compute_fun, dataflow::problem, timevar_pop(), timevar_push(), df_problem::tv_id, df_problem::verify_end_fun, and df_problem::verify_start_fun.
Referenced by df_analyze(), and fast_dce().
void df_bb_delete | ( | ) |
Free all of the per basic block dataflow from all of the problems. This is typically called before a basic block is deleted and the problem will be reanalyzed.
References df_clear_bb_dirty(), df_clear_bb_info(), df_get_bb_info(), df_mark_solutions_dirty(), df_problem::free_bb_fun, df_d::num_problems_defined, dataflow::problem, and df_d::problems_in_order.
Referenced by cfg_layout_merge_blocks(), rtl_delete_block(), and rtl_merge_blocks().
df_ref df_bb_regno_first_def_find | ( | ) |
Return first def of REGNO within BB.
Referenced by add_cross_iteration_register_deps(), create_ddg_dep_from_intra_loop_link(), and use_killed_between().
df_ref df_bb_regno_last_def_find | ( | ) |
Return last def of REGNO within BB.
Referenced by use_killed_between().
void df_bb_replace | ( | ) |
Shove NEW_BLOCK in at OLD_INDEX. Called from ifcvt to hack a block. There is no excuse for people to do this kind of thing.
References dataflow::block_info, df_clear_bb_dirty(), df_get_bb_info(), df_grow_bb_info(), df_set_bb_dirty(), df_set_bb_info(), dump_file, basic_block_def::index, df_d::num_problems_defined, and df_d::problems_in_order.
Referenced by find_if_case_1().
void df_check_cfg_clean | ( | void | ) |
This function compares the saved version of the cfg with the current cfg and aborts if the two are identical. The function silently returns if the cfg has been marked as dirty or the two are the same.
References df_compute_cfg_image(), free(), and saved_cfg.
|
static |
Clear the dirty bits. This is called from places that delete blocks.
References bitmap_clear_bit(), basic_block_def::index, df_d::num_problems_defined, dataflow::out_of_date_transfer_functions, and df_d::problems_in_order.
Referenced by df_bb_delete(), and df_bb_replace().
|
static |
Referenced by df_bb_delete(), and df_set_blocks().
|
static |
Clear basic block info.
References dataflow::block_info, df_problem::block_info_elt_size, dataflow::block_info_size, memset(), and dataflow::problem.
int df_clear_flags | ( | ) |
Clear the MASK flags in the DFLOW problem. The old flags are returned. If a flag is not allowed to be changed this will fail if checking is enabled.
References df_d::changeable_flags.
Referenced by df_insn_rescan_all(), df_lr_finalize(), df_process_deferred_rescans(), fast_dce(), if_convert(), ira(), run_fast_df_dce(), run_word_dce(), and sched_init().
void df_compact_blocks | ( | void | ) |
Called from the rtl_compact_blocks to reorganize the problems basic block info.
References bitmap_bit_p(), bitmap_clear(), bitmap_copy(), bitmap_set_bit(), dataflow::block_info, df_problem::block_info_elt_size, df_d::blocks_to_analyze, df_grow_bb_info(), df_set_bb_info(), df_set_clean_cfg(), free(), df_problem::free_bb_fun, basic_block_def::index, memcpy(), memset(), df_d::num_problems_defined, dataflow::out_of_date_transfer_functions, dataflow::problem, and df_d::problems_in_order.
Referenced by compact_blocks().
|
static |
Compute an array of ints that describes the cfg. This can be used to discover places where the cfg is modified by the appropriate calls have not been made to the keep df informed. The internals of this are unexciting, the key is that two instances of this can be compared to see if any changes have been made to the cfg.
References edge_def::dest, basic_block_def::index, map, and basic_block_def::succs.
Referenced by df_check_cfg_clean(), and df_set_clean_cfg().
void df_dump | ( | ) |
Dump dataflow info.
References df_dump_bottom(), df_dump_start(), df_dump_top(), and df_print_bb_index().
Referenced by df_dump_region(), init_dce(), initialize_uninitialized_regs(), and rtl_unroll_and_peel_loops().
|
static |
Dump the top or bottom of the block information for BB.
References dataflow::computed, df_problem::dump_bottom_fun, df_problem::dump_top_fun, df_d::num_problems_defined, dataflow::problem, and df_d::problems_in_order.
Referenced by df_dump_bottom(), and df_dump_top().
void df_dump_bottom | ( | ) |
Dump the bottom of the block information for BB.
References df_dump_bb_problem_data().
Referenced by df_dump(), print_rtl_with_bb(), and rtl_dump_bb().
void df_dump_insn_bottom | ( | ) |
Dump information about INSN after dumping INSN itself.
References df_dump_insn_problem_data().
Referenced by print_rtl_with_bb(), and rtl_dump_bb().
|
static |
Dump information about INSN just before or after dumping INSN itself.
References dataflow::computed, df_problem::dump_insn_bottom_fun, df_problem::dump_insn_top_fun, df_d::num_problems_defined, dataflow::problem, and df_d::problems_in_order.
Referenced by df_dump_insn_bottom(), and df_dump_insn_top().
void df_dump_insn_top | ( | ) |
Dump information about INSN before dumping INSN itself.
References df_dump_insn_problem_data().
Referenced by print_rtl_with_bb(), and rtl_dump_bb().
void df_dump_region | ( | ) |
Dump dataflow info for df->blocks_to_analyze.
References df_d::blocks_to_analyze, df_dump(), df_dump_start(), and dump_bb().
Referenced by find_defs(), and iv_analysis_loop_init().
void df_dump_start | ( | ) |
Dump the introductory information for each problem defined.
References df_d::blocks_to_analyze, dataflow::computed, current_function_name(), df_problem::dump_start_fun, df_d::num_problems_defined, dataflow::problem, and df_d::problems_in_order.
Referenced by df_dump(), df_dump_region(), and print_rtl_with_bb().
void df_dump_top | ( | ) |
Dump the top of the block information for BB.
References df_dump_bb_problem_data().
Referenced by df_dump(), print_rtl_with_bb(), and rtl_dump_bb().
df_ref df_find_def | ( | ) |
Finds the reference corresponding to the definition of REG in INSN. DF is the dataflow object.
Referenced by biv_p(), df_reg_defined(), find_invariant_insn(), and iv_analyze_result().
df_ref df_find_use | ( | ) |
Finds the reference corresponding to the use of REG in INSN. DF is the dataflow object.
References df_d::changeable_flags, and DF_EQ_NOTES.
Referenced by df_reg_used(), hash_invariant_expr_1(), invariant_expr_equal_p(), iv_analyze(), and iv_get_reaching_def().
void df_finish_pass | ( | ) |
Remove all of the problems that are not permanent. Scanning, LR and (at -O2 or higher) LIVE are permanent, the rest are removable. Also clear all of the changeable_flags.
References df_d::analyze_subset, df_d::blocks_to_analyze, df_d::changeable_flags, df_live_verify_transfer_functions(), df_lr_verify_transfer_functions(), df_mark_solutions_dirty(), df_maybe_reorganize_def_refs(), df_maybe_reorganize_use_refs(), DF_NO_INSN_RESCAN, df_process_deferred_rescans(), DF_REF_ORDER_NO_TABLE, df_set_clean_cfg(), DF_VERIFY_SCHEDULED, df_problem::id, df_d::num_problems_defined, dataflow::optional_p, dataflow::problem, df_d::problems_by_index, df_d::problems_in_order, and df_problem::remove_problem_fun.
Referenced by do_reload(), execute_todo(), iv_analysis_done(), and partition_hot_cold_basic_blocks().
bool df_get_bb_dirty | ( | ) |
Return true if BB needs it's transfer functions recomputed.
References bitmap_bit_p(), basic_block_def::index, and dataflow::out_of_date_transfer_functions.
Referenced by find_if_header(), if_convert(), and try_head_merge_bb().
|
static |
@verbatim Allocation for dataflow support routines.
Copyright (C) 1999-2013 Free Software Foundation, Inc. Originally contributed by Michael P. Hayes (m.hay, es@e lec.c ante rbury .ac. nzmhaye) Major rewrite contributed by Danny Berlin ( s@re dhat. comdberl) and Kenneth Zadeck ( in@d berli n.or gzadec). k@na tural brid ge.co m
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.
GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see http://www.gnu.org/licenses/.
Referenced by df_bb_delete(), df_bb_replace(), and df_set_blocks().
|
static |
Get basic block info.
References dataflow::block_info, df_problem::block_info_elt_size, dataflow::block_info_size, and dataflow::problem.
int df_get_n_blocks | ( | ) |
Return the number of basic blocks from the last call to df_analyze.
References DF_FORWARD, DF_NONE, df_d::n_blocks, df_d::n_blocks_inverted, df_d::postorder, and df_d::postorder_inverted.
Referenced by dse_step4(), and fast_dce().
int* df_get_postorder | ( | ) |
Return a pointer to the array of basic blocks in the reverse postorder. Depending on the direction of the dataflow problem, it returns either the usual reverse postorder array or the reverse postorder of inverted traversal.
References DF_FORWARD, DF_NONE, df_d::postorder, and df_d::postorder_inverted.
Referenced by dse_step4(), and fast_dce().
void df_grow_bb_info | ( | ) |
Grow the bb_info array.
References dataflow::block_info, df_problem::block_info_elt_size, dataflow::block_info_size, memset(), and dataflow::problem.
Referenced by df_bb_refs_record(), df_bb_replace(), df_compact_blocks(), df_insn_delete(), df_insn_rescan(), df_lr_alloc(), df_md_alloc(), df_notes_rescan(), df_rd_alloc(), df_scan_alloc(), and df_word_lr_alloc().
DEBUG_FUNCTION void df_insn_debug | ( | ) |
References df_insn_uid_debug().
Referenced by debug_df_insn(), and df_scan_start_block().
DEBUG_FUNCTION void df_insn_debug_regno | ( | ) |
References df_refs_chain_dump().
|
static |
References df_mws_dump(), and df_refs_chain_dump().
Referenced by df_insn_debug().
void df_mark_solutions_dirty | ( | void | ) |
Mark the solutions as being out of date.
References df_d::num_problems_defined, df_d::problems_in_order, and dataflow::solutions_dirty.
Referenced by connect_dest(), connect_src(), df_bb_delete(), df_finish_pass(), df_set_bb_dirty(), df_set_blocks(), disconnect_dest(), disconnect_src(), force_nonfallthru_and_redirect(), and move_block_after_check().
|
static |
Referenced by df_insn_uid_debug().
void df_print_regset | ( | ) |
Write information about registers and basic blocks into FILE. This is part of making a debugging dump.
Referenced by dce_process_block(), df_entry_block_bitmap_verify(), df_exit_block_bitmap_verify(), df_live_bottom_dump(), df_live_top_dump(), df_lr_bottom_dump(), df_lr_top_dump(), df_md_bottom_dump(), df_md_top_dump(), df_note_bb_compute(), df_scan_start_dump(), df_set_dead_notes_for_mw(), and replace_read().
void df_print_word_regset | ( | ) |
Write information about registers and basic blocks into FILE. The bitmap is in the form used by df_byte_lr. This is part of making a debugging dump.
References bitmap_bit_p(), and max_reg_num().
Referenced by df_word_lr_bottom_dump(), df_word_lr_top_dump(), and word_dce_process_block().
|
static |
Remove the entries not in BLOCKS from the LIST of length LEN, preserving the order of the remaining entries. Returns the length of the resulting list.
References bitmap_bit_p(), last, and len.
Referenced by df_analyze().
DEBUG_FUNCTION void df_ref_debug | ( | ) |
References df_chain_dump().
Referenced by debug_df_defno(), debug_df_ref(), debug_df_useno(), df_create_unused_note(), df_install_ref_incremental(), df_note_bb_compute(), and df_ref_remove().
|
static |
References DF_REF_IN_NOTE.
Referenced by df_refs_chain_dump(), and df_regs_chain_dump().
void df_refs_chain_dump | ( | ) |
References df_chain_dump(), and df_ref_dump().
Referenced by df_insn_debug_regno(), df_insn_uid_debug(), and df_scan_start_block().
bool df_reg_defined | ( | ) |
Return true if REG is defined in INSN, zero otherwise.
References df_find_def().
bool df_reg_used | ( | ) |
Return true if REG is referenced in INSN, zero otherwise.
References df_find_use().
DEBUG_FUNCTION void df_regno_debug | ( | ) |
References df_regs_chain_dump().
Referenced by debug_df_reg(), and debug_df_regno().
void df_regs_chain_dump | ( | ) |
void df_remove_problem | ( | ) |
Delete a DFLOW problem (and any problems that depend on this problem).
References df_problem::dependent_problem, df_problem::id, df_d::num_problems_defined, dataflow::problem, df_d::problems_by_index, df_d::problems_in_order, and df_problem::remove_problem_fun.
Referenced by find_defs(), if_convert(), initialize_uninitialized_regs(), ira(), iv_analysis_loop_init(), and rest_of_handle_ud_dce().
void df_set_bb_dirty | ( | ) |
Mark BB as needing it's transfer functions as being out of date.
References bitmap_set_bit(), df_mark_solutions_dirty(), basic_block_def::flags, basic_block_def::index, df_d::num_problems_defined, dataflow::out_of_date_transfer_functions, and df_d::problems_in_order.
Referenced by cfg_layout_redirect_edge_and_branch(), df_bb_refs_record(), df_bb_replace(), df_insn_change_bb(), df_insn_delete(), df_insn_rescan(), df_install_ref_incremental(), df_ref_change_reg_with_loc_1(), df_ref_remove(), df_scan_blocks(), df_update_entry_block_defs(), df_update_exit_block_uses(), emit_insn_after_1(), find_cond_trap(), find_if_case_1(), find_if_case_2(), merge_blocks_move_predecessor_nojumps(), merge_if_block(), purge_dead_edges(), reorder_insns(), rtl_redirect_edge_and_branch(), rtl_redirect_edge_and_branch_force(), rtl_split_block(), rtl_split_edge(), sms_schedule(), try_crossjump_to_edge(), and try_head_merge_bb().
|
static |
Set basic block info.
References dataflow::block_info, df_problem::block_info_elt_size, memcpy(), and dataflow::problem.
Referenced by df_bb_replace(), and df_compact_blocks().
void df_set_blocks | ( | ) |
Set the blocks that are to be considered for analysis. If this is not called or is called with null, the entire function in analyzed.
References df_d::analyze_subset, bitmap_and_compl(), bitmap_clear(), bitmap_copy(), bitmap_print(), bitmap_set_bit(), df_d::blocks_to_analyze, df_clear_bb_info(), df_get_bb_info(), df_mark_solutions_dirty(), df_maybe_reorganize_def_refs(), df_maybe_reorganize_use_refs(), DF_REF_ORDER_NO_TABLE, dump_file, df_problem::free_bb_fun, df_problem::free_blocks_on_set_blocks, basic_block_def::index, initialized, df_d::num_problems_defined, dataflow::optional_p, dataflow::problem, df_d::problems_in_order, and df_problem::reset_fun.
Referenced by find_defs(), and iv_analysis_loop_init().
|
static |
This function builds a cfg fingerprint and squirrels it away in saved_cfg.
References df_compute_cfg_image(), free(), and saved_cfg.
Referenced by df_analyze(), df_compact_blocks(), and df_finish_pass().
int df_set_flags | ( | ) |
Set the MASK flags in the DFLOW problem. The old flags are returned. If a flag is not allowed to be changed this will fail if checking is enabled.
References df_d::changeable_flags.
Referenced by build_single_def_use_links(), cse_main(), decompose_multiword_subregs(), df_insn_rescan_all(), df_lr_finalize(), df_process_deferred_rescans(), do_reload(), execute_rtl_cprop(), fast_dce(), find_and_remove_re(), find_defs(), fwprop_init(), if_convert(), init_dce(), iv_analysis_loop_init(), lra(), move_loop_invariants(), partition_hot_cold_basic_blocks(), peephole2_optimize(), regrename_optimize(), rest_of_handle_combine(), rest_of_handle_dse(), rest_of_match_asm_constraints(), run_fast_df_dce(), run_word_dce(), sched_init(), and web_main().
void df_simple_dataflow | ( | enum df_flow_dir | dir, |
df_init_function | init_fun, | ||
df_confluence_function_0 | con_fun_0, | ||
df_confluence_function_n | con_fun_n, | ||
df_transfer_function | trans_fun, | ||
bitmap | blocks, | ||
int * | postorder, | ||
int | n_blocks | ||
) |
Interface for calling iterative dataflow with user defined confluence and transfer functions. All that is necessary is to supply DIR, a direction, CONF_FUN_0, a confluence function for blocks with no logical preds (or NULL), CONF_FUN_N, the normal confluence function, TRANS_FUN, the basic block transfer function, and BLOCKS, the set of blocks to examine, POSTORDER the blocks in postorder, and N_BLOCKS, the number of blocks in POSTORDER.
References df_problem::con_fun_0, df_problem::con_fun_n, df_worklist_dataflow(), df_problem::dir, df_problem::init_fun, memset(), dataflow::problem, df_problem::trans_fun, user_dflow, and user_problem.
Referenced by dse_step4().
void df_verify | ( | void | ) |
Verify that there is a place for everything and everything is in its place. This is too expensive to run after every pass in the mainline. However this is an excellent debugging tool if the dataflow information is not being updated properly. You can just sprinkle calls in until you find the place that is changing an underlying structure without calling the proper updating routine.
References df_live_verify_transfer_functions(), df_lr_verify_transfer_functions(), and df_scan_verify().
Referenced by df_analyze().
void df_worklist_dataflow | ( | struct dataflow * | dataflow, |
bitmap | blocks_to_consider, | ||
int * | blocks_in_postorder, | ||
int | n_blocks | ||
) |
Worklist-based dataflow solver. It uses sbitmap as a worklist, with "n"-th bit representing the n-th block in the reverse-postorder order. The solver is a double-queue algorithm similar to the "double stack" solver from Cooper, Harvey and Kennedy, "Iterative data-flow analysis, Revisited". The only significant difference is that the worklist in this implementation is always sorted in RPO of the CFG visiting direction.
References bitmap_clear(), bitmap_set_bit(), DF_NONE, df_worklist_dataflow_doublequeue(), df_problem::dir, free(), df_problem::init_fun, dataflow::problem, sbitmap_alloc(), and sbitmap_free().
Referenced by df_lr_finalize(), and df_simple_dataflow().
|
static |
Main dataflow solver loop. DATAFLOW is problem we are solving, PENDING is worklist of basic blocks we need to visit. BLOCK_IN_POSTORDER is array of size N_BLOCKS specifying postorder in BBs and BBINDEX_TO_POSTORDER is array mapping back BB->index to postorder position. PENDING will be freed. The worklists are bitmaps indexed by postorder positions. The function implements standard algorithm for dataflow solving with two worklists (we are processing WORKLIST and storing new BBs to visit in PENDING). As an optimization we maintain ages when BB was changed (stored in bb->aux) and when it was last visited (stored in last_visit_age). This avoids need to re-do confluence function for edges to basic blocks whose source did not change since destination was visited last time.
References basic_block_def::aux, bitmap_clear(), bitmap_clear_bit(), bitmap_empty_p(), changed, DF_FORWARD, df_worklist_propagate_backward(), df_worklist_propagate_forward(), df_problem::dir, dump_file, dataflow::problem, vNULL, and worklist.
Referenced by df_worklist_dataflow().
|
static |
Helper function for df_worklist_dataflow. Propagate the dataflow backward.
References bitmap_bit_p(), bitmap_set_bit(), changed, df_problem::con_fun_0, df_problem::con_fun_n, edge_def::dest, basic_block_def::index, basic_block_def::preds, dataflow::problem, edge_def::src, basic_block_def::succs, and df_problem::trans_fun.
Referenced by df_worklist_dataflow_doublequeue().
|
static |
Helper function for df_worklist_dataflow. Propagate the dataflow forward. Given a BB_INDEX, do the dataflow propagation and set bits on for successors in PENDING if the out set of the dataflow has changed. AGE specify time when BB was visited last time. AGE of 0 means we are visiting for first time and need to compute transfer function to initialize datastructures. Otherwise we re-do transfer function only if something change while computing confluence functions. We need to compute confluence only of basic block that are younger then last visit of the BB. Return true if BB info has changed. This is always the case in the first visit.
References bitmap_bit_p(), bitmap_set_bit(), changed, df_problem::con_fun_0, df_problem::con_fun_n, edge_def::dest, basic_block_def::index, basic_block_def::preds, dataflow::problem, edge_def::src, basic_block_def::succs, and df_problem::trans_fun.
Referenced by df_worklist_dataflow_doublequeue().
void dump_regset | ( | ) |
Write information about registers and basic blocks into FILE. This is part of making a debugging dump.
Referenced by debug_regset().
|
static |
|
static |
rtl_opt_pass* make_pass_df_finish | ( | ) |
rtl_opt_pass* make_pass_df_initialize_no_opt | ( | ) |
rtl_opt_pass* make_pass_df_initialize_opt | ( | ) |
|
static |
Free all the dataflow info and the DF structure. This should be called from the df_finish macro which also NULLs the parm.
References bitmap_obstack_release(), free(), df_problem::free_fun, df_d::hard_regs_live_count, df_d::num_problems_defined, df_d::postorder, df_d::postorder_inverted, dataflow::problem, and df_d::problems_in_order.
|
static |
Set up the dataflow instance for the entire back end.
References bitmap_obstack_initialize(), df_d::changeable_flags, df_compute_regs_ever_live(), df_hard_reg_init(), df_live_add_problem(), df_lr_add_problem(), df_scan_add_problem(), df_scan_alloc(), df_scan_blocks(), df_d::hard_regs_live_count, inverted_post_order_compute(), df_d::n_blocks, df_d::n_blocks_inverted, post_order_compute(), df_d::postorder, and df_d::postorder_inverted.
struct df_d* df |
This is used for debugging and for the dumpers to find the latest instance so that the df info can be added to the dumps. This should not be used by regular code.
Referenced by compact_blocks(), create_task_copyfn(), decompose_multiword_subregs(), df_add_refs_to_table(), df_bb_refs_collect(), df_bb_refs_record(), df_chain_bb_dump(), df_chain_create_bb(), df_chain_create_bb_process_use(), df_chain_insn_bottom_dump(), df_chain_insn_top_dump(), df_compute_regs_ever_live(), df_count_refs(), df_entry_block_bitmap_verify(), df_exit_block_bitmap_verify(), df_get_call_refs(), df_grow_insn_info(), df_grow_reg_info(), df_hard_reg_used_count(), df_hard_reg_used_p(), df_insn_change_bb(), df_insn_delete(), df_insn_info_delete(), df_insn_rescan(), df_insn_rescan_all(), df_insn_rescan_debug_internal(), df_install_ref(), df_install_ref_incremental(), df_install_refs(), df_live_verify_transfer_functions(), df_lr_confluence_0(), df_lr_confluence_n(), df_lr_finalize(), df_lr_local_compute(), df_lr_verify_transfer_functions(), df_maybe_reorganize_def_refs(), df_maybe_reorganize_use_refs(), df_md_bb_local_compute(), df_md_bb_local_compute_process_def(), df_md_simulate_one_insn(), df_notes_rescan(), df_process_deferred_rescans(), df_rd_bb_local_compute(), df_rd_bb_local_compute_process_def(), df_rd_dump_defs_set(), df_rd_local_compute(), df_rd_simulate_one_insn(), df_rd_start_dump(), df_rd_transfer_function(), df_ref_change_reg_with_loc(), df_ref_create_structure(), df_ref_record(), df_refs_add_to_chains(), df_reg_chain_unlink(), df_reorganize_refs_by_insn(), df_reorganize_refs_by_reg(), df_reorganize_refs_by_reg_by_insn(), df_reorganize_refs_by_reg_by_reg(), df_scan_alloc(), df_scan_blocks(), df_scan_free(), df_scan_free_internal(), df_scan_start_dump(), df_scan_verify(), df_set_regs_ever_live(), df_simulate_fixup_sets(), df_update_entry_block_defs(), df_update_exit_block_uses(), df_word_lr_local_compute(), dump_reg_info(), fast_dce(), find_invariants_to_move(), ira(), latch_dominating_def(), notice_stack_pointer_modification(), print_rtl_with_bb(), reginfo_init(), remove_edge_and_dominated_blocks(), remove_reg_equal_equiv_notes_for_regno(), and rtl_dump_bb().
bitmap_obstack df_bitmap_obstack |
An obstack for bitmap not related to specific dataflow problems. This obstack should e.g. be used for bitmaps with a short life time such as temporary bitmaps.
Referenced by df_chain_add_problem(), df_entry_block_bitmap_verify(), df_exit_block_bitmap_verify(), df_insn_rescan_all(), df_live_add_problem(), df_lr_add_problem(), df_note_compute(), df_process_deferred_rescans(), df_rd_confluence_n(), df_rd_dump_defs_set(), df_rd_local_compute(), df_rd_transfer_function(), df_scan_verify(), df_update_entry_block_defs(), df_update_exit_block_uses(), df_word_lr_add_problem(), regstat_compute_calls_crossed(), and regstat_compute_ri().
struct bitmap_obstack reg_obstack |
The obstack on which regsets are allocated.
Referenced by assign_by_spills(), assign_spill_hard_regs(), calculate_bb_reg_pressure(), calculate_loop_reg_pressure(), can_move_insns_across(), dead_or_predicable(), dse_step0(), dse_step1(), expand_function(), find_exits(), init_deps_global(), initialize_lra_reg_info_element(), lra(), lra_assign(), lra_coalesce(), lra_constraints(), lra_eliminate(), lra_inheritance(), lra_undo_inheritance(), peephole2_optimize(), remove_scratches(), replace_read(), simplify_using_initial_values(), spill_pseudos(), undo_optional_reloads(), and update_bad_spill_attribute().
|
static |
Referenced by df_check_cfg_clean(), and df_set_clean_cfg().
|
static |
Referenced by df_simple_dataflow().
|
static |
Referenced by df_simple_dataflow().