|
GCC Middle and Back End API Reference
|
#include "config.h"#include "system.h"#include "coretypes.h"#include "backend.h"#include "rtl.h"#include "df.h"#include "memmodel.h"#include "emit-rtl.h"#include "cfganal.h"#include "tree-pass.h"#include "cfgloop.h"
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) |
| void | df_add_problem (const struct df_problem *problem) |
| int | df_set_flags (int changeable_flags) |
| int | df_clear_flags (int changeable_flags) |
| void | df_set_blocks (bitmap blocks) |
| void | df_remove_problem (struct dataflow *dflow) |
| void | df_finish_pass (bool verify) |
| static unsigned int | rest_of_handle_df_initialize (void) |
| rtl_opt_pass * | make_pass_df_initialize_opt (gcc::context *ctxt) |
| rtl_opt_pass * | make_pass_df_initialize_no_opt (gcc::context *ctxt) |
| static unsigned int | rest_of_handle_df_finish (void) |
| rtl_opt_pass * | make_pass_df_finish (gcc::context *ctxt) |
| static bool | df_worklist_propagate_forward (struct dataflow *dataflow, unsigned bb_index, unsigned *bbindex_to_postorder, bitmap worklist, bitmap pending, sbitmap considered, vec< int > &last_change_age, int age) |
| static bool | df_worklist_propagate_backward (struct dataflow *dataflow, unsigned bb_index, unsigned *bbindex_to_postorder, bitmap worklist, bitmap pending, sbitmap considered, vec< int > &last_change_age, int age) |
| static void | df_worklist_dataflow_doublequeue (struct dataflow *dataflow, sbitmap considered, int *blocks_in_postorder, unsigned *bbindex_to_postorder, unsigned 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 (int list[], unsigned len, bitmap blocks) |
| void | df_analyze_problem (struct dataflow *dflow, bitmap blocks_to_consider, int *postorder, int n_blocks) |
| static void | df_analyze_1 (void) |
| void | df_analyze (void) |
| static int | loop_rev_post_order_compute (int *post_order, class loop *loop) |
| static int | loop_inverted_rev_post_order_compute (int *post_order, class loop *loop) |
| void | df_analyze_loop (class loop *loop) |
| int | df_get_n_blocks (enum df_flow_dir dir) |
| int * | df_get_postorder (enum df_flow_dir dir) |
| 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) |
| void | df_mark_solutions_dirty (void) |
| bool | df_get_bb_dirty (basic_block bb) |
| void | df_set_bb_dirty (basic_block bb) |
| void | df_grow_bb_info (struct dataflow *dflow) |
| static void | df_clear_bb_dirty (basic_block bb) |
| void | df_compact_blocks (void) |
| void | df_bb_replace (int old_index, basic_block new_block) |
| void | df_bb_delete (int bb_index) |
| void | df_verify (void) |
| df_ref | df_bb_regno_first_def_find (basic_block bb, unsigned int regno) |
| df_ref | df_bb_regno_last_def_find (basic_block bb, unsigned int regno) |
| df_ref | df_bb_regno_only_def_find (basic_block bb, unsigned int regno) |
| df_ref | df_find_def (rtx_insn *insn, rtx reg) |
| bool | df_reg_defined (rtx_insn *insn, rtx reg) |
| df_ref | df_find_use (rtx_insn *insn, rtx reg) |
| bool | df_reg_used (rtx_insn *insn, rtx reg) |
| rtx | df_find_single_def_src (rtx reg) |
| void | dump_regset (regset r, FILE *outf) |
| void | debug_regset (regset) |
| void | df_print_regset (FILE *file, const_bitmap r) |
| void | df_print_word_regset (FILE *file, const_bitmap r) |
| void | df_dump (FILE *file) |
| void | df_dump_region (FILE *file) |
| void | df_dump_start (FILE *file) |
| static void | df_dump_bb_problem_data (basic_block bb, FILE *file, bool top) |
| void | df_dump_top (basic_block bb, FILE *file) |
| void | df_dump_bottom (basic_block bb, FILE *file) |
| static void | df_dump_insn_problem_data (const rtx_insn *insn, FILE *file, bool top) |
| void | df_dump_insn_top (const rtx_insn *insn, FILE *file) |
| void | df_dump_insn_bottom (const rtx_insn *insn, FILE *file) |
| static void | df_ref_dump (df_ref ref, FILE *file) |
| void | df_refs_chain_dump (df_ref ref, bool follow_chain, FILE *file) |
| void | df_regs_chain_dump (df_ref ref, FILE *file) |
| static void | df_mws_dump (struct df_mw_hardreg *mws, FILE *file) |
| static void | df_insn_uid_debug (unsigned int uid, bool follow_chain, FILE *file) |
| DEBUG_FUNCTION void | df_insn_debug (rtx_insn *insn, bool follow_chain, FILE *file) |
| DEBUG_FUNCTION void | df_insn_debug_regno (rtx_insn *insn, FILE *file) |
| DEBUG_FUNCTION void | df_regno_debug (unsigned int regno, FILE *file) |
| DEBUG_FUNCTION void | df_ref_debug (df_ref ref, FILE *file) |
| DEBUG_FUNCTION void | debug_df_insn (rtx_insn *insn) |
| DEBUG_FUNCTION void | debug_df_reg (rtx reg) |
| DEBUG_FUNCTION void | debug_df_regno (unsigned int regno) |
| DEBUG_FUNCTION void | debug_df_ref (df_ref ref) |
| DEBUG_FUNCTION void | debug_df_defno (unsigned int defno) |
| DEBUG_FUNCTION void | debug_df_useno (unsigned int defno) |
| DEBUG_FUNCTION void | debug_df_chain (struct df_link *link) |
Variables | |
| struct bitmap_obstack | reg_obstack |
| bitmap_obstack | df_bitmap_obstack |
| class df_d * | df |
| static struct df_problem | user_problem |
| static struct dataflow | user_dflow |
| DEBUG_FUNCTION void debug_df_chain | ( | struct df_link * | link | ) |
References debug_df_chain(), df_chain_dump(), and fputc().
Referenced by debug_df_chain().
| DEBUG_FUNCTION void debug_df_defno | ( | unsigned int | defno | ) |
References debug_df_defno(), DF_DEFS_GET, and df_ref_debug().
Referenced by debug_df_defno().
| DEBUG_FUNCTION void debug_df_insn | ( | rtx_insn * | insn | ) |
Functions for debugging from GDB.
References debug_df_insn(), debug_rtx(), df_insn_debug(), and df_insn_info::insn.
Referenced by debug_df_insn().
| DEBUG_FUNCTION void debug_df_ref | ( | df_ref | ref | ) |
References debug_df_ref(), and df_ref_debug().
Referenced by debug_df_ref().
| DEBUG_FUNCTION void debug_df_reg | ( | rtx | reg | ) |
References debug_df_reg(), df_regno_debug(), and REGNO.
Referenced by debug_df_reg().
| DEBUG_FUNCTION void debug_df_regno | ( | unsigned int | regno | ) |
References debug_df_regno(), and df_regno_debug().
Referenced by debug_df_regno().
| DEBUG_FUNCTION void debug_df_useno | ( | unsigned int | defno | ) |
References debug_df_useno(), df_ref_debug(), and DF_USES_GET.
Referenced by debug_df_useno().
|
extern |
Print a human-readable representation of R on the standard error stream. This function is designed to be used from within the debugger.
References debug_regset(), dump_regset(), and r.
Referenced by debug_regset().
| void df_add_problem | ( | const struct df_problem * | problem | ) |
Add PROBLEM (and any dependent problems) to the DF instance.
This symbol turns on checking that each modification of the cfg has been identified to the appropriate df routines. It is not part of verification per se because the check that the final solution has not changed covers this. However, if the solution is not being properly recomputed because the cfg is being modified, adding in calls to df_check_cfg_clean can be used to find the source of that kind of problem.
Functions defined in df-core.cc.
References dataflow::computed, df_problem::dependent_problem, df, df_add_problem(), i, 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_add_problem(), df_chain_add_problem(), df_live_add_problem(), df_lr_add_problem(), df_md_add_problem(), df_mir_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.
References df_d::analyze_subset, BITMAP_ALLOC, bitmap_and_into(), bitmap_bit_p, BITMAP_FREE, bitmap_set_bit, df_d::blocks_to_analyze, cfun, df, df_analyze(), df_analyze_1(), df_bitmap_obstack, df_prune_to_subcfg(), free(), gcc_assert, i, inverted_rev_post_order_compute(), n_basic_blocks_for_fn, df_d::n_blocks, NULL, post_order_compute(), df_d::postorder, and df_d::postorder_inverted.
Referenced by cse_main(), df_analyze(), do_reload(), doloop_optimize_loops(), execute_compare_elim_after_reload(), execute_hardreg_pre(), execute_rtl_cprop(), execute_rtl_hoist(), execute_rtl_pre(), execute_rtl_store_motion(), ext_dce_execute(), find_and_remove_re(), find_moveable_pseudos(), fwprop_init(), gcse_after_reload_main(), if_convert(), init_dce(), initialize_uninitialized_regs(), ira(), ira_build(), move_loop_invariants(), one_cprop_pass(), pair_fusion::pair_fusion(), peephole2_optimize(), regrename_optimize(), reorder_loops(), reorg_loops(), rest_of_handle_combine(), rest_of_handle_dse(), rest_of_handle_stack_adjustments(), thread_prologue_and_epilogue_insns(), try_optimize_cfg(), and try_shrink_wrapping_separate().
|
static |
Analyze dataflow info.
References df_d::analyze_subset, BITMAP_FREE, df_d::blocks_to_analyze, df_d::changeable_flags, df, df_analyze_1(), df_analyze_problem(), df_compute_regs_ever_live(), DF_FORWARD, df_process_deferred_rescans(), df_verify(), DF_VERIFY_SCHEDULED, df_problem::dir, dump_file, i, df_d::n_blocks, NULL, df_d::num_problems_defined, df_d::postorder, df_d::postorder_inverted, dataflow::problem, df_d::problems_in_order, and dataflow::solutions_dirty.
Referenced by df_analyze(), df_analyze_1(), and df_analyze_loop().
| void df_analyze_loop | ( | class loop * | loop | ) |
Analyze dataflow info for the basic blocks contained in LOOP.
References BITMAP_ALLOC, BITMAP_FREE, bitmap_set_bit, df, df_analyze_1(), df_analyze_loop(), df_bitmap_obstack, df_set_blocks(), free(), gcc_assert, i, loop_inverted_rev_post_order_compute(), loop_rev_post_order_compute(), df_d::n_blocks, loop::num_nodes, df_d::postorder, and df_d::postorder_inverted.
Referenced by df_analyze_loop(), find_defs(), and iv_analysis_loop_init().
| 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_analyze_problem(), 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_1(), df_analyze_problem(), and fast_dce().
| void df_bb_delete | ( | int | bb_index | ) |
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 BASIC_BLOCK_FOR_FN, cfun, df, df_bb_delete(), df_clear_bb_dirty(), df_clear_bb_info(), df_get_bb_info(), df_mark_solutions_dirty(), df_problem::free_bb_fun, i, df_d::num_problems_defined, dataflow::problem, and df_d::problems_in_order.
Referenced by cfg_layout_merge_blocks(), df_bb_delete(), rtl_delete_block(), and rtl_merge_blocks().
| df_ref df_bb_regno_first_def_find | ( | basic_block | bb, |
| unsigned int | regno ) |
Return first def of REGNO within BB.
References df_bb_regno_first_def_find(), DF_REF_REGNO, FOR_BB_INSNS, FOR_EACH_INSN_DEF, INSN_P, and NULL.
Referenced by df_bb_regno_first_def_find(), and df_bb_regno_only_def_find().
| df_ref df_bb_regno_last_def_find | ( | basic_block | bb, |
| unsigned int | regno ) |
Return last def of REGNO within BB.
References df_bb_regno_last_def_find(), DF_REF_REGNO, FOR_BB_INSNS_REVERSE, FOR_EACH_INSN_DEF, INSN_P, and NULL.
Referenced by df_bb_regno_last_def_find(), and df_bb_regno_only_def_find().
| df_ref df_bb_regno_only_def_find | ( | basic_block | bb, |
| unsigned int | regno ) |
Return the one and only def of REGNO within BB. If there is no def or there are multiple defs, return NULL.
References df_bb_regno_first_def_find(), df_bb_regno_last_def_find(), df_bb_regno_only_def_find(), and NULL.
Referenced by df_bb_regno_only_def_find().
| void df_bb_replace | ( | int | old_index, |
| basic_block | new_block ) |
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 BASIC_BLOCK_FOR_FN, dataflow::block_info, cfun, df, df_bb_replace(), df_clear_bb_dirty(), df_get_bb_info(), df_grow_bb_info(), df_set_bb_dirty(), df_set_bb_info(), dump_file, gcc_assert, basic_block_def::index, NULL, df_d::num_problems_defined, df_d::problems_in_order, and SET_BASIC_BLOCK_FOR_FN.
Referenced by df_bb_replace(), and find_if_case_1().
|
static |
Clear the dirty bits. This is called from places that delete blocks.
References bitmap_clear_bit(), df, df_clear_bb_dirty(), 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(), df_bb_replace(), and df_clear_bb_dirty().
|
static |
Clear basic block info.
References dataflow::block_info, df_problem::block_info_elt_size, dataflow::block_info_size, df_clear_bb_info(), gcc_assert, and dataflow::problem.
Referenced by df_bb_delete(), df_clear_bb_info(), and df_set_blocks().
| int df_clear_flags | ( | int | changeable_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, df, and df_clear_flags().
Referenced by df_clear_flags(), df_insn_rescan_all(), df_lr_dce_finalize(), df_process_deferred_rescans(), fast_dce(), if_convert(), ira(), run_fast_df_dce(), and run_word_dce().
| 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, cfun, df, df_bitmap_obstack, df_compact_blocks(), df_grow_bb_info(), df_lr, df_set_bb_info(), ENTRY_BLOCK, EXIT_BLOCK, FOR_EACH_BB_FN, free(), df_problem::free_bb_fun, gcc_assert, i, basic_block_def::index, last_basic_block_for_fn, n_basic_blocks_for_fn, NULL, NUM_FIXED_BLOCKS, df_d::num_problems_defined, dataflow::out_of_date_transfer_functions, dataflow::problem, df_d::problems_in_order, and SET_BASIC_BLOCK_FOR_FN.
Referenced by compact_blocks(), and df_compact_blocks().
| void df_dump | ( | FILE * | file | ) |
Dump dataflow info.
References cfun, df_dump(), df_dump_bottom(), df_dump_start(), df_dump_top(), df_print_bb_index(), and FOR_ALL_BB_FN.
Referenced by df_dump(), df_dump_region(), init_dce(), and initialize_uninitialized_regs().
|
static |
Dump the top or bottom of the block information for BB.
References dataflow::computed, df, df_dump_bb_problem_data(), df_problem::dump_bottom_fun, df_problem::dump_top_fun, i, df_d::num_problems_defined, dataflow::problem, and df_d::problems_in_order.
Referenced by df_dump_bb_problem_data(), df_dump_bottom(), and df_dump_top().
| void df_dump_bottom | ( | basic_block | bb, |
| FILE * | file ) |
Dump the bottom of the block information for BB.
References df_dump_bb_problem_data(), and df_dump_bottom().
Referenced by df_dump(), df_dump_bottom(), print_rtl_with_bb(), and rtl_dump_bb().
| void df_dump_insn_bottom | ( | const rtx_insn * | insn, |
| FILE * | file ) |
Dump information about INSN after dumping INSN itself.
References df_dump_insn_bottom(), and df_dump_insn_problem_data().
Referenced by df_dump_insn_bottom(), print_rtl_with_bb(), and rtl_dump_bb().
Dump information about INSN just before or after dumping INSN itself.
References dataflow::computed, df, df_dump_insn_problem_data(), df_problem::dump_insn_bottom_fun, df_problem::dump_insn_top_fun, i, df_d::num_problems_defined, dataflow::problem, and df_d::problems_in_order.
Referenced by df_dump_insn_bottom(), df_dump_insn_problem_data(), and df_dump_insn_top().
| void df_dump_insn_top | ( | const rtx_insn * | insn, |
| FILE * | file ) |
Dump information about INSN before dumping INSN itself.
References df_dump_insn_problem_data(), and df_dump_insn_top().
Referenced by df_dump_insn_top(), print_rtl_with_bb(), and rtl_dump_bb().
| void df_dump_region | ( | FILE * | file | ) |
Dump dataflow info for df->blocks_to_analyze.
References BASIC_BLOCK_FOR_FN, df_d::blocks_to_analyze, cfun, df, df_dump(), df_dump_region(), df_dump_start(), dump_bb(), EXECUTE_IF_SET_IN_BITMAP, and TDF_DETAILS.
Referenced by df_dump_region(), find_defs(), and iv_analysis_loop_init().
| void df_dump_start | ( | FILE * | file | ) |
Dump the introductory information for each problem defined.
References df_d::blocks_to_analyze, dataflow::computed, current_function_name(), df, DF_DEFS_TABLE_SIZE, df_dump_start(), DF_USES_TABLE_SIZE, df_problem::dump_start_fun, i, df_d::num_problems_defined, dataflow::problem, and df_d::problems_in_order.
Referenced by df_dump(), df_dump_region(), df_dump_start(), and print_rtl_with_bb().
| void df_dump_top | ( | basic_block | bb, |
| FILE * | file ) |
Dump the top of the block information for BB.
References df_dump_bb_problem_data(), and df_dump_top().
Referenced by df_dump(), df_dump_top(), print_rtl_with_bb(), and rtl_dump_bb().
Finds the reference corresponding to the definition of REG in INSN. DF is the dataflow object.
References df_find_def(), DF_REF_REGNO, FOR_EACH_INSN_DEF, gcc_assert, GET_CODE, NULL, REG_P, REGNO, and SUBREG_REG.
Referenced by biv_p(), df_find_def(), df_reg_defined(), find_invariant_insn(), and iv_analyze_result().
If REG has a single definition, return its known value, otherwise return null.
References df_find_single_def_src(), DF_REF_CONDITIONAL, DF_REF_FLAGS, DF_REF_INSN, DF_REF_IS_ARTIFICIAL, DF_REF_NEXT_REG, DF_REF_PARTIAL, DF_REG_DEF_CHAIN, find_reg_equal_equiv_note(), function_invariant_p(), NULL, NULL_RTX, REG_P, REGNO, rtx_equal_p(), SET_DEST, SET_SRC, single_set(), and XEXP.
Referenced by df_find_single_def_src(), record_store(), and replace_single_def_regs().
Finds the reference corresponding to the use of REG in INSN. DF is the dataflow object.
References df_d::changeable_flags, df, DF_EQ_NOTES, df_find_use(), DF_INSN_INFO_GET, DF_REF_REGNO, FOR_EACH_INSN_INFO_EQ_USE, FOR_EACH_INSN_INFO_USE, gcc_assert, GET_CODE, NULL, REG_P, REGNO, and SUBREG_REG.
Referenced by df_find_use(), df_reg_used(), hash_invariant_expr_1(), invariant_expr_equal_p(), iv_analyze(), and iv_get_reaching_def().
| void df_finish_pass | ( | bool | verify | ) |
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, BITMAP_FREE, df_d::blocks_to_analyze, df_d::changeable_flags, df, df_finish_pass(), DF_LAST_PROBLEM_PLUS1, df_live, 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_remove_problem(), DF_VERIFY_SCHEDULED, i, NULL, dataflow::optional_p, and df_d::problems_by_index.
Referenced by df_finish_pass(), do_reload(), execute_todo(), and iv_analysis_done().
| bool df_get_bb_dirty | ( | basic_block | bb | ) |
Return true if BB needs it's transfer functions recomputed.
References bitmap_bit_p, df_get_bb_dirty(), df_live, df_lr, basic_block_def::index, and dataflow::out_of_date_transfer_functions.
Referenced by df_get_bb_dirty(), find_if_header(), if_convert(), and try_head_merge_bb().
|
static |
Allocation for dataflow support routines.
Copyright (C) 1999-2026 Free Software Foundation, Inc.
Originally contributed by Michael P. Hayes
(m.hayes@elec.canterbury.ac.nz, mhayes@redhat.com)
Major rewrite contributed by Danny Berlin (dberlin@dberlin.org)
and Kenneth Zadeck (zadeck@naturalbridge.com).
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/>. Get basic block info.
References dataflow::block_info, df_problem::block_info_elt_size, dataflow::block_info_size, df_get_bb_info(), NULL, and dataflow::problem.
Referenced by df_bb_delete(), df_bb_replace(), df_get_bb_info(), and df_set_blocks().
| int df_get_n_blocks | ( | enum df_flow_dir | dir | ) |
Return the number of basic blocks from the last call to df_analyze.
References df, DF_FORWARD, df_get_n_blocks(), DF_NONE, gcc_assert, df_d::n_blocks, df_d::postorder, and df_d::postorder_inverted.
Referenced by calculate_global_remat_bb_data(), df_get_n_blocks(), dse_step4(), ext_dce_execute(), fast_dce(), and lra_create_live_ranges_1().
| int * df_get_postorder | ( | enum df_flow_dir | dir | ) |
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, DF_FORWARD, df_get_postorder(), DF_NONE, gcc_assert, df_d::postorder, and df_d::postorder_inverted.
Referenced by calculate_global_remat_bb_data(), df_get_postorder(), dse_step4(), ext_dce_execute(), fast_dce(), and lra_create_live_ranges_1().
| void df_grow_bb_info | ( | struct dataflow * | dflow | ) |
Grow the bb_info array.
References dataflow::block_info, df_problem::block_info_elt_size, dataflow::block_info_size, cfun, df_grow_bb_info(), last_basic_block_for_fn, and dataflow::problem.
Referenced by df_bb_refs_record(), df_bb_replace(), df_compact_blocks(), df_grow_bb_info(), df_insn_delete(), df_insn_rescan(), df_live_alloc(), df_lr_alloc(), df_md_alloc(), df_mir_alloc(), df_notes_rescan(), df_rd_alloc(), df_scan_alloc(), df_word_lr_alloc(), and move_insn_for_shrink_wrap().
| DEBUG_FUNCTION void df_insn_debug | ( | rtx_insn * | insn, |
| bool | follow_chain, | ||
| FILE * | file ) |
References df_insn_debug(), df_insn_uid_debug(), and INSN_UID().
Referenced by debug_df_insn(), df_insn_debug(), and df_scan_start_block().
| DEBUG_FUNCTION void df_insn_debug_regno | ( | rtx_insn * | insn, |
| FILE * | file ) |
References BLOCK_FOR_INSN(), df_insn_debug_regno(), DF_INSN_INFO_DEFS, DF_INSN_INFO_EQ_USES, DF_INSN_INFO_GET, DF_INSN_INFO_LUID, DF_INSN_INFO_USES, df_refs_chain_dump(), df_insn_info::insn, and INSN_UID().
Referenced by df_insn_debug_regno().
|
static |
References df_insn_uid_debug(), DF_INSN_UID_DEFS, DF_INSN_UID_EQ_USES, DF_INSN_UID_LUID, DF_INSN_UID_MWS, DF_INSN_UID_USES, df_mws_dump(), and df_refs_chain_dump().
Referenced by df_insn_debug(), and df_insn_uid_debug().
| void df_mark_solutions_dirty | ( | void | ) |
Mark the solutions as being out of date.
References df, df_mark_solutions_dirty(), 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_mark_solutions_dirty(), df_set_bb_dirty(), df_set_blocks(), disconnect_dest(), disconnect_src(), and force_nonfallthru_and_redirect().
|
static |
References df_mws_dump(), DF_MWS_NEXT, DF_MWS_REG_DEF_P, df_mw_hardreg::end_regno, and df_mw_hardreg::start_regno.
Referenced by df_insn_uid_debug(), and df_mws_dump().
| void df_print_regset | ( | FILE * | file, |
| const_bitmap | r ) |
Write information about registers and basic blocks into FILE. This is part of making a debugging dump.
References df_print_regset(), EXECUTE_IF_SET_IN_BITMAP, i, NULL, r, and reg_names.
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_mir_bottom_dump(), df_mir_top_dump(), df_note_bb_compute(), df_print_regset(), df_scan_start_dump(), df_set_dead_notes_for_mw(), and replace_read().
| void df_print_word_regset | ( | FILE * | file, |
| const_bitmap | r ) |
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, df_print_word_regset(), i, max_reg_num(), NULL, and r.
Referenced by df_print_word_regset(), 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, and df_prune_to_subcfg().
Referenced by df_analyze(), and df_prune_to_subcfg().
| DEBUG_FUNCTION void df_ref_debug | ( | df_ref | ref, |
| FILE * | file ) |
References df_chain_dump(), DF_REF_BBNO, DF_REF_CHAIN, df_ref_debug(), DF_REF_FLAGS, DF_REF_ID, DF_REF_INSN_UID, DF_REF_IS_ARTIFICIAL, DF_REF_LOC, DF_REF_REG_DEF_P, DF_REF_REGNO, and DF_REF_TYPE.
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_debug().
|
static |
References df_ref_dump(), DF_REF_FLAGS, DF_REF_ID, DF_REF_IN_NOTE, DF_REF_REG_DEF_P, and DF_REF_REGNO.
Referenced by df_ref_dump(), df_refs_chain_dump(), and df_regs_chain_dump().
References df_chain_dump(), DF_REF_CHAIN, df_ref_dump(), DF_REF_NEXT_LOC, and df_refs_chain_dump().
Referenced by df_insn_debug_regno(), df_insn_uid_debug(), df_refs_chain_dump(), and df_scan_start_block().
Return true if REG is defined in INSN, zero otherwise.
References df_find_def(), df_reg_defined(), and NULL.
Referenced by df_reg_defined().
Return true if REG is referenced in INSN, zero otherwise.
References df_find_use(), df_reg_used(), and NULL.
Referenced by df_reg_used().
| DEBUG_FUNCTION void df_regno_debug | ( | unsigned int | regno, |
| FILE * | file ) |
References DF_REG_DEF_CHAIN, DF_REG_EQ_USE_CHAIN, DF_REG_USE_CHAIN, df_regno_debug(), and df_regs_chain_dump().
Referenced by debug_df_reg(), debug_df_regno(), and df_regno_debug().
| void df_regs_chain_dump | ( | df_ref | ref, |
| FILE * | file ) |
Dump either a ref-def or reg-use chain.
References df_ref_dump(), DF_REF_NEXT_REG, and df_regs_chain_dump().
Referenced by df_regno_debug(), and df_regs_chain_dump().
| void df_remove_problem | ( | struct dataflow * | dflow | ) |
Delete a DFLOW problem (and any problems that depend on this problem).
References df_problem::dependent_problem, df, df_remove_problem(), gcc_assert, i, df_problem::id, NULL, 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 df_finish_pass(), df_remove_problem(), doloop_optimize_loops(), if_convert(), initialize_uninitialized_regs(), ira(), iv_analysis_loop_init(), move_invariants(), move_loop_invariants(), and rest_of_handle_ud_dce().
| void df_set_bb_dirty | ( | basic_block | bb | ) |
Mark BB as needing it's transfer functions as being out of date.
References bitmap_set_bit, df, df_mark_solutions_dirty(), df_set_bb_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_scan_blocks(), df_set_bb_dirty(), 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(), move_insn_for_shrink_wrap(), purge_dead_edges(), reorder_insns(), rtl_redirect_edge_and_branch(), rtl_redirect_edge_and_branch_force(), rtl_split_block(), rtl_split_edge(), try_crossjump_to_edge(), and try_head_merge_bb().
|
static |
Set basic block info.
References dataflow::block_info, df_problem::block_info_elt_size, df_set_bb_info(), gcc_assert, and dataflow::problem.
Referenced by df_bb_replace(), df_compact_blocks(), and df_set_bb_info().
| void df_set_blocks | ( | bitmap | 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, BASIC_BLOCK_FOR_FN, BITMAP_ALLOC, bitmap_and_compl(), bitmap_clear(), bitmap_copy(), BITMAP_FREE, bitmap_initialize(), bitmap_print(), bitmap_set_bit, df_d::blocks_to_analyze, cfun, df, df_bitmap_obstack, 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, df_set_blocks(), dump_file, EXECUTE_IF_SET_IN_BITMAP, FOR_ALL_BB_FN, df_problem::free_bb_fun, df_problem::free_blocks_on_set_blocks, basic_block_def::index, initialized, NULL, df_d::num_problems_defined, dataflow::optional_p, dataflow::problem, df_d::problems_in_order, and df_problem::reset_fun.
Referenced by df_analyze_loop(), and df_set_blocks().
| int df_set_flags | ( | int | changeable_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, df, and df_set_flags().
Referenced by cse_main(), decompose_multiword_subregs(), df_insn_rescan_all(), df_lr_dce_finalize(), df_process_deferred_rescans(), df_set_flags(), do_reload(), execute_compare_elim_after_reload(), execute_rtl_cprop(), fast_dce(), find_and_remove_re(), find_defs(), if_convert(), init_dce(), iv_analysis_loop_init(), lra(), move_loop_invariants(), peephole2_optimize(), regrename_optimize(), rest_of_handle_combine(), rest_of_handle_dse(), run_fast_df_dce(), and run_word_dce().
| 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_simple_dataflow(), df_worklist_dataflow(), df_problem::dir, df_problem::init_fun, dataflow::problem, df_problem::trans_fun, user_dflow, and user_problem.
Referenced by calculate_global_remat_bb_data(), df_simple_dataflow(), dse_step4(), ext_dce_execute(), and lra_create_live_ranges_1().
| 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_d::changeable_flags, df, df_live, df_live_verify_transfer_functions(), df_lr_verify_transfer_functions(), df_scan_verify(), df_verify(), and DF_VERIFY_SCHEDULED.
Referenced by df_analyze_1(), and df_verify().
| 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, cfun, DF_NONE, df_worklist_dataflow(), df_worklist_dataflow_doublequeue(), df_problem::dir, EXECUTE_IF_SET_IN_BITMAP, free(), gcc_assert, i, df_problem::init_fun, last_basic_block_for_fn, and dataflow::problem.
Referenced by df_lr_dce_finalize(), df_simple_dataflow(), and df_worklist_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 last_change_age) 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 BITMAP_ALLOC, bitmap_clear_first_set_bit(), bitmap_empty_p(), BITMAP_FREE, bitmap_tree_view(), cfun, df_bitmap_obstack, DF_FORWARD, df_worklist_dataflow_doublequeue(), df_worklist_propagate_backward(), df_worklist_propagate_forward(), df_problem::dir, dump_file, last_basic_block_for_fn, n_basic_blocks_for_fn, n_edges_for_fn, NULL, dataflow::problem, VALGRIND_DISCARD, and vNULL.
Referenced by df_worklist_dataflow(), and df_worklist_dataflow_doublequeue().
|
static |
Helper function for df_worklist_dataflow. Propagate the dataflow backward.
References BASIC_BLOCK_FOR_FN, bitmap_bit_p, bitmap_set_bit, cfun, df_problem::con_fun_0, df_problem::con_fun_n, df_worklist_propagate_backward(), EDGE_COUNT, FOR_EACH_EDGE, basic_block_def::preds, dataflow::problem, basic_block_def::succs, and df_problem::trans_fun.
Referenced by df_worklist_dataflow_doublequeue(), and df_worklist_propagate_backward().
|
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 for earlier and WORKLIST for later in bbindex_to_postorder if the out set of the dataflow has changed. When WORKLIST is NULL we are processing all later blocks. 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 BASIC_BLOCK_FOR_FN, bitmap_bit_p, bitmap_set_bit, cfun, df_problem::con_fun_0, df_problem::con_fun_n, df_worklist_propagate_forward(), EDGE_COUNT, FOR_EACH_EDGE, basic_block_def::preds, dataflow::problem, basic_block_def::succs, and df_problem::trans_fun.
Referenced by df_worklist_dataflow_doublequeue(), and df_worklist_propagate_forward().
| void dump_regset | ( | regset | r, |
| FILE * | outf ) |
Write information about registers and basic blocks into FILE. This is part of making a debugging dump.
In df-core.cc (which should use regset consistently instead of bitmap...)
References dump_regset(), EXECUTE_IF_SET_IN_REG_SET, i, NULL, r, and reg_names.
Referenced by debug_regset(), dump_candidates_and_remat_bb_data(), and dump_regset().
|
static |
Compute the reverse top sort order of the inverted sub-CFG specified by LOOP. Returns the number of blocks which is always loop->num_nodes.
References bitmap_set_bit, EDGE_COUNT, ei_edge(), ei_next(), ei_one_before_end_p(), ei_start, flow_bb_inside_loop_p(), free(), loop::header, basic_block_def::index, loop_inverted_rev_post_order_compute(), loop::num_nodes, and basic_block_def::preds.
Referenced by df_analyze_loop(), and loop_inverted_rev_post_order_compute().
|
static |
Compute the reverse top sort order of the sub-CFG specified by LOOP. Returns the number of blocks which is always loop->num_nodes.
References bitmap_set_bit, EDGE_COUNT, ei_edge(), ei_next(), ei_one_before_end_p(), ei_start, flow_bb_inside_loop_p(), free(), basic_block_def::index, loop_preheader_edge(), loop_rev_post_order_compute(), loop::num_nodes, and basic_block_def::succs.
Referenced by df_analyze_loop(), and loop_rev_post_order_compute().
| rtl_opt_pass * make_pass_df_finish | ( | gcc::context * | ctxt | ) |
References make_pass_df_finish().
Referenced by make_pass_df_finish(), and make_pass_value_profile_transformations().
| rtl_opt_pass * make_pass_df_initialize_no_opt | ( | gcc::context * | ctxt | ) |
References make_pass_df_initialize_no_opt().
Referenced by make_pass_df_initialize_no_opt(), and make_pass_rtl_dse3().
| rtl_opt_pass * make_pass_df_initialize_opt | ( | gcc::context * | ctxt | ) |
References make_pass_df_initialize_opt().
Referenced by make_pass_df_initialize_opt(), and make_pass_rtl_dse3().
|
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(), df, df_bitmap_obstack, free(), df_problem::free_fun, gcc_assert, df_d::hard_regs_live_count, i, NULL, df_d::num_problems_defined, df_d::postorder, df_d::postorder_inverted, dataflow::problem, df_d::problems_in_order, and rest_of_handle_df_finish().
Referenced by rest_of_handle_df_finish().
|
static |
Set up the dataflow instance for the entire back end.
References bitmap_obstack_initialize(), df_d::changeable_flags, crtl, df, df_bitmap_obstack, 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(), gcc_assert, df_d::hard_regs_live_count, NULL, and rest_of_handle_df_initialize().
Referenced by rest_of_handle_df_initialize().
| class 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_problem(), df_add_refs_to_table(), df_analyze(), df_analyze_1(), df_analyze_loop(), df_bb_delete(), df_bb_refs_collect(), df_bb_refs_record(), df_bb_replace(), 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_clear_bb_dirty(), df_clear_flags(), df_compact_blocks(), df_compute_regs_ever_live(), df_count_refs(), df_dump_bb_problem_data(), df_dump_insn_problem_data(), df_dump_region(), df_dump_start(), df_entry_block_bitmap_verify(), df_exit_block_bitmap_verify(), df_find_use(), df_finish_pass(), df_get_call_refs(), df_get_n_blocks(), df_get_postorder(), 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_dce_finalize(), df_lr_local_compute(), df_lr_verify_transfer_functions(), df_mark_solutions_dirty(), 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_remove_problem(), 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_bb_dirty(), df_set_blocks(), df_set_flags(), df_set_regs_ever_live(), df_simulate_fixup_sets(), df_update_entry_block_defs(), df_update_exit_block_uses(), df_verify(), df_word_lr_local_compute(), dump_reg_info(), fast_dce(), find_invariants_to_move(), glibc_linux_libm_function_max_error(), ira(), latch_dominating_def(), print_rtl_with_bb(), reginfo_init(), remove_edge_and_dominated_blocks(), remove_reg_equal_equiv_notes_for_regno(), rest_of_handle_df_finish(), rest_of_handle_df_initialize(), rtl_dump_bb(), and single_set_2().
| 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.
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. This obstack is declared in df-core.cc.
Referenced by df_analyze(), df_analyze_loop(), df_chain_add_problem(), df_compact_blocks(), df_entry_block_bitmap_verify(), df_exit_block_bitmap_verify(), df_insn_rescan_all(), df_live_add_problem(), df_lr_add_problem(), df_mir_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_set_blocks(), df_update_entry_block_defs(), df_update_exit_block_uses(), df_word_lr_add_problem(), df_worklist_dataflow_doublequeue(), regstat_compute_calls_crossed(), regstat_compute_ri(), rest_of_handle_df_finish(), and rest_of_handle_df_initialize().
| struct bitmap_obstack reg_obstack |
The obstack on which regsets are allocated.
An obstack for regsets.
Referenced by assign_by_spills(), assign_spill_hard_regs(), bb_valid_for_noce_process_p(), bbs_ok_for_cmove_arith(), calculate_bb_reg_pressure(), calculate_equiv_gains(), calculate_gen_cands(), calculate_loop_reg_pressure(), can_move_insns_across(), combine_stack_adjustments(), combine_stack_adjustments_for_block(), create_remat_bb_data(), dead_or_predicable(), do_remat(), dse_step0(), dse_step1(), cgraph_node::expand(), find_exits(), initialize_lra_reg_info_element(), initiate_live_solver(), lra(), lra_assign(), lra_coalesce(), lra_constraints(), lra_eliminate(), lra_inheritance(), lra_live_ranges_init(), lra_remat(), lra_split_hard_reg_for(), lra_undo_inheritance(), noce_convert_multiple_sets(), peephole2_optimize(), remove_scratches(), replace_read(), run_rtl_passes(), simplify_using_initial_values(), spill_pseudos(), spill_pseudos(), undo_optional_reloads(), and update_bad_spill_attribute().
|
static |
Referenced by df_simple_dataflow().
|
static |
Referenced by df_simple_dataflow().