This class defines a unwindable expression equivalence table
layered on top of the expression hash table.
Essentially it's just a stack of available expression value pairs with
a special marker (NULL, NULL) to indicate unwind points.
Search for an existing instance of STMT in the AVAIL_EXPRS_STACK 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, Lazy, Allocator >::find_slot(), gimple_get_lhs(), gimple_phi_result(), gimple_vuse(), if(), insert(), is_gimple_min_invariant(), hashable_expr::kind, m_avail_exprs, NULL, NULL_TREE, hashable_expr::ops, expr_hash_elt::print(), record_expr(), hashable_expr::rhs, simplify_binary_operation(), hashable_expr::single, TDF_DETAILS, and TREE_CODE.
Referenced by eliminate_redundant_computations(), record_equivalences_from_stmt(), dom_jt_simplifier::simplify(), and dom_opt_dom_walker::test_for_singularity().
void avail_exprs_stack::pop_to_marker |
( |
void | | ) |
|
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.
Pop items off the unwinding stack, removing each from the hash table
until a marker is encountered.
References hash_table< Descriptor, Lazy, Allocator >::clear_slot(), dump_file, dump_flags, hash_table< Descriptor, Lazy, Allocator >::find_slot(), gcc_assert, m_avail_exprs, m_stack, NULL, and TDF_DETAILS.
We looked for STMT in the hash table, but did not find it.
If STMT is an assignment from a binary operator, we may know something
about the operands relationship to each other which would allow
us to derive a constant value for the RHS of STMT.
References ALL_FRACT_MODE_P, boolean_type_node, build_one_cst(), build_zero_cst(), expr, expr_hash_elt::expr(), EXPR_BINARY, hash_table< Descriptor, Lazy, Allocator >::find_slot(), FLOAT_TYPE_P, gcc_unreachable, gimple_assign_lhs(), gimple_assign_rhs1(), gimple_assign_rhs2(), HONOR_NANS(), integer_onep(), is_gimple_assign(), m_avail_exprs, NULL_TREE, expr::ops, tree_swap_operands_p(), TREE_TYPE, operand::type, and TYPE_MODE.
Referenced by lookup_avail_expr().