GCC Middle and Back End API Reference
tree-ssa-sccvn.h File Reference

Go to the source code of this file.

Data Structures

struct  vn_nary_op_s
struct  vn_phi_s
struct  vn_reference_op_struct
struct  vn_reference_s
struct  vn_constant_s
struct  vn_ssa_aux

Typedefs

typedef struct vn_nary_op_svn_nary_op_t
typedef struct vn_nary_op_sconst_vn_nary_op_t
typedef struct vn_phi_svn_phi_t
typedef struct vn_phi_sconst_vn_phi_t
typedef struct
vn_reference_op_struct 
vn_reference_op_s
typedef vn_reference_op_svn_reference_op_t
typedef const vn_reference_op_sconst_vn_reference_op_t
typedef struct vn_reference_svn_reference_t
typedef struct vn_reference_sconst_vn_reference_t
typedef struct vn_constant_svn_constant_t
typedef struct vn_ssa_auxvn_ssa_aux_t

Enumerations

enum  vn_kind {
  VN_NONE, VN_CONSTANT, VN_NARY, VN_REFERENCE,
  VN_PHI
}
enum  vn_lookup_kind { VN_NOWALK, VN_WALK, VN_WALKREWRITE }

Functions

bool expressions_equal_p (tree, tree)
static size_t sizeof_vn_nary_op ()
enum vn_kind vn_get_stmt_kind (gimple)
static hashval_t vn_hash_type ()
static hashval_t vn_hash_constant_with_type ()
static bool vn_constant_eq_with_type ()
vn_ssa_aux_t VN_INFO (tree)
vn_ssa_aux_t VN_INFO_GET (tree)
tree vn_get_expr_for (tree)
bool run_scc_vn (vn_lookup_kind)
void free_scc_vn (void)
tree vn_nary_op_lookup (tree, vn_nary_op_t *)
tree vn_nary_op_lookup_stmt (gimple, vn_nary_op_t *)
tree vn_nary_op_lookup_pieces (unsigned int, enum tree_code, tree, tree *, vn_nary_op_t *)
vn_nary_op_t vn_nary_op_insert (tree, tree)
vn_nary_op_t vn_nary_op_insert_stmt (gimple, tree)
vn_nary_op_t vn_nary_op_insert_pieces (unsigned int, enum tree_code, tree, tree *, tree, unsigned int)
void vn_reference_fold_indirect (vec< vn_reference_op_s > *, unsigned int *)
void copy_reference_ops_from_ref (tree, vec< vn_reference_op_s > *)
void copy_reference_ops_from_call (gimple, vec< vn_reference_op_s > *)
bool ao_ref_init_from_vn_reference (ao_ref *, alias_set_type, tree, vec< vn_reference_op_s >)
tree vn_reference_lookup_pieces (tree, alias_set_type, tree, vec< vn_reference_op_s >, vn_reference_t *, vn_lookup_kind)
tree vn_reference_lookup (tree, tree, vn_lookup_kind, vn_reference_t *)
vn_reference_t vn_reference_insert (tree, tree, tree, tree)
vn_reference_t vn_reference_insert_pieces (tree, alias_set_type, tree, vec< vn_reference_op_s >, tree, unsigned int)
hashval_t vn_nary_op_compute_hash (const vn_nary_op_t)
bool vn_nary_op_eq (const_vn_nary_op_t const vno1, const_vn_nary_op_t const vno2)
bool vn_nary_may_trap (vn_nary_op_t)
hashval_t vn_reference_compute_hash (const vn_reference_t)
bool vn_reference_eq (const_vn_reference_t const, const_vn_reference_t const)
unsigned int get_max_value_id (void)
unsigned int get_next_value_id (void)
unsigned int get_constant_value_id (tree)
unsigned int get_or_alloc_constant_value_id (tree)
bool value_id_constant_p (unsigned int)
tree fully_constant_vn_reference_p (vn_reference_t)
static tree vn_valueize ()

Variables

tree VN_TOP

Typedef Documentation

typedef struct vn_phi_s* const_vn_phi_t
typedef struct vn_constant_s * vn_constant_t
typedef struct vn_nary_op_s * vn_nary_op_t
N-ary operations in the hashtable consist of length operands, an
   opcode, and a type.  Result is the value number of the operation,
   and hashcode is stored to avoid having to calculate it
   repeatedly.   
