GCC Middle and Back End API 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_s * | vn_nary_op_t |
typedef struct vn_nary_op_s * | const_vn_nary_op_t |
typedef struct vn_phi_s * | vn_phi_t |
typedef struct vn_phi_s * | const_vn_phi_t |
typedef struct vn_reference_op_struct | vn_reference_op_s |
typedef vn_reference_op_s * | vn_reference_op_t |
typedef const vn_reference_op_s * | const_vn_reference_op_t |
typedef struct vn_reference_s * | vn_reference_t |
typedef struct vn_reference_s * | const_vn_reference_t |
typedef struct vn_constant_s * | vn_constant_t |
typedef struct vn_ssa_aux * | vn_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 } |
Variables | |
tree | VN_TOP |
typedef struct vn_nary_op_s* const_vn_nary_op_t |
typedef struct vn_phi_s* const_vn_phi_t |
typedef const vn_reference_op_s* const_vn_reference_op_t |
typedef struct vn_reference_s* const_vn_reference_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.
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.
typedef struct vn_reference_op_struct vn_reference_op_s |
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 vn_reference_op_s* vn_reference_op_t |
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 |
enum vn_kind |
enum vn_lookup_kind |
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 > * | |||
) |
Tree SCC value numbering Copyright (C) 2007-2013 Free Software Foundation, Inc. Contributed by Daniel Berlin dberl in@d berli n.or g
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see http://www.gnu.org/licenses/. 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 | ) |
|
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 | ) |
|
inlinestatic |
Compare the constants C1 and C2 with distinguishing type incompatible constants in the types_compatible_p sense.
|
inlinestatic |
Hash the constant CONSTANT with distinguishing type incompatible constants in the types_compatible_p sense.
|
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, SSA_VAL, TREE_CODE, 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().
|
inlinestatic |
Valueize NAME if it is an SSA name, otherwise just return it.
tree VN_TOP |
TOP of the VN lattice.
This represents the top of the VN lattice, which is the universal value.