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

bool ao_ref_init_from_vn_reference ( ao_ref ref,
alias_set_type  set,
tree  type,
vec< vn_reference_op_s ops 
)
   Build a alias-oracle reference abstraction in *REF from the vn_reference
   operands in *OPS, the reference alias set SET and the reference type TYPE.
   Return true if something useful was produced.  
     First get the final access size from just the outermost expression.  
     Initially, maxsize is the same as the accessed element size.
     In the following it will only grow (or become -1).  
     Compute cumulative bit-offset for nested component-refs and array-refs,
     and find the ultimate containing object.  
           These may be in the reference ops, but we cannot do anything
           sensible with them here.  
             Apart from ADDR_EXPR arguments to MEM_REF.  
             Fallthru.  
           Record the base objects.  
           And now the usual component-reference style ops.  
               We do not have a complete COMPONENT_REF tree here so we
               cannot use component_ref_field_offset.  Do the interesting
               parts manually.  
             We recorded the lower bound and the element size.  
     We discount volatiles from value-numbering elsewhere.  
void copy_reference_ops_from_call ( gimple  call,
vec< vn_reference_op_s > *  result 
)
   Copy the operations present in load/store/call REF into RESULT, a vector of
   vn_reference_op_s's.  
     If 2 calls have a different non-ssa lhs, vdef value numbers should be
     different.  By adding the lhs here in the vector, we ensure that the
     hashcode is different, guaranteeing a different value number.  
     Copy the type, opcode, function being called and static chain.  
     Copy the call arguments.  As they can be references as well,
     just chain them together.  

Referenced by insert_aux().

void copy_reference_ops_from_ref ( tree  ,
vec< vn_reference_op_s > *   
)
bool expressions_equal_p ( tree  ,
tree   
)
   In tree-ssa-sccvn.c  
void free_scc_vn ( void  )

Referenced by DFS().

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.  
unsigned int get_next_value_id ( void  )
   Return the next unique value id.  

Referenced by create_component_ref_by_pieces(), and DFS().

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.  

References vn_nary_op_s::hashcode, and vn_nary_op_s::value_id.

Referenced by get_expr_type(), init_vn_nary_op_from_op(), init_vn_nary_op_from_pieces(), and vn_nary_op_eq().

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.  
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.  
static hashval_t vn_hash_type ( )
inlinestatic
   Hash the type TYPE using bits that distinguishes it in the
   types_compatible_p sense.  
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.  
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.  
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.  
     The only thing we have to do is from &OBJ.foo.bar add the offset
     from .foo.bar to the preceding MEM_REF offset and replace the
     address with &OBJ.  
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 
)
   Insert a reference by it's pieces into the current hash table with
   a value number of RESULT.  Return the resulting reference
   structure we created.  
     At this point we should have all the things inserted that we have
     seen before, and we should never try inserting something that
     already exists.  
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.  
         Make sure to use a valueized reference if we valueized anything.
         Otherwise preserve the full reference for advanced TBAA.  

References commutative_tree_code(), iterative_hash_expr(), iterative_hash_hashval_t(), vn_nary_op_s::length, vn_nary_op_s::op, and tree_swap_operands_p().

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.  

Referenced by insert_aux().

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

Variable Documentation

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