typedef struct vn_phi_s * vn_phi_t
Phi nodes in the hashtable consist of their non-VN_TOP phi
   arguments, and the basic block the phi is in. Result is the value
   number of the operation, and hashcode is stored to avoid having to
   calculate it repeatedly.  Phi nodes not in the same block are never
   considered equivalent.   
Reference operands only exist in reference operations structures.
   They consist of an opcode, type, and some number of operands.  For
   a given opcode, some, all, or none of the operands may be used.
   The operands are there to store the information that makes up the
   portion of the addressing calculation that opcode performs.   
typedef struct vn_reference_s * vn_reference_t
A reference operation in the hashtable is representation as
   the vuse, representing the memory state at the time of
   the operation, and a collection of operands that make up the
   addressing calculation.  If two vn_reference_t's have the same set
   of operands, they access the same memory location. We also store
   the resulting value number, and the hashcode.   
typedef struct vn_ssa_aux * vn_ssa_aux_t

Enumeration Type Documentation

enum vn_kind
Enumerator:
VN_NONE 
VN_CONSTANT 
VN_NARY 
VN_REFERENCE 
VN_PHI 
Enumerator:
VN_NOWALK 
VN_WALK 
VN_WALKREWRITE 

Function Documentation

void copy_reference_ops_from_ref ( tree  ,
vec< vn_reference_op_s > *   
)
bool expressions_equal_p ( tree  ,
tree   
)
In tree-ssa-sccvn.c   
tree fully_constant_vn_reference_p ( vn_reference_t  )
unsigned int get_constant_value_id ( tree  )
unsigned int get_max_value_id ( void  )
Return the maximum value id we have ever seen.   

References next_value_id.

Referenced by init_pre(), and phi_translate_1().

unsigned int get_next_value_id ( void  )
unsigned int get_or_alloc_constant_value_id ( tree  )
bool run_scc_vn ( vn_lookup_kind  )
static size_t sizeof_vn_nary_op ( )
inlinestatic
Return the size of a vn_nary_op_t with LENGTH operands.   

Referenced by alloc_vn_nary_op_noinit(), copy_nary(), phi_translate_1(), vn_nary_op_lookup(), vn_nary_op_lookup_pieces(), and vn_nary_op_lookup_stmt().

bool value_id_constant_p ( unsigned  int)
static bool vn_constant_eq_with_type ( )
inlinestatic
Compare the constants C1 and C2 with distinguishing type incompatible
   constants in the types_compatible_p sense.   

References expressions_equal_p(), and types_compatible_p().

Referenced by pre_expr_d::equal(), and vn_constant_hasher::equal().

tree vn_get_expr_for ( tree  )
enum vn_kind vn_get_stmt_kind ( gimple  )
static hashval_t vn_hash_constant_with_type ( )
inlinestatic
Hash the constant CONSTANT with distinguishing type incompatible
   constants in the types_compatible_p sense.   

References iterative_hash_expr(), and vn_hash_type().

Referenced by get_constant_value_id(), get_or_alloc_constant_value_id(), and pre_expr_d::hash().

static hashval_t vn_hash_type ( )
inlinestatic
Hash the type TYPE using bits that distinguishes it in the
   types_compatible_p sense.   

Referenced by vn_hash_constant_with_type(), and vn_phi_compute_hash().

vn_ssa_aux_t VN_INFO ( tree  )
Return the value numbering info for an SSA_NAME.   
vn_ssa_aux_t VN_INFO_GET ( tree  )
bool vn_nary_may_trap ( vn_nary_op_t  )
hashval_t vn_nary_op_compute_hash ( const vn_nary_op_t  )
bool vn_nary_op_eq ( const_vn_nary_op_t const  vno1,
const_vn_nary_op_t const  vno2 
)
vn_nary_op_t vn_nary_op_insert ( tree  ,
tree   
)
vn_nary_op_t vn_nary_op_insert_pieces ( unsigned int  length,
enum tree_code  code,
tree  type,
tree ops,
tree  result,
unsigned int  value_id 
)
Insert a n-ary operation into the current hash table using it's
   pieces.  Return the vn_nary_op_t structure we created and put in
   the hashtable.   

References alloc_vn_nary_op(), init_vn_nary_op_from_pieces(), vn_tables_s::nary, and vn_nary_op_insert_into().

Referenced by phi_translate_1().

