GCC Middle and Back End API Reference
|
Data Structures | |
struct | hashable_expr |
struct | cond_equivalence_s |
struct | edge_info |
struct | expr_hash_elt |
struct | expr_elt_hasher |
struct | opt_stats_d |
Typedefs | |
typedef struct cond_equivalence_s | cond_equivalence |
typedef struct expr_hash_elt * | expr_hash_elt_t |
Enumerations | |
enum | expr_kind { EXPR_SINGLE, EXPR_UNARY, EXPR_BINARY, EXPR_TERNARY, EXPR_CALL, EXPR_PHI } |
Variables | |
static vec< expr_hash_elt_t > | avail_exprs_stack |
static hash_table < expr_elt_hasher > | avail_exprs |
static vec< tree > | const_and_copies_stack |
static bool | cfg_altered |
static bitmap | need_eh_cleanup |
static struct opt_stats_d | opt_stats |
typedef struct cond_equivalence_s cond_equivalence |
Structure for recording known values of a conditional expression at the exits from its block.
typedef struct expr_hash_elt* expr_hash_elt_t |
Stack of available expressions in AVAIL_EXPRs. Each block pushes any expressions it enters into the hash table along with a marker entry (null). When we finish processing the block, we pop off entries and remove the expressions from the global hash table until we hit the marker.
enum expr_kind |
@verbatim SSA Dominator optimizations for trees
Copyright (C) 2001-2013 Free Software Foundation, Inc. Contributed by Diego Novillo dnovi llo@ redha t.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/.
This file implements optimizations on the dominator tree.
Representation of a "naked" right-hand-side expression, to be used in recording available expressions in the expression hash table.
|
staticread |
Allocate an EDGE_INFO for edge E and attach it to E. Return the new EDGE_INFO structure.
References edge_def::aux.
Referenced by record_edge_info().
|
static |
Referenced by initialize_hash_element(), and initialize_hash_element_from_expr().
|
static |
Hashing and equality functions for AVAIL_EXPRS. We compute a value number for expressions using the code of the expression and the SSA numbers of its operands.
References expr::expr, gimple_vuse(), iterative_hash_expr(), iterative_hash_hashable_expr(), and expr_hash_elt::stmt.
|
static |
Build a cond_equivalence record indicating that the comparison CODE holds between operands OP0 and OP1 and push it to **P.
References hashable_expr::binary, cond_equivalence_s::cond, EXPR_BINARY, hashable_expr::kind, hashable_expr::ops, tcc_comparison, hashable_expr::type, and cond_equivalence_s::value.
Referenced by record_conditions().
|
static |
Given a conditional statement CONDSTMT, convert the condition to a canonical form.
References gimple_cond_code(), gimple_cond_lhs(), gimple_cond_rhs(), gimple_cond_set_code(), gimple_cond_set_lhs(), gimple_cond_set_rhs(), swap_tree_comparison(), tree_swap_operands_p(), and update_stmt().
Referenced by optimize_stmt().
|
static |
CONST_AND_COPIES is a table which maps an SSA_NAME to the current known value for that SSA_NAME (or NULL if no value is known). Propagate values from CONST_AND_COPIES into the uses, vuses and vdef_ops of STMT.
References cprop_operand().
Referenced by optimize_stmt().
|
static |
CONST_AND_COPIES is a table which maps an SSA_NAME to the current known value for that SSA_NAME (or NULL if no value is known). Propagate values from CONST_AND_COPIES into the PHI nodes of the successors of BB.
References edge_def::dest, edge_def::dest_idx, edge_def::flags, get_use_from_ptr(), gimple_phi_arg_imm_use_ptr(), gsi_end_p(), gsi_next(), gsi_start_phis(), gsi_stmt(), is_gimple_min_invariant(), may_propagate_copy(), hashable_expr::phi, propagate_value(), and basic_block_def::succs.
Referenced by dom_opt_enter_block().
|
static |
Replace *OP_P in STMT with any known equivalent value for *OP_P from CONST_AND_COPIES.
References dump_file, dump_flags, gimple_has_mem_ops(), gimple_has_volatile_ops(), gimple_set_modified(), loop_depth_of_name(), may_propagate_copy(), may_propagate_copy_into_asm(), opt_stats_d::num_const_prop, opt_stats_d::num_copy_prop, opt_stats, print_generic_expr(), propagate_value(), and simple_iv_increment_p().
Referenced by cprop_into_stmt().
DEBUG_FUNCTION void debug_dominator_optimization_stats | ( | void | ) |
Dump SSA statistics on stderr.
References dump_dominator_optimization_stats().
tree degenerate_phi_result | ( | ) |
PHI-ONLY copy and constant propagation. This pass is meant to clean up degenerate PHIs created by or exposed by jump threading.
Given PHI, return its RHS if the PHI is a degenerate, otherwise return NULL.
References gimple_phi_arg_def(), gimple_phi_num_args(), gimple_phi_result(), expr_hash_elt::lhs, and operand_equal_p().
|
static |
References cprop_into_successor_phis(), dump_file, dump_flags, eliminate_redundant_computations(), gsi_end_p(), gsi_next(), gsi_start_bb(), gsi_start_phis(), basic_block_def::index, optimize_stmt(), record_edge_info(), record_equivalences_from_incoming_edge(), record_equivalences_from_phis(), and remove_local_expressions_from_table().
Referenced by tree_ssa_dominator_optimize().
|
static |
Referenced by tree_ssa_dominator_optimize().
|
static |
We have finished processing the dominator children of BB, perform any finalization actions in preparation for leaving this node in the dominator tree.
References edge_def::aux, edge_info::cond_equivalences, edge_def::dest, dom_thread_across_edge(), extract_true_false_edges_from_block(), last, last_stmt(), edge_info::lhs, potentially_threadable_block(), record_cond(), record_const_or_copy(), remove_local_expressions_from_table(), restore_vars_to_original_value(), edge_info::rhs, single_succ(), single_succ_edge(), single_succ_p(), and basic_block_def::succs.
|
static |
Referenced by dom_opt_leave_block().
|
static |
Wrapper for common code to attempt to thread an edge. For example, it handles lazily building the dummy condition and the bookkeeping when jump threading is successful.
References gimple_build_cond(), dom_walk_data::global_data, simplify_stmt_for_jump_threading(), and thread_across_edge().
void dump_dominator_optimization_stats | ( | ) |
Dump SSA statistics on FILE.
References htab_statistics(), opt_stats_d::num_exprs_considered, opt_stats_d::num_stmts, and opt_stats.
|
static |
STMT is either a PHI node (potentially a degenerate PHI node) or a statement that is a trivial copy or constant initialization. Attempt to eliminate T by propagating its RHS into all uses of its LHS. This may in turn set new bits in INTERESTING_NAMES for nodes we want to revisit later. All exit paths should clear INTERESTING_NAMES for the result of STMT.
References bitmap_clear_bit(), get_lhs_or_phi_result(), get_rhs_or_phi_arg(), has_zero_uses(), expr_hash_elt::lhs, propagate_rhs_into_lhs(), remove_stmt_or_phi(), and virtual_operand_p().
Referenced by eliminate_degenerate_phis(), and eliminate_degenerate_phis_1().
|
static |
A very simple pass to eliminate degenerate PHI nodes from the IL. This is meant to be fast enough to be able to be run several times in the optimization pipeline. Certain optimizations, particularly those which duplicate blocks or remove edges from the CFG can create or expose PHIs which are trivial copies or constant initializations. While we could pick up these optimizations in DOM or with the combination of copy-prop and CCP, those solutions are far too heavy-weight for our needs. This implementation has two phases so that we can efficiently eliminate the first order degenerate PHIs and second order degenerate PHIs. The first phase performs a dominator walk to identify and eliminate the vast majority of the degenerate PHIs. When a degenerate PHI is identified and eliminated any affected statements or PHIs are put on a worklist. The second phase eliminates degenerate PHIs and trivial copies or constant initializations using the worklist. This is how we pick up the secondary optimization opportunities with minimal cost.
References bitmap_copy(), bitmap_empty_p(), calculate_dominance_info(), CDI_DOMINATORS, cfg_altered, eliminate_const_or_copy(), eliminate_degenerate_phis_1(), free_dominance_info(), gimple_purge_all_dead_eh_edges(), LOOPS_NEED_FIXUP, and loops_state_set().
|
static |
The first phase in degenerate PHI elimination. Eliminate the degenerate PHIs in BB, then recurse on the dominator children of BB.
References CDI_DOMINATORS, eliminate_const_or_copy(), first_dom_son(), gsi_end_p(), gsi_next(), gsi_start_phis(), gsi_stmt(), and next_dom_son().
Referenced by eliminate_degenerate_phis().
|
static |
Referenced by dom_opt_enter_block(), and optimize_stmt().
|
static |
Search for redundant computations in STMT. If any are found, then replace them with the variable holding the result of the computation. If safe, record this expression into the available expression hash table.
References dump_file, dump_flags, gimple_assign_lhs(), gimple_call_lhs(), gimple_get_lhs(), gimple_phi_result(), gimple_set_modified(), gimple_switch_index(), gimple_vdef(), gsi_stmt(), insert(), is_gimple_assign(), is_gimple_call(), is_gimple_min_invariant(), lookup_avail_expr(), may_propagate_copy_into_stmt(), opt_stats_d::num_exprs_considered, opt_stats_d::num_re, opt_stats, print_generic_expr(), print_gimple_expr(), propagate_tree_value_into_stmt(), record_const_or_copy(), simple_iv_increment_p(), and useless_type_conversion_p().
|
static |
Free all EDGE_INFO structures associated with edges in the CFG. If a particular edge can be threaded, copy the redirection target from the EDGE_INFO structure into the edge's AUX field as required by code to update the CFG and SSA graph for jump threading.
References edge_def::aux, edge_info::cond_equivalences, free(), and basic_block_def::preds.
Referenced by tree_ssa_dominator_optimize().
|
static |
Referenced by record_cond(), and expr_elt_hasher::remove().
|
static |
Delete an expr_hash_elt and reclaim its storage.
References free(), and free_expr_hash_elt_contents().
|
static |
Delete variable sized pieces of the expr_hash_elt ELEMENT.
References hashable_expr::call, expr_hash_elt::expr, EXPR_CALL, EXPR_PHI, free(), hashable_expr::kind, hashable_expr::ops, and hashable_expr::phi.
Referenced by free_expr_hash_elt(), and lookup_avail_expr().
|
static |
|
static |
Given a statement STMT, which is either a PHI node or an assignment, return the "lhs" of the node.
References gimple_assign_lhs(), gimple_phi_result(), and is_gimple_assign().
Referenced by eliminate_const_or_copy(), and propagate_rhs_into_lhs().
|
static |
Given a statement STMT, which is either a PHI node or an assignment, return the "rhs" of the node, in the case of a non-degenerate phi, NULL is returned.
References degenerate_phi_result(), gimple_assign_rhs1(), and gimple_assign_single_p().
Referenced by eliminate_const_or_copy().
|
static |
Hashtable helpers.
Compare two hashable_expr structures for equivalence. They are considered equivalent when the the expressions they denote must necessarily be equal. The logic is intended to follow that of operand_equal_p in fold-const.c
References hashable_expr::binary, hashable_expr::call, commutative_ternary_tree_code(), commutative_tree_code(), EXPR_BINARY, EXPR_CALL, EXPR_PHI, EXPR_SINGLE, EXPR_TERNARY, EXPR_UNARY, gimple_call_same_target_p(), hashable_expr::kind, operand_equal_p(), hashable_expr::ops, hashable_expr::phi, hashable_expr::single, hashable_expr::ternary, hashable_expr::type, and hashable_expr::unary.
Referenced by expr_elt_hasher::equal().
|
static |
|
static |
Dump statistics for the hash table HTAB.
References hash_table< Descriptor, Allocator >::collisions(), hash_table< Descriptor, Allocator >::elements(), and hash_table< Descriptor, Allocator >::size().
|
static |
Given a conditional expression COND as a tree, initialize a hashable_expr expression EXPR. The conditional must be a comparison or logical negation. A constant or a variable is not permitted.
References hashable_expr::binary, EXPR_BINARY, EXPR_UNARY, hashable_expr::kind, hashable_expr::ops, hashable_expr::type, and hashable_expr::unary.
Referenced by record_conditions().
|
static |
Given a statement STMT, initialize the hash table element pointed to by ELEMENT.
References avail_expr_hash(), hashable_expr::binary, hashable_expr::call, expr_hash_elt::expr, EXPR_BINARY, EXPR_CALL, EXPR_PHI, EXPR_SINGLE, EXPR_TERNARY, EXPR_UNARY, get_gimple_rhs_class(), gimple_assign_lhs(), gimple_assign_rhs1(), gimple_assign_rhs2(), gimple_assign_rhs3(), gimple_assign_rhs_code(), GIMPLE_BINARY_RHS, gimple_call_arg(), gimple_call_flags(), gimple_call_lhs(), gimple_call_num_args(), gimple_cond_code(), gimple_cond_lhs(), gimple_cond_rhs(), gimple_goto_dest(), gimple_phi_arg_def(), gimple_phi_num_args(), gimple_phi_result(), GIMPLE_SINGLE_RHS, gimple_switch_index(), GIMPLE_TERNARY_RHS, GIMPLE_UNARY_RHS, expr_hash_elt::hash, hashable_expr::kind, expr_hash_elt::lhs, hashable_expr::nargs, hashable_expr::ops, hashable_expr::phi, hashable_expr::single, expr_hash_elt::stamp, expr_hash_elt::stmt, hashable_expr::ternary, hashable_expr::type, and hashable_expr::unary.
Referenced by lookup_avail_expr().
|
static |
Given a hashable_expr expression EXPR and an LHS, initialize the hash table element pointed to by ELEMENT.
References avail_expr_hash(), expr_hash_elt::expr, expr_hash_elt::hash, expr_hash_elt::lhs, expr_hash_elt::stamp, and expr_hash_elt::stmt.
Referenced by record_cond().
|
static |
Compute a hash value for a hashable_expr value EXPR and a previously accumulated hash value VAL. If two hashable_expr values compare equal with hashable_expr_equal_p, they must hash to the same value, given an identical value of VAL. The logic is intended to follow iterative_hash_expr in tree.c.
References hashable_expr::binary, hashable_expr::call, commutative_ternary_tree_code(), commutative_tree_code(), EXPR_BINARY, EXPR_CALL, EXPR_PHI, EXPR_SINGLE, EXPR_TERNARY, EXPR_UNARY, hashable_expr::fn_from, gimple_call_fn(), gimple_call_internal_fn(), gimple_call_internal_p(), iterative_hash_expr(), iterative_hash_exprs_commutative(), iterative_hash_hashval_t(), hashable_expr::kind, hashable_expr::ops, hashable_expr::phi, hashable_expr::single, hashable_expr::ternary, hashable_expr::type, and hashable_expr::unary.
Referenced by avail_expr_hash().
|
static |
Search for an existing instance of STMT in the AVAIL_EXPRS table. If found, return its LHS. Otherwise insert STMT in the table and return NULL_TREE. Also, when an expression is first inserted in the table, it is also is also added to AVAIL_EXPRS_STACK, so that it can be removed when we finish processing this block and its children.
References dump_file, dump_flags, expr_hash_elt::expr, EXPR_SINGLE, hash_table< Descriptor, Allocator >::find_slot_with_hash(), free_expr_hash_elt_contents(), gimple_get_lhs(), gimple_phi_result(), expr_hash_elt::hash, initialize_hash_element(), is_gimple_min_invariant(), hashable_expr::kind, edge_info::lhs, expr_hash_elt::lhs, hashable_expr::ops, print_expr_hash_elt(), print_generic_expr(), hashable_expr::single, and expr_hash_elt::stamp.
int loop_depth_of_name | ( | ) |
Return the loop depth of the basic block of the defining statement of X. This number should not be treated as absolutely correct because the loop information may not be completely up-to-date when dom runs. However, it will be relatively correct, and as more passes are taught to keep loop info up to date, the result will become more and more accurate.
References bb_loop_depth(), and gimple_bb().
gimple_opt_pass* make_pass_dominator | ( | ) |
gimple_opt_pass* make_pass_phi_only_cprop | ( | ) |
|
static |
Local functions.
Referenced by dom_opt_enter_block().
|
static |
Optimize the statement 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.
References bitmap_set_bit(), BUILT_IN_NORMAL, canonicalize_comparison(), cfg_altered, cprop_into_stmt(), dump_file, dump_flags, eliminate_redundant_computations(), find_taken_edge(), fold_binary_loc(), fold_stmt(), gimple_assign_lhs(), gimple_assign_rhs1(), gimple_assign_single_p(), gimple_bb(), gimple_call_fndecl(), gimple_call_lhs(), gimple_cond_code(), gimple_cond_lhs(), gimple_cond_rhs(), 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, is_gimple_assign(), is_gimple_call(), edge_info::lhs, lookup_avail_expr(), maybe_clean_or_replace_eh_stmt(), opt_stats_d::num_stmts, opt_stats, print_gimple_stmt(), propagate_tree_value_into_stmt(), recompute_tree_invariant_for_addr_expr(), record_equivalences_from_stmt(), release_defs(), edge_info::rhs, unlink_stmt_vdef(), and update_stmt_if_modified().
|
static |
Print a diagnostic dump of an expression hash table entry.
References hashable_expr::binary, hashable_expr::call, expr_hash_elt::expr, EXPR_BINARY, EXPR_CALL, EXPR_PHI, EXPR_SINGLE, EXPR_TERNARY, EXPR_UNARY, hashable_expr::fn_from, gimple_call_fn(), gimple_call_internal_fn(), gimple_call_internal_p(), internal_fn_name(), hashable_expr::kind, expr_hash_elt::lhs, hashable_expr::nargs, hashable_expr::ops, hashable_expr::phi, print_generic_expr(), print_gimple_stmt(), hashable_expr::single, expr_hash_elt::stmt, hashable_expr::ternary, tree_code_name, and hashable_expr::unary.
Referenced by lookup_avail_expr(), record_cond(), and remove_local_expressions_from_table().
|
static |
Propagate RHS into all uses of LHS (when possible). RHS and LHS are derived from STMT, which is passed in solely so that we can remove it if propagation is successful. When propagating into a PHI node or into a statement which turns into a trivial copy or constant initialization, set the appropriate bit in INTERESTING_NAMEs so that we will visit those nodes as well in an effort to pick up secondary optimization opportunities.
References bitmap_set_bit(), cfg_altered, edge_def::count, edge_def::dest, dump_file, dump_flags, ei_next(), ei_safe_edge(), find_taken_edge(), edge_def::flags, fold_binary_loc(), fold_stmt_inplace(), get_lhs_or_phi_result(), gimple_assign_lhs(), gimple_assign_rhs1(), gimple_assign_single_p(), gimple_bb(), gimple_cond_code(), gimple_cond_lhs(), gimple_cond_rhs(), gimple_debug_bind_p(), gimple_goto_dest(), gimple_location(), gimple_phi_result(), gimple_switch_index(), gsi_end_p(), gsi_for_stmt(), gsi_last_bb(), gsi_next(), gsi_remove(), gsi_start_phis(), gsi_stmt(), has_zero_uses(), is_gimple_min_invariant(), loop_depth_of_name(), may_propagate_copy(), may_propagate_copy_into_asm(), maybe_clean_or_replace_eh_stmt(), print_generic_expr(), print_gimple_stmt(), edge_def::probability, propagate_value(), recompute_tree_invariant_for_addr_expr(), remove_edge(), remove_stmt_or_phi(), basic_block_def::succs, and update_stmt().
Referenced by eliminate_const_or_copy().
|
static |
Referenced by dom_opt_leave_block(), and record_equivalences_from_incoming_edge().
|
static |
Enter condition equivalence into the expression hash table. This indicates that a conditional expression has a known boolean value.
References cond_equivalence_s::cond, dump_file, dump_flags, hash_table< Descriptor, Allocator >::find_slot_with_hash(), free_expr_hash_elt(), expr_hash_elt::hash, initialize_hash_element_from_expr(), print_expr_hash_elt(), and cond_equivalence_s::value.
|
static |
Record that COND is true and INVERTED is false into the edge information structure. Also record that any conditions dominated by COND are true as well. For example, if a < b is true, then a <= b must also be true.
References build_and_record_new_cond(), cond_equivalence_s::cond, edge_info::cond_equivalences, initialize_expr_from_cond(), and cond_equivalence_s::value.
Referenced by record_edge_info().
Referenced by dom_opt_leave_block(), and eliminate_redundant_computations().
|
static |
Record that X is equal to Y in const_and_copies. Record undo information in the block-local vector.
References record_const_or_copy_1().
|
static |
A helper function for record_const_or_copy and record_equality. Do the work of recording the value and undo info.
References dump_file, dump_flags, print_generic_expr(), and set_ssa_name_value().
Referenced by record_const_or_copy(), and record_equality().
|
static |
We have finished optimizing BB, record any information implied by taking a specific outgoing edge from BB.
References allocate_edge_info(), edge_def::dest, extract_true_false_edges_from_block(), fold_convert_loc(), free(), gimple_cond_code(), gimple_cond_lhs(), gimple_cond_rhs(), gimple_location(), gimple_switch_index(), gimple_switch_label(), gimple_switch_num_labels(), gsi_end_p(), gsi_last_bb(), gsi_stmt(), basic_block_def::index, integer_zerop(), invert_truthvalue_loc(), is_gimple_min_invariant(), edge_info::lhs, real_zerop(), record_conditions(), edge_info::rhs, basic_block_def::succs, and target_bb.
Referenced by dom_opt_enter_block().
Referenced by record_equivalences_from_incoming_edge().
|
static |
Similarly, but assume that X and Y are the two operands of an EQ_EXPR. This constrains the cases in which we may treat this as assignment.
References dconst0, is_gimple_min_invariant(), loop_depth_of_name(), and record_const_or_copy_1().
|
static |
Referenced by dom_opt_enter_block().
|
static |
Record any equivalences created by the incoming edge to BB. If BB has more than one incoming edge, then no equivalence is created.
References edge_def::aux, CDI_DOMINATORS, edge_info::cond_equivalences, get_immediate_dominator(), gimple_assign_rhs1(), gimple_assign_rhs_code(), int_fits_type_p(), is_gimple_assign(), is_gimple_constant(), edge_info::lhs, record_cond(), record_equality(), edge_info::rhs, single_incoming_edge_ignoring_loop_edges(), and edge_def::src.
|
static |
Referenced by dom_opt_enter_block().
|
static |
PHI nodes can create equivalences too. Ignoring any alternatives which are the same as the result, if all the alternatives are equal, then the PHI node creates an equivalence.
References gimple_phi_arg_def(), gimple_phi_num_args(), gimple_phi_result(), gsi_end_p(), gsi_next(), gsi_start_phis(), gsi_stmt(), may_propagate_copy(), operand_equal_for_phi_arg_p(), and set_ssa_name_value().
|
static |
Referenced by optimize_stmt().
|
static |
STMT, a GIMPLE_ASSIGN, may create certain equivalences, in either the available expressions table or the const_and_copies table. Detect and record those equivalences.
We handle only very simple copy equivalences here. The heavy lifing is done by eliminate_redundant_computations.
References dump_file, dump_flags, gimple_assign_lhs(), gimple_assign_rhs1(), gimple_assign_single_p(), gimple_has_volatile_ops(), gimple_references_memory_p(), gimple_set_vuse(), gimple_vdef(), is_gimple_assign(), is_gimple_min_invariant(), is_gimple_reg(), edge_info::lhs, lookup_avail_expr(), print_generic_expr(), edge_info::rhs, and set_ssa_name_value().
|
static |
Initialize local stacks for this optimizer and record equivalences upon entry to BB. Equivalences can come from the edge traversed to reach BB or they may come from PHI nodes at the start of BB.
Remove all the expressions in LOCALS from TABLE, stopping when there are LIMIT entries left in LOCALs.
References hash_table< Descriptor, Allocator >::clear_slot(), dump_file, dump_flags, hash_table< Descriptor, Allocator >::find_slot_with_hash(), expr_hash_elt::hash, and print_expr_hash_elt().
Referenced by dom_opt_enter_block(), and dom_opt_leave_block().
|
static |
Given a statement STMT, which is either a PHI node or an assignment, remove it from the IL.
References gsi_for_stmt(), gsi_remove(), release_defs(), and remove_phi_node().
Referenced by eliminate_const_or_copy(), and propagate_rhs_into_lhs().
|
static |
Use the source/dest pairs in CONST_AND_COPIES_STACK to restore CONST_AND_COPIES to its original state, stopping when we hit a NULL marker.
References dump_file, dump_flags, print_generic_expr(), and set_ssa_name_value().
Referenced by dom_opt_leave_block().
bool simple_iv_increment_p | ( | ) |
Returns true when STMT is a simple iv increment. It detects the following situation: i_1 = phi (..., i_2) i_2 = i_1 +/- ...
References gimple_assign_lhs(), gimple_assign_rhs1(), gimple_assign_rhs_code(), gimple_phi_arg_def(), gimple_phi_num_args(), and hashable_expr::phi.
A trivial wrapper so that we can present the generic jump threading code with a simple API for simplifying statements.
References lookup_avail_expr().
Referenced by dom_thread_across_edge().
|
static |
Referenced by record_equivalences_from_incoming_edge().
|
static |
Ignoring loop backedges, if BB has precisely one incoming edge then return that edge. Otherwise return NULL.
References CDI_DOMINATORS, edge_def::dest, dominated_by_p(), basic_block_def::preds, and edge_def::src.
|
static |
Jump threading, redundancy elimination and const/copy propagation. This pass may expose new symbols that need to be renamed into SSA. For every new symbol exposed, its corresponding bit will be set in VARS_TO_RENAME.
References dom_walk_data::after_dom_children, dom_walk_data::before_dom_children, bitmap_clear(), bitmap_empty_p(), bitmap_set_bit(), dom_walk_data::block_local_data_size, calculate_dominance_info(), CDI_DOMINATORS, cfg_altered, cfun, hash_table< Descriptor, Allocator >::create(), hash_table< Descriptor, Allocator >::dispose(), dom_opt_enter_block(), dom_opt_leave_block(), dump_dominator_optimization_stats(), dump_file, dump_flags, fini_walk_dominator_tree(), first_pass_instance, free_all_edge_infos(), free_dominance_info(), gimple_purge_all_dead_eh_edges(), dom_walk_data::global_data, gsi_end_p(), gsi_next(), gsi_start_bb(), gsi_stmt(), basic_block_def::index, init_walk_dominator_tree(), dom_walk_data::initialize_block_local_data, loop_optimizer_finalize(), loop_optimizer_init(), LOOPS_HAVE_SIMPLE_LATCHES, mark_dfs_back_edges(), memset(), opt_stats_d::num_const_prop, opt_stats_d::num_copy_prop, opt_stats_d::num_re, opt_stats, single_succ(), single_succ_edge(), single_succ_p(), ssa_name_values, statistics_counter_event(), thread_through_all_blocks(), threadedge_finalize_values(), threadedge_initialize_values(), update_ssa(), update_stmt_if_modified(), and walk_dominator_tree().
|
static |
Hash table with expressions made available during the renaming process. When an assignment of the form X_i = EXPR is found, the statement is stored in this table. If the same expression EXPR is later found on the RHS of another statement, it is replaced with X_i (thus performing global redundancy elimination). Similarly as we pass through conditionals we record the conditional itself as having either a true or false value in this table.
|
static |
|
static |
Track whether or not we have changed the control flow graph.
Referenced by eliminate_degenerate_phis(), optimize_stmt(), propagate_rhs_into_lhs(), and tree_ssa_dominator_optimize().
Stack of dest,src pairs that need to be restored during finalization. A NULL entry is used to mark the end of pairs which need to be restored during finalization of this block.
|
static |
Bitmap of blocks that have had EH statements cleaned. We should remove their dead edges eventually.
|
static |