GCC Middle and Back End API Reference
|
#include <tree-ssa-scopedtables.h>
Public Member Functions | |
avail_exprs_stack (hash_table< expr_elt_hasher > *table) | |
~avail_exprs_stack (void) | |
void | push_marker (void) |
void | pop_to_marker (void) |
void | record_expr (expr_hash_elt_t, expr_hash_elt_t, char) |
hash_table< expr_elt_hasher > * | avail_exprs (void) |
tree | lookup_avail_expr (gimple *, bool, bool, expr_hash_elt **=NULL) |
void | record_cond (cond_equivalence *) |
Private Member Functions | |
tree | simplify_binary_operation (gimple *, class expr_hash_elt) |
avail_exprs_stack & | operator= (const avail_exprs_stack &) |
avail_exprs_stack (class avail_exprs_stack &) | |
Private Attributes | |
vec< std::pair< expr_hash_elt_t, expr_hash_elt_t > > | m_stack |
hash_table< expr_elt_hasher > * | m_avail_exprs |
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.
|
inline |
References m_avail_exprs, m_stack, and table.
Referenced by avail_exprs_stack(), and operator=().
|
inline |
References m_stack.
|
private |
References avail_exprs_stack().
|
inline |
References m_avail_exprs.
tree avail_exprs_stack::lookup_avail_expr | ( | gimple * | stmt, |
bool | insert, | ||
bool | tbaa_p, | ||
expr_hash_elt ** | elt = NULL ) |
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, 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(), and dom_opt_dom_walker::test_for_singularity().
|
private |
References avail_exprs_stack().
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 dump_file, dump_flags, gcc_assert, m_avail_exprs, m_stack, NULL, and TDF_DETAILS.
|
inline |
References NULL, and record_expr().
void avail_exprs_stack::record_cond | ( | cond_equivalence * | p | ) |
Enter condition equivalence P into the hash table. This indicates that a conditional expression has a known boolean value.
References cond_equivalence::cond, expr_hash_elt::hash(), m_avail_exprs, NULL, record_expr(), and cond_equivalence::value.
Referenced by record_temporary_equivalences().
void avail_exprs_stack::record_expr | ( | expr_hash_elt_t | , |
expr_hash_elt_t | , | ||
char | ) |
Add <ELT1,ELT2> to the unwinding stack so they can be later removed from the hash table.
References dump_file, dump_flags, m_stack, expr_hash_elt::print(), and TDF_DETAILS.
Referenced by lookup_avail_expr(), push_marker(), and record_cond().
|
private |
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_hash_elt::expr(), EXPR_BINARY, 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().
|
private |
Referenced by avail_exprs(), avail_exprs_stack(), lookup_avail_expr(), pop_to_marker(), record_cond(), and simplify_binary_operation().
|
private |
Referenced by avail_exprs_stack(), pop_to_marker(), record_expr(), and ~avail_exprs_stack().