vn_nary_op_t vn_nary_op_insert_stmt ( gimple  ,
tree   
)
tree vn_nary_op_lookup ( tree  ,
vn_nary_op_t  
)
tree vn_nary_op_lookup_pieces ( unsigned int  length,
enum tree_code  code,
tree  type,
tree ops,
vn_nary_op_t vnresult 
)
Lookup a n-ary operation by its pieces and return the resulting value
   number if it exists in the hash table.  Return NULL_TREE if it does
   not exist in the hash table or if the result field of the operation
   is NULL. VNRESULT will contain the vn_nary_op_t from the hashtable
   if it exists.   

References init_vn_nary_op_from_pieces(), sizeof_vn_nary_op(), and vn_nary_op_lookup_1().

Referenced by phi_translate_1().

tree vn_nary_op_lookup_stmt ( gimple  ,
vn_nary_op_t  
)
hashval_t vn_reference_compute_hash ( const vn_reference_t  )
bool vn_reference_eq ( const_vn_reference_t  const,
const_vn_reference_t  const 
)
void vn_reference_fold_indirect ( vec< vn_reference_op_s > *  ops,
unsigned int *  i_p 
)
Fold *& at position *I_P in a vn_reference_op_s vector *OPS.  Updates
   *I_P to point to the last element of the replacement.   

References double_int_to_tree(), double_int::from_shwi(), get_addr_base_and_unit_offset(), host_integerp(), HOST_WIDE_INT, vn_reference_op_struct::off, vn_reference_op_struct::op0, double_int::sext(), and tree_to_double_int().

Referenced by phi_translate_1(), valueize_refs_1(), and vn_reference_maybe_forwprop_address().

vn_reference_t vn_reference_insert ( tree  ,
tree  ,
tree  ,
tree   
)
vn_reference_t vn_reference_insert_pieces ( tree  vuse,
alias_set_type  set,
tree  type,
vec< vn_reference_op_s operands,
tree  result,
unsigned int  value_id 
)
tree vn_reference_lookup ( tree  op,
tree  vuse,
vn_lookup_kind  kind,
vn_reference_t vnresult 
)
Lookup OP in the current hash table, and return the resulting value
   number if it exists in the hash table.  Return NULL_TREE if it does
   not exist in the hash table or if the result field of the structure
   was NULL..  VNRESULT will be filled in with the vn_reference_t
   stored in the hashtable if one exists.   

References ao_ref_init(), ao_ref_init_from_vn_reference(), fully_constant_vn_reference_p(), get_alias_set(), vn_reference_s::hashcode, vn_reference_s::operands, vn_reference_s::result, vn_reference_s::set, vn_reference_s::type, valueize_shared_reference_ops_from_ref(), VN_NOWALK, vn_reference_compute_hash(), vn_reference_lookup_1(), vn_reference_lookup_2(), vn_reference_lookup_3(), vn_walk_kind, vn_reference_s::vuse, and walk_non_aliased_vuses().

Referenced by compute_avail(), eliminate_bb(), visit_reference_op_load(), and visit_reference_op_store().

tree vn_reference_lookup_pieces ( tree  vuse,
alias_set_type  set,
tree  type,
vec< vn_reference_op_s operands,
vn_reference_t vnresult,
vn_lookup_kind  kind 
)
Lookup a reference operation by it's parts, in the current hash table.
   Returns the resulting value number if it exists in the hash table,
   NULL_TREE otherwise.  VNRESULT will be filled in with the actual
   vn_reference_t stored in the hashtable if something is found.   

References ao_ref_init_from_vn_reference(), fully_constant_vn_reference_p(), vn_reference_s::hashcode, memcpy(), vn_reference_s::operands, vn_reference_s::set, vn_reference_s::type, type(), valueize_refs(), VN_NOWALK, vn_reference_compute_hash(), vn_reference_lookup_1(), vn_reference_lookup_2(), vn_reference_lookup_3(), vn_walk_kind, vn_reference_s::vuse, and walk_non_aliased_vuses().

Referenced by compute_avail(), and phi_translate_1().

static tree vn_valueize ( )
inlinestatic
Valueize NAME if it is an SSA name, otherwise just return it.   

References vn_ssa_aux::valnum, VN_INFO(), and VN_TOP.

Referenced by gimple_equal_p(), gvn_uses_equal(), same_succ_hash(), simplify_binary_expression(), try_to_simplify(), and valueize_expr().


Variable Documentation

tree VN_TOP
TOP of the VN lattice.   
This represents the top of the VN lattice, which is the universal
   value.   

Referenced by eliminate_bb(), init_scc_vn(), run_scc_vn(), set_ssa_val_to(), visit_phi(), vn_get_expr_for(), vn_phi_compute_hash(), vn_phi_eq(), and vn_valueize().