GCC Middle and Back End API Reference
avail_exprs_stack Class Reference

#include <tree-ssa-scopedtables.h>

Collaboration diagram for avail_exprs_stack:

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_stackoperator= (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

Detailed Description

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.    

Constructor & Destructor Documentation

◆ avail_exprs_stack() [1/2]

avail_exprs_stack::avail_exprs_stack ( hash_table< expr_elt_hasher > * table)

References m_avail_exprs, m_stack, and table.

◆ ~avail_exprs_stack()

avail_exprs_stack::~avail_exprs_stack ( void )

References m_stack.

◆ avail_exprs_stack() [2/2]

avail_exprs_stack::avail_exprs_stack ( class avail_exprs_stack & )

Member Function Documentation

◆ avail_exprs()

hash_table< expr_elt_hasher > * avail_exprs_stack::avail_exprs ( void )

References m_avail_exprs.

◆ lookup_avail_expr()

tree avail_exprs_stack::lookup_avail_expr ( gimple * stmt,
bool insert,
bool tbaa_p,
expr_hash_elt ** elt = NULL )

◆ operator=()

avail_exprs_stack & avail_exprs_stack::operator= ( const avail_exprs_stack & )

◆ pop_to_marker()

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.

◆ push_marker()

void avail_exprs_stack::push_marker ( void )

References NULL, and record_expr().

◆ record_cond()

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, hash_table< Descriptor, Lazy, Allocator >::find_slot_with_hash(), expr_hash_elt::hash(), m_avail_exprs, NULL, record_expr(), and cond_equivalence::value.

Referenced by record_temporary_equivalences().

◆ record_expr()

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().

◆ simplify_binary_operation()

tree avail_exprs_stack::simplify_binary_operation ( gimple * stmt,
class expr_hash_elt element )
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().

Field Documentation

◆ m_avail_exprs

◆ m_stack

vec<std::pair<expr_hash_elt_t, expr_hash_elt_t> > avail_exprs_stack::m_stack

The documentation for this class was generated from the following files: