diff options
author | dberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-03-13 00:46:07 +0000 |
---|---|---|
committer | dberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-03-13 00:46:07 +0000 |
commit | 2be14d8b4c2974628dc7594f5d85b86c405e7d28 (patch) | |
tree | 03744f60b00db0493040ec2c836323945507bf16 /gcc/tree-flow-inline.h | |
parent | 74637d104fa133d2792bd8f1e72069ba0b285523 (diff) | |
download | gcc-2be14d8b4c2974628dc7594f5d85b86c405e7d28.tar.gz |
In gcc/ada/
2005-03-12 Daniel Berlin <dberlin@dberlin.org>
* misc.c (gnat_post_options): Turn off structural
aliasing for now.
In gcc/
2005-03-12 Daniel Berlin <dberlin@dberlin.org>
* tree-flow-inline.h (ref_contains_array_ref): New function.
(lookup_subvars_for_var): Ditto.
(get_subvars_for_var): Ditto.
(var_can_have_subvars): Ditto.
* tree-flow.h (mem_tag_kind): Add STRUCT_FIELD.
(struct subvar): New type.
* tree-dfa.c (okay_component_ref_for_subvars): New function.
* tree-optimize.c (init_tree_optimization_passes): Call
pass_create_structure_vars.
* tree-ssa-alias.c: Include vec.h.
(init_alias_info): Don't auto-clear call clobbered on struct-field
tags.
(compute_flow_insensitive_aliasing): Handle subvars.
(group_aliases): Handle STRUCT_FIELD aliases.
(setup_pointers_and_addressables): Ditto.
Don't mark variables non-addressable if they still have
addressable subvars.
Also mark subvars addressable when the real variable is marked
addressable.
(add_pointed_to_var): Try to prune the pointed-to set by only
pointing to subvars when possible.
Otherwise, make sure we set addresses_needed and pt_vars to
properly include subvars.
(bitpos_of_field): New function.
(push_fields_onto_fieldstack): Ditto.
(get_or_create_used_part_for): Ditto.
(create_overlap_variables_for): Ditto.
(find_used_portions): Ditto.
(create_structure_vars): Ditto.
(pass_create_structure_vars): New structure.
* tree-ssa-operands.c (finalize_ssa_v_must_defs): Remove assert.
(get_expr_operands): Handle subvars. Also try to turn
COMPONENT_REF accesses into must-defs now that we can accurately
portray it.
(note_addressable): Try to only mark as addressable those subvars
we know a COMPONENT_REF touches.
(overlap_subvar): New function.
* tree-vect-analyze.c (vect_object_analysis): Add new parameter.
Handle subvar storing.
(vect_address_analysis): Update caller of vect_object_analysis.
* tree-vect-transform.c (vect_create_data_ref_ptr): Copy subvars.
* tree-vectorizer.h (struct _stmt_vec_info): Add subvars member.
(STMT_VINFO_SUBVARS): New macro.
* common.opts: add flag_tree_salias.
* opts.c (decode_options): flag_tree_salias defaults to on.
* doc/invoke.texi: Document fdump-tree-svars and -ftree-salias.
* doc/tree-ssa.texi: Document structural alias analysis.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@96362 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-flow-inline.h')
-rw-r--r-- | gcc/tree-flow-inline.h | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/gcc/tree-flow-inline.h b/gcc/tree-flow-inline.h index 70450537698..7701e5cc7fd 100644 --- a/gcc/tree-flow-inline.h +++ b/gcc/tree-flow-inline.h @@ -878,4 +878,60 @@ op_iter_init_mustdef (ssa_op_iter *ptr, tree stmt, use_operand_p *kill, op_iter_init (ptr, stmt, SSA_OP_VMUSTDEFKILL); op_iter_next_mustdef (kill, def, ptr); } + +/* Return true if REF, a COMPONENT_REF, has an ARRAY_REF somewhere in it. */ + +static inline bool +ref_contains_array_ref (tree ref) +{ + while (handled_component_p (ref)) + { + if (TREE_CODE (ref) == ARRAY_REF) + return true; + ref = TREE_OPERAND (ref, 0); + } + return false; +} + +/* Given a variable VAR, lookup and return a pointer to the list of + subvariables for it. */ + +static inline subvar_t * +lookup_subvars_for_var (tree var) +{ + var_ann_t ann = var_ann (var); + gcc_assert (ann); + return &ann->subvars; +} + +/* Given a variable VAR, return a linked list of subvariables for VAR, or + NULL, if there are no subvariables. */ + +static inline subvar_t +get_subvars_for_var (tree var) +{ + subvar_t subvars; + + gcc_assert (SSA_VAR_P (var)); + + if (TREE_CODE (var) == SSA_NAME) + subvars = *(lookup_subvars_for_var (SSA_NAME_VAR (var))); + else + subvars = *(lookup_subvars_for_var (var)); + return subvars; +} + +/* Return true if V is a tree that we can have subvars for. + Normally, this is any aggregate type, however, due to implementation + limitations ATM, we exclude array types as well. */ + +static inline bool +var_can_have_subvars (tree v) +{ + return (AGGREGATE_TYPE_P (TREE_TYPE (v)) && + TREE_CODE (TREE_TYPE (v)) != ARRAY_TYPE); +} + + + #endif /* _TREE_FLOW_INLINE_H */ |