GCC Middle and Back End API Reference
|
Public Types | |
enum | reachability { ALL_BLOCKS , REACHABLE_BLOCKS , REACHABLE_BLOCKS_PRESERVING_FLAGS } |
Public Member Functions | |
dom_opt_dom_walker (cdi_direction direction, jump_threader *threader, dom_jt_state *state, gimple_ranger *ranger, const_and_copies *const_and_copies, avail_exprs_stack *avail_exprs_stack) | |
edge | before_dom_children (basic_block) final override |
void | after_dom_children (basic_block) final override |
void | walk (basic_block) |
Static Public Attributes | |
static const edge | STOP = (edge)-1 |
Private Member Functions | |
edge | optimize_stmt (basic_block, gimple_stmt_iterator *, bool *) |
void | set_global_ranges_from_unreachable_edges (basic_block) |
void | test_for_singularity (gimple *, avail_exprs_stack *) |
edge | fold_cond (gcond *cond) |
bool | bb_reachable (struct function *, basic_block) |
void | propagate_unreachable_to_edges (basic_block, FILE *, dump_flags_t) |
Private Attributes | |
class const_and_copies * | m_const_and_copies |
class avail_exprs_stack * | m_avail_exprs_stack |
gcond * | m_dummy_cond |
jump_threader * | m_threader |
gimple_ranger * | m_ranger |
dom_jt_state * | m_state |
enum cdi_direction | m_dom_direction: 2 |
enum reachability | m_reachability: 2 |
bool | m_user_bb_to_rpo |
basic_block | m_unreachable_dom |
int * | m_bb_to_rpo |
|
inherited |
|
inline |
References gimple_build_cond(), integer_zero_node, m_ranger, NULL, and ranger.
|
finaloverridevirtual |
We have finished processing the dominator children of BB, perform any finalization actions in preparation for leaving this node in the dominator tree.
Reimplemented from dom_walker.
References bitmap_clear_bit(), and basic_block_def::index.
|
privateinherited |
Return TRUE if BB is reachable, false otherwise.
References dom_walker::ALL_BLOCKS, CDI_DOMINATORS, dominated_by_p(), ENTRY_BLOCK_PTR_FOR_FN, FOR_EACH_EDGE, dom_walker::m_reachability, dom_walker::m_unreachable_dom, and basic_block_def::preds.
Referenced by dom_walker::walk().
|
finaloverridevirtual |
Reimplemented from dom_walker.
References bitmap_set_bit, cprop_into_successor_phis(), dbg_cnt(), dump_file, dump_flags, eliminate_redundant_computations(), gcc_checking_assert, gimple_set_visited(), gimple_visited_p(), gsi_end_p(), gsi_last_bb(), gsi_next(), gsi_prev(), gsi_start_bb(), gsi_start_phis(), gsi_stmt(), basic_block_def::index, NULL, record_edge_info(), record_equivalences_from_incoming_edge(), record_equivalences_from_phis(), and TDF_DETAILS.
If possible, rewrite the conditional as TRUE or FALSE, and return the taken edge. Otherwise, return NULL.
References boolean_false_node, boolean_true_node, find_taken_edge(), gimple_bb(), gimple_cond_false_p(), gimple_cond_true_p(), m_ranger, and NULL.
|
private |
Optimize the statement in block BB pointed to by iterator SI. We try to perform some simplistic global redundancy elimination and constant propagation: 1- To detect global redundancy, we keep track of expressions that have been computed in this block and its dominators. If we find that the same expression is computed more than once, we eliminate repeated computations by using the target of the first one. 2- Constant values and copy assignments. This is used to do very simplistic constant and copy propagation. When a constant or copy assignment is found, we map the value on the RHS of the assignment to the variable in the LHS in the CONST_AND_COPIES table. 3- Very simple redundant store elimination is performed. 4- We can simplify a condition to a constant or from a relational condition to an equality condition.
References as_a(), bitmap_set_bit, boolean_type_node, cfg_altered, cprop_into_stmt(), dom_valueize(), dump_file, dump_flags, dyn_cast(), eliminate_redundant_computations(), expr_hash_elt::expr(), EXPR_SINGLE, find_taken_edge(), fndecl_built_in_p(), fold_binary_loc(), fold_convert, fold_stmt(), gcc_unreachable, gimple_assign_lhs(), gimple_assign_rhs1(), gimple_assign_single_p(), gimple_bb(), gimple_build_assign(), gimple_call_fndecl(), gimple_call_lhs(), gimple_call_noreturn_p(), gimple_cond_code(), gimple_cond_lhs(), gimple_cond_make_false(), gimple_cond_make_true(), gimple_cond_rhs(), gimple_cond_set_lhs(), gimple_goto_dest(), gimple_has_side_effects(), gimple_location(), gimple_modified_p(), gimple_set_modified(), gimple_set_vuse(), gimple_switch_index(), gimple_vuse(), gsi_remove(), gsi_stmt(), basic_block_def::index, integer_onep(), integer_zero_node, integer_zerop(), is_gimple_assign(), is_gimple_call(), hashable_expr::kind, m_ranger, maybe_clean_or_replace_eh_stmt(), need_eh_cleanup, need_noreturn_fixup, NULL, NULL_TREE, opt_stats_d::num_stmts, operand_equal_p(), hashable_expr::ops, opt_stats, print_gimple_stmt(), propagate_tree_value_into_stmt(), recompute_tree_invariant_for_addr_expr(), record_equivalences_from_stmt(), reduce_vector_comparison_to_scalar_comparison(), refs_same_for_tbaa_p(), release_defs(), hashable_expr::rhs, si, hashable_expr::single, SSA_NAME_DEF_STMT, ssa_name_has_boolean_range(), TDF_DETAILS, TDF_SLIM, test_for_singularity(), TREE_CODE, TREE_TYPE, unlink_stmt_vdef(), update_stmt(), and update_stmt_if_modified().
|
privateinherited |
BB has been determined to be unreachable. Propagate that property to incoming and outgoing edges of BB as appropriate.
References CDI_DOMINATORS, dominated_by_p(), dump_file, dump_flags, FOR_EACH_EDGE, basic_block_def::index, dom_walker::m_unreachable_dom, basic_block_def::preds, basic_block_def::succs, and TDF_DETAILS.
Referenced by dom_walker::walk().
|
private |
Set global ranges that can be determined from the C->M edge: <bb C>: ... if (something) goto <bb N>; else goto <bb M>; <bb N>: __builtin_unreachable (); <bb M>:
References all_uses_feed_or_dominated_by_stmt(), assert_unreachable_fallthru_edge_p(), FOR_EACH_GORI_EXPORT_NAME, gimple_bb(), range_query::gori_ssa(), gsi_last_bb(), m_ranger, maybe_set_nonzero_bits(), r, gimple_ranger::range_on_edge(), set_range_info(), single_pred_edge_ignoring_loop_edges(), SSA_NAME_DEF_STMT, SSA_NAME_IS_DEFAULT_DEF, and TREE_TYPE.
|
private |
If STMT contains a relational test, try to convert it into an equality test if there is only a single value which can ever make the test true. For example, if the expression hash table contains: TRUE = (i <= 1) And we have a test within statement of i >= 1, then we can safely rewrite the test as i == 1 since there only a single value where the test is true. This is similar to code in VRP.
References as_a(), build_int_cst(), fold_build2, gimple_assign_rhs1(), gimple_assign_rhs2(), gimple_assign_rhs_code(), gimple_assign_set_rhs2(), gimple_assign_set_rhs_code(), gimple_cond_code(), gimple_cond_lhs(), gimple_cond_rhs(), gimple_cond_set_code(), gimple_cond_set_lhs(), gimple_cond_set_rhs(), gimple_set_modified(), integer_onep(), is_gimple_assign(), avail_exprs_stack::lookup_avail_expr(), TREE_CODE, and TREE_TYPE.
|
inherited |
Recursively walk the dominator tree. BB is the basic block we are currently visiting.
References dom_walker::after_dom_children(), dom_walker::bb_reachable(), dom_walker::before_dom_children(), CDI_DOMINATORS, cfun, dump_file, dump_flags, EDGE_COUNT, ENTRY_BLOCK_PTR_FOR_FN, EXIT_BLOCK_PTR_FOR_FN, first_dom_son(), FOR_EACH_EDGE, free(), i, last_basic_block_for_fn, dom_walker::m_bb_to_rpo, dom_walker::m_dom_direction, dom_walker::m_reachability, dom_walker::m_unreachable_dom, dom_walker::m_user_bb_to_rpo, n_basic_blocks_for_fn, next_dom_son(), NULL, pre_and_rev_post_order_compute(), basic_block_def::preds, dom_walker::propagate_unreachable_to_edges(), dom_walker::REACHABLE_BLOCKS, set_all_edges_as_executable(), sort_bbs_postorder(), dom_walker::STOP, basic_block_def::succs, and worklist.
Referenced by array_bounds_checker::check(), eliminate_with_rpo_vn(), find_comparisons(), get_non_trapping(), ipa_analyze_node(), ipcp_transform_function(), rewrite_blocks(), and substitute_and_fold_engine::substitute_and_fold().
|
private |
|
privateinherited |
Referenced by dom_walker::walk(), and dom_walker::~dom_walker().
|
private |
|
privateinherited |
Referenced by dom_walker::walk().
|
private |
|
private |
|
privateinherited |
Referenced by dom_walker::bb_reachable(), and dom_walker::walk().
|
private |
|
private |
|
privateinherited |
Referenced by dom_walker::bb_reachable(), dom_walker::propagate_unreachable_to_edges(), and dom_walker::walk().
|
privateinherited |
Referenced by dom_walker::walk(), and dom_walker::~dom_walker().
Referenced by rewrite_update_dom_walker::before_dom_children(), and dom_walker::walk().