Commit 5611cf0b by Richard Guenther Committed by Richard Biener

tree-data-ref.c (dr_analyze_alias): Do not set DR_SUBVARS.

2008-05-08  Richard Guenther  <rguenther@suse.de>

	* tree-data-ref.c (dr_analyze_alias): Do not set DR_SUBVARS.
	* tree-data-ref.h (struct dr_alias): Remove subvars field.
	(DR_SUBVARS): Remove.
	* tree-dfa.c (dump_subvars_for): Remove.
	(debug_subvars_for): Likewise.
	(dump_variable): Do not dump subvars.
	(remove_referenced_var): Do not remove subvars.
	* tree-flow-inline.h (clear_call_clobbered): SFTs no longer exist.
	(lookup_subvars_for_var): Remove.
	(get_subvars_for_var): Likewise.
	(get_subvars_at): Likewise.
	(get_first_overlapping_subvar): Likewise.
	(overlap_subvar): Likewise.
	* tree-flow.h (subvar_t): Remove.
	(struct var_ann_d): Remove subvars field.
	* tree-ssa-alias.c (mark_aliases_call_clobbered): Remove queued
	argument.  Remove special handling of SFTs.
	(compute_tag_properties): Likewise.
	(set_initial_properties): Likewise.
	(compute_call_clobbered): Likewise.
	(count_mem_refs): Likewise.
	(compute_memory_partitions): Likewise.
	(compute_flow_insensitive_aliasing): Likewise.
	(setup_pointers_and_addressables): Likewise.
	(new_type_alias): Likewise.
	(struct used_part): Remove.
	(used_portions): Likewise.
	(struct used_part_map): Likewise.
	(used_part_map_eq): Likewise.
	(used_part_map_hash): Likewise.
	(free_used_part_map): Likewise.
	(up_lookup): Likewise.
	(up_insert): Likewise.
	(get_or_create_used_part_for): Likewise.
	(create_sft): Likewise.
	(create_overlap_variables_for): Likewise.
	(find_used_portions): Likewise.
	(create_structure_vars): Likewise.
	* tree.def (STRUCT_FIELD_TAG): Remove.
	* tree.h (MTAG_P): Adjust.
	(struct tree_memory_tag): Remove base_for_components and
	unpartitionable flags.
	(struct tree_struct_field_tag): Remove.
	(SFT_PARENT_VAR): Likewise.
	(SFT_OFFSET): Likewise.
	(SFT_SIZE): Likewise.
	(SFT_NONADDRESSABLE_P): Likewise.
	(SFT_ALIAS_SET): Likewise.
	(SFT_UNPARTITIONABLE_P): Likewise.
	(SFT_BASE_FOR_COMPONENTS_P): Likewise.
	(union tree_node): Remove sft field.
	* alias.c (get_alias_set): Remove special handling of SFTs.
	* print-tree.c (print_node): Remove handling of SFTs.
	* tree-dump.c (dequeue_and_dump): Likewise.
	* tree-into-ssa.c (mark_sym_for_renaming): Likewise.
	* tree-nrv.c (dest_safe_for_nrv_p): Remove special handling of SFTs.
	* tree-predcom.c (set_alias_info): Do not set subvars.
	* tree-pretty-print.c (dump_generic_node): Do not handle SFTs.
	* tree-ssa-loop-ivopts.c (get_ref_tag): Likewise.
	* tree-ssa-operands.c (access_can_touch_variable): Likewise.
	(add_vars_for_offset): Remove.
	(add_virtual_operand): Remove special handling of SFTs.
	(add_call_clobber_ops): Likewise.
	(add_call_read_ops): Likewise.
	(get_asm_expr_operands): Likewise.
	(get_modify_stmt_operands): Likewise.
	(get_expr_operands): Likewise.
	(add_to_addressable_set): Likewise.
	* tree-ssa.c (verify_ssa_name): Do not handle SFTs.
	* tree-tailcall.c (suitable_for_tail_opt_p): Likewise.
	* tree-vect-transform.c (vect_create_data_ref_ptr): Do not
	set subvars.
	* tree.c (init_ttree): Remove STRUCT_FIELD_TAG initialization.
	(tree_code_size): Remove STRUCT_FIELD_TAG handling.
	(tree_node_structure): Likewise.
	* tree-ssa-structalias.c (set_uids_in_ptset): Remove special
	handling of SFTs.
	(find_what_p_points_to): Likewise.

From-SVN: r135077
parent 8e17a4cf
2008-05-08 Richard Guenther <rguenther@suse.de>
* tree-data-ref.c (dr_analyze_alias): Do not set DR_SUBVARS.
* tree-data-ref.h (struct dr_alias): Remove subvars field.
(DR_SUBVARS): Remove.
* tree-dfa.c (dump_subvars_for): Remove.
(debug_subvars_for): Likewise.
(dump_variable): Do not dump subvars.
(remove_referenced_var): Do not remove subvars.
* tree-flow-inline.h (clear_call_clobbered): SFTs no longer exist.
(lookup_subvars_for_var): Remove.
(get_subvars_for_var): Likewise.
(get_subvars_at): Likewise.
(get_first_overlapping_subvar): Likewise.
(overlap_subvar): Likewise.
* tree-flow.h (subvar_t): Remove.
(struct var_ann_d): Remove subvars field.
* tree-ssa-alias.c (mark_aliases_call_clobbered): Remove queued
argument. Remove special handling of SFTs.
(compute_tag_properties): Likewise.
(set_initial_properties): Likewise.
(compute_call_clobbered): Likewise.
(count_mem_refs): Likewise.
(compute_memory_partitions): Likewise.
(compute_flow_insensitive_aliasing): Likewise.
(setup_pointers_and_addressables): Likewise.
(new_type_alias): Likewise.
(struct used_part): Remove.
(used_portions): Likewise.
(struct used_part_map): Likewise.
(used_part_map_eq): Likewise.
(used_part_map_hash): Likewise.
(free_used_part_map): Likewise.
(up_lookup): Likewise.
(up_insert): Likewise.
(get_or_create_used_part_for): Likewise.
(create_sft): Likewise.
(create_overlap_variables_for): Likewise.
(find_used_portions): Likewise.
(create_structure_vars): Likewise.
* tree.def (STRUCT_FIELD_TAG): Remove.
* tree.h (MTAG_P): Adjust.
(struct tree_memory_tag): Remove base_for_components and
unpartitionable flags.
(struct tree_struct_field_tag): Remove.
(SFT_PARENT_VAR): Likewise.
(SFT_OFFSET): Likewise.
(SFT_SIZE): Likewise.
(SFT_NONADDRESSABLE_P): Likewise.
(SFT_ALIAS_SET): Likewise.
(SFT_UNPARTITIONABLE_P): Likewise.
(SFT_BASE_FOR_COMPONENTS_P): Likewise.
(union tree_node): Remove sft field.
* alias.c (get_alias_set): Remove special handling of SFTs.
* print-tree.c (print_node): Remove handling of SFTs.
* tree-dump.c (dequeue_and_dump): Likewise.
* tree-into-ssa.c (mark_sym_for_renaming): Likewise.
* tree-nrv.c (dest_safe_for_nrv_p): Remove special handling of SFTs.
* tree-predcom.c (set_alias_info): Do not set subvars.
* tree-pretty-print.c (dump_generic_node): Do not handle SFTs.
* tree-ssa-loop-ivopts.c (get_ref_tag): Likewise.
* tree-ssa-operands.c (access_can_touch_variable): Likewise.
(add_vars_for_offset): Remove.
(add_virtual_operand): Remove special handling of SFTs.
(add_call_clobber_ops): Likewise.
(add_call_read_ops): Likewise.
(get_asm_expr_operands): Likewise.
(get_modify_stmt_operands): Likewise.
(get_expr_operands): Likewise.
(add_to_addressable_set): Likewise.
* tree-ssa.c (verify_ssa_name): Do not handle SFTs.
* tree-tailcall.c (suitable_for_tail_opt_p): Likewise.
* tree-vect-transform.c (vect_create_data_ref_ptr): Do not
set subvars.
* tree.c (init_ttree): Remove STRUCT_FIELD_TAG initialization.
(tree_code_size): Remove STRUCT_FIELD_TAG handling.
(tree_node_structure): Likewise.
* tree-ssa-structalias.c (set_uids_in_ptset): Remove special
handling of SFTs.
(find_what_p_points_to): Likewise.
2008-05-08 Sa Liu <saliu@de.ibm.com>
* config/spu/spu.md: Fixed subti3 pattern.
......
......@@ -584,13 +584,6 @@ get_alias_set (tree t)
return 0;
}
/* For non-addressable fields we return the alias set of the
outermost object that could have its address taken. If this
is an SFT use the precomputed value. */
if (TREE_CODE (t) == STRUCT_FIELD_TAG
&& SFT_NONADDRESSABLE_P (t))
return SFT_ALIAS_SET (t);
/* Otherwise, pick up the outermost object that we could have a pointer
to, processing conversions as above. */
while (component_uses_parent_alias_set (t))
......
......@@ -534,15 +534,6 @@ print_node (FILE *file, const char *prefix, tree node, int indent)
&& DECL_HAS_VALUE_EXPR_P (node))
print_node (file, "value-expr", DECL_VALUE_EXPR (node), indent + 4);
if (TREE_CODE (node) == STRUCT_FIELD_TAG)
{
fprintf (file, " sft size " HOST_WIDE_INT_PRINT_DEC,
SFT_SIZE (node));
fprintf (file, " sft offset " HOST_WIDE_INT_PRINT_DEC,
SFT_OFFSET (node));
print_node_brief (file, "parent var", SFT_PARENT_VAR (node),
indent + 4);
}
/* Print the decl chain only if decl is at second level. */
if (indent == 4)
print_node (file, "chain", TREE_CHAIN (node), indent + 4);
......
......@@ -793,8 +793,6 @@ dr_analyze_alias (struct data_reference *dr)
}
DR_SYMBOL_TAG (dr) = smt;
if (smt && var_can_have_subvars (smt))
DR_SUBVARS (dr) = get_subvars_for_var (smt);
vops = BITMAP_ALLOC (NULL);
FOR_EACH_SSA_TREE_OPERAND (op, stmt, it, SSA_OP_VIRTUAL_USES)
......
......@@ -88,7 +88,6 @@ struct dr_alias
/* The alias information that should be used for new pointers to this
location. SYMBOL_TAG is either a DECL or a SYMBOL_MEMORY_TAG. */
tree symbol_tag;
subvar_t subvars;
struct ptr_info_def *ptr_info;
/* The set of virtual operands corresponding to this memory reference,
......@@ -138,7 +137,6 @@ DEF_VEC_ALLOC_P (data_reference_p, heap);
#define DR_STEP(DR) (DR)->innermost.step
#define DR_SYMBOL_TAG(DR) (DR)->alias.symbol_tag
#define DR_PTR_INFO(DR) (DR)->alias.ptr_info
#define DR_SUBVARS(DR) (DR)->alias.subvars
#define DR_VOPS(DR) (DR)->alias.vops
#define DR_ALIGNED_TO(DR) (DR)->innermost.aligned_to
......
......@@ -272,42 +272,6 @@ debug_referenced_vars (void)
}
/* Dump sub-variables for VAR to FILE. */
void
dump_subvars_for (FILE *file, tree var)
{
subvar_t sv = get_subvars_for_var (var);
tree subvar;
unsigned int i;
if (!sv)
return;
fprintf (file, "{ ");
for (i = 0; VEC_iterate (tree, sv, i, subvar); ++i)
{
print_generic_expr (file, subvar, dump_flags);
fprintf (file, "@" HOST_WIDE_INT_PRINT_UNSIGNED, SFT_OFFSET (subvar));
if (SFT_BASE_FOR_COMPONENTS_P (subvar))
fprintf (file, "[B]");
fprintf (file, " ");
}
fprintf (file, "}");
}
/* Dumb sub-variables for VAR to stderr. */
void
debug_subvars_for (tree var)
{
dump_subvars_for (stderr, var);
}
/* Dump variable VAR and its may-aliases to FILE. */
void
......@@ -403,12 +367,6 @@ dump_variable (FILE *file, tree var)
dump_may_aliases_for (file, var);
}
if (get_subvars_for_var (var))
{
fprintf (file, ", sub-vars: ");
dump_subvars_for (file, var);
}
if (!is_gimple_reg (var))
{
if (memory_partition (var))
......@@ -422,16 +380,6 @@ dump_variable (FILE *file, tree var)
fprintf (file, ", partition symbols: ");
dump_decl_set (file, MPT_SYMBOLS (var));
}
if (TREE_CODE (var) == STRUCT_FIELD_TAG)
{
fprintf (file, ", offset: " HOST_WIDE_INT_PRINT_UNSIGNED,
SFT_OFFSET (var));
fprintf (file, ", base for components: %s",
SFT_BASE_FOR_COMPONENTS_P (var) ? "NO" : "YES");
fprintf (file, ", partitionable: %s",
SFT_UNPARTITIONABLE_P (var) ? "NO" : "YES");
}
}
fprintf (file, "\n");
......@@ -766,18 +714,6 @@ remove_referenced_var (tree var)
struct tree_decl_minimal in;
void **loc;
unsigned int uid = DECL_UID (var);
subvar_t sv;
/* If we remove a var, we should also remove its subvars, as we kill
their parent var and its annotation. */
if (var_can_have_subvars (var)
&& (sv = get_subvars_for_var (var)))
{
unsigned int i;
tree subvar;
for (i = 0; VEC_iterate (tree, sv, i, subvar); ++i)
remove_referenced_var (subvar);
}
clear_call_clobbered (var);
if ((v_ann = var_ann (var)))
......
......@@ -513,7 +513,6 @@ dequeue_and_dump (dump_info_p di)
case SYMBOL_MEMORY_TAG:
case NAME_MEMORY_TAG:
case STRUCT_FIELD_TAG:
break;
case VAR_DECL:
......
......@@ -883,7 +883,7 @@ clear_call_clobbered (tree var)
{
var_ann_t ann = var_ann (var);
ann->escape_mask = 0;
if (MTAG_P (var) && TREE_CODE (var) != STRUCT_FIELD_TAG)
if (MTAG_P (var))
MTAG_GLOBAL (var) = 0;
if (!MTAG_P (var))
var_ann (var)->call_clobbered = false;
......@@ -1581,121 +1581,6 @@ ref_contains_array_ref (const_tree ref)
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 (const_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 the subvariable of VAR at offset OFFSET. */
static inline tree
get_subvar_at (tree var, unsigned HOST_WIDE_INT offset)
{
subvar_t sv = get_subvars_for_var (var);
int low, high;
low = 0;
high = VEC_length (tree, sv) - 1;
while (low <= high)
{
int mid = (low + high) / 2;
tree subvar = VEC_index (tree, sv, mid);
if (SFT_OFFSET (subvar) == offset)
return subvar;
else if (SFT_OFFSET (subvar) < offset)
low = mid + 1;
else
high = mid - 1;
}
return NULL_TREE;
}
/* Return the first subvariable in SV that overlaps [offset, offset + size[.
NULL_TREE is returned, if there is no overlapping subvariable, else *I
is set to the index in the SV vector of the first overlap. */
static inline tree
get_first_overlapping_subvar (subvar_t sv, unsigned HOST_WIDE_INT offset,
unsigned HOST_WIDE_INT size, unsigned int *i)
{
int low = 0;
int high = VEC_length (tree, sv) - 1;
int mid;
tree subvar;
if (low > high)
return NULL_TREE;
/* Binary search for offset. */
do
{
mid = (low + high) / 2;
subvar = VEC_index (tree, sv, mid);
if (SFT_OFFSET (subvar) == offset)
{
*i = mid;
return subvar;
}
else if (SFT_OFFSET (subvar) < offset)
low = mid + 1;
else
high = mid - 1;
}
while (low <= high);
/* As we didn't find a subvar with offset, adjust to return the
first overlapping one. */
if (SFT_OFFSET (subvar) < offset
&& SFT_OFFSET (subvar) + SFT_SIZE (subvar) <= offset)
{
mid += 1;
if ((unsigned)mid >= VEC_length (tree, sv))
return NULL_TREE;
subvar = VEC_index (tree, sv, mid);
}
else if (SFT_OFFSET (subvar) > offset
&& size <= SFT_OFFSET (subvar) - offset)
{
mid -= 1;
if (mid < 0)
return NULL_TREE;
subvar = VEC_index (tree, sv, mid);
}
if (overlap_subvar (offset, size, subvar, NULL))
{
*i = mid;
return subvar;
}
return NULL_TREE;
}
/* Return true if V is a tree that we can have subvars for.
Normally, this is any aggregate type. Also complex
......@@ -1748,53 +1633,6 @@ ranges_overlap_p (unsigned HOST_WIDE_INT pos1,
return false;
}
/* Return true if OFFSET and SIZE define a range that overlaps with some
portion of the range of SV, a subvar. If there was an exact overlap,
*EXACT will be set to true upon return. */
static inline bool
overlap_subvar (unsigned HOST_WIDE_INT offset, unsigned HOST_WIDE_INT size,
const_tree sv, bool *exact)
{
/* There are three possible cases of overlap.
1. We can have an exact overlap, like so:
|offset, offset + size |
|sv->offset, sv->offset + sv->size |
2. We can have offset starting after sv->offset, like so:
|offset, offset + size |
|sv->offset, sv->offset + sv->size |
3. We can have offset starting before sv->offset, like so:
|offset, offset + size |
|sv->offset, sv->offset + sv->size|
*/
if (exact)
*exact = false;
if (offset == SFT_OFFSET (sv) && size == SFT_SIZE (sv))
{
if (exact)
*exact = true;
return true;
}
else if (offset >= SFT_OFFSET (sv)
&& offset < (SFT_OFFSET (sv) + SFT_SIZE (sv)))
{
return true;
}
else if (offset < SFT_OFFSET (sv)
&& (size > SFT_OFFSET (sv) - offset))
{
return true;
}
return false;
}
/* Return the memory tag associated with symbol SYM. */
static inline tree
......
......@@ -327,8 +327,6 @@ enum noalias_state {
};
typedef VEC(tree,gc) *subvar_t;
struct var_ann_d GTY(())
{
struct tree_ann_common_d common;
......@@ -395,10 +393,6 @@ struct var_ann_d GTY(())
/* During into-ssa and the dominator optimizer, this field holds the
current version of this variable (an SSA_NAME). */
tree current_def;
/* If this variable is a structure, this fields holds an array
of symbols representing each of the fields of the structure. */
VEC(tree,gc) *subvars;
};
/* Container for variable annotation used by hashtable for annotations for
......@@ -814,8 +808,6 @@ extern void debug_referenced_vars (void);
extern void dump_referenced_vars (FILE *);
extern void dump_variable (FILE *, tree);
extern void debug_variable (tree);
extern void dump_subvars_for (FILE *, tree);
extern void debug_subvars_for (tree);
extern tree get_virtual_var (tree);
extern void add_referenced_var (tree);
extern void remove_referenced_var (tree);
......@@ -858,16 +850,11 @@ extern struct ptr_info_def *get_ptr_info (tree);
extern void new_type_alias (tree, tree, tree);
extern void count_uses_and_derefs (tree, tree, unsigned *, unsigned *,
unsigned *);
static inline subvar_t get_subvars_for_var (tree);
static inline tree get_subvar_at (tree, unsigned HOST_WIDE_INT);
static inline bool ref_contains_array_ref (const_tree);
static inline bool array_ref_contains_indirect_ref (const_tree);
extern tree get_ref_base_and_extent (tree, HOST_WIDE_INT *,
HOST_WIDE_INT *, HOST_WIDE_INT *);
static inline bool var_can_have_subvars (const_tree);
static inline bool overlap_subvar (unsigned HOST_WIDE_INT,
unsigned HOST_WIDE_INT,
const_tree, bool *);
extern tree create_tag_raw (enum tree_code, tree, const char *);
extern void delete_mem_ref_stats (struct function *);
extern void dump_mem_ref_stats (FILE *);
......
......@@ -2790,19 +2790,6 @@ mark_sym_for_renaming (tree sym)
if (need_to_initialize_update_ssa_p)
init_update_ssa ();
/* FIXME. Why do we need this? */
{
subvar_t svars;
if (var_can_have_subvars (sym) && (svars = get_subvars_for_var (sym)))
{
unsigned int i;
tree subvar;
for (i = 0; VEC_iterate (tree, svars, i, subvar); ++i)
mark_sym_for_renaming (subvar);
}
}
bitmap_set_bit (syms_to_rename, DECL_UID (sym));
if (!is_gimple_reg (sym))
......
......@@ -249,17 +249,13 @@ struct gimple_opt_pass pass_nrv =
optimization, where DEST is expected to be the LHS of a modify
expression where the RHS is a function returning an aggregate.
We search for a base VAR_DECL and look to see if it, or any of its
subvars are clobbered. Note that we could do better, for example, by
We search for a base VAR_DECL and look to see if it is call clobbered.
Note that we could do better, for example, by
attempting to doing points-to analysis on INDIRECT_REFs. */
static bool
dest_safe_for_nrv_p (tree dest)
{
subvar_t sv;
unsigned int i;
tree subvar;
while (handled_component_p (dest))
dest = TREE_OPERAND (dest, 0);
......@@ -272,11 +268,6 @@ dest_safe_for_nrv_p (tree dest)
if (is_call_clobbered (dest))
return false;
sv = get_subvars_for_var (dest);
for (i = 0; VEC_iterate (tree, sv, i, subvar); ++i)
if (is_call_clobbered (subvar))
return false;
return true;
}
......
......@@ -2389,8 +2389,6 @@ set_alias_info (tree ref, struct data_reference *dr)
new_type_alias (var, tag, ref);
else
var_ann (var)->symbol_mem_tag = tag;
var_ann (var)->subvars = DR_SUBVARS (dr);
}
/* Prepare initializers for CHAIN in LOOP. Returns false if this is
......
......@@ -907,7 +907,6 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
case SYMBOL_MEMORY_TAG:
case NAME_MEMORY_TAG:
case STRUCT_FIELD_TAG:
case VAR_DECL:
case PARM_DECL:
case FIELD_DECL:
......
......@@ -5155,9 +5155,6 @@ get_ref_tag (tree ref, tree orig)
break;
}
if (aref && SSA_VAR_P (aref) && get_subvars_for_var (aref))
return aref;
if (!var)
return NULL_TREE;
......
......@@ -4713,88 +4713,35 @@ set_uids_in_ptset (tree ptr, bitmap into, bitmap from, bool is_derefed,
{
unsigned int i;
bitmap_iterator bi;
alias_set_type ptr_alias_set;
gcc_assert (POINTER_TYPE_P (TREE_TYPE (ptr)));
ptr_alias_set = get_alias_set (TREE_TYPE (TREE_TYPE (ptr)));
EXECUTE_IF_SET_IN_BITMAP (from, 0, i, bi)
{
varinfo_t vi = get_varinfo (i);
alias_set_type var_alias_set;
/* The only artificial variables that are allowed in a may-alias
set are heap variables. */
if (vi->is_artificial_var && !vi->is_heap_var)
continue;
if (vi->has_union && get_subvars_for_var (vi->decl) != NULL)
if (TREE_CODE (vi->decl) == VAR_DECL
|| TREE_CODE (vi->decl) == PARM_DECL
|| TREE_CODE (vi->decl) == RESULT_DECL)
{
unsigned int i;
tree subvar;
subvar_t sv = get_subvars_for_var (vi->decl);
/* Variables containing unions may need to be converted to
their SFT's, because SFT's can have unions and we cannot. */
for (i = 0; VEC_iterate (tree, sv, i, subvar); ++i)
bitmap_set_bit (into, DECL_UID (subvar));
}
else if (TREE_CODE (vi->decl) == VAR_DECL
|| TREE_CODE (vi->decl) == PARM_DECL
|| TREE_CODE (vi->decl) == RESULT_DECL)
{
subvar_t sv;
if (var_can_have_subvars (vi->decl)
&& (sv = get_subvars_for_var (vi->decl)))
{
/* If VI->DECL is an aggregate for which we created
SFTs, add the SFT corresponding to VI->OFFSET.
If we didn't do field-sensitive PTA we need to to
add all overlapping SFTs. */
unsigned int j;
tree sft = get_first_overlapping_subvar (sv, vi->offset,
vi->size, &j);
gcc_assert (sft);
for (; VEC_iterate (tree, sv, j, sft); ++j)
{
if (SFT_OFFSET (sft) > vi->offset
&& vi->size <= SFT_OFFSET (sft) - vi->offset)
break;
var_alias_set = get_alias_set (sft);
if (no_tbaa_pruning
|| (!is_derefed && !vi->directly_dereferenced)
|| alias_sets_conflict_p (ptr_alias_set, var_alias_set))
{
bitmap_set_bit (into, DECL_UID (sft));
/* Pointed-to SFTs are needed by the operand scanner
to adjust offsets when adding operands to memory
expressions that dereference PTR. This means
that memory partitioning may not partition
this SFT because the operand scanner will not
be able to find the other SFTs next to this
one. But we only need to do this if the pointed
to type is aggregate. */
if (SFT_BASE_FOR_COMPONENTS_P (sft))
SFT_UNPARTITIONABLE_P (sft) = true;
}
}
}
/* Just add VI->DECL to the alias set.
Don't type prune artificial vars. */
if (vi->is_artificial_var)
bitmap_set_bit (into, DECL_UID (vi->decl));
else
{
/* Otherwise, just add VI->DECL to the alias set.
Don't type prune artificial vars. */
if (vi->is_artificial_var)
bitmap_set_bit (into, DECL_UID (vi->decl));
else
{
var_alias_set = get_alias_set (vi->decl);
if (no_tbaa_pruning
|| (!is_derefed && !vi->directly_dereferenced)
|| alias_sets_conflict_p (ptr_alias_set, var_alias_set))
bitmap_set_bit (into, DECL_UID (vi->decl));
}
alias_set_type var_alias_set, ptr_alias_set;
var_alias_set = get_alias_set (vi->decl);
ptr_alias_set = get_alias_set (TREE_TYPE (TREE_TYPE (ptr)));
if (no_tbaa_pruning
|| (!is_derefed && !vi->directly_dereferenced)
|| alias_sets_conflict_p (ptr_alias_set, var_alias_set))
bitmap_set_bit (into, DECL_UID (vi->decl));
}
}
}
......@@ -4923,9 +4870,7 @@ find_what_p_points_to (tree p)
/* Nothing currently asks about structure fields directly,
but when they do, we need code here to hand back the
points-to set. */
if (!var_can_have_subvars (vi->decl)
|| get_subvars_for_var (vi->decl) == NULL)
return false;
return false;
}
else
{
......
......@@ -254,13 +254,6 @@ verify_ssa_name (tree ssa_name, bool is_virtual)
return true;
}
if (is_virtual && var_ann (SSA_NAME_VAR (ssa_name))
&& get_subvars_for_var (SSA_NAME_VAR (ssa_name)) != NULL)
{
error ("found real variable when subvariables should have appeared");
return true;
}
if (SSA_NAME_IS_DEFAULT_DEF (ssa_name)
&& !IS_EMPTY_STMT (SSA_NAME_DEF_STMT (ssa_name)))
{
......
......@@ -144,7 +144,7 @@ suitable_for_tail_opt_p (void)
FOR_EACH_REFERENCED_VAR (var, rvi)
{
if (!is_global_var (var)
&& (!MTAG_P (var) || TREE_CODE (var) == STRUCT_FIELD_TAG)
&& !MTAG_P (var)
&& (gimple_aliases_computed_p (cfun) ? is_call_clobbered (var)
: TREE_ADDRESSABLE (var)))
return false;
......
......@@ -1061,8 +1061,6 @@ vect_create_data_ref_ptr (tree stmt, struct loop *at_loop,
else
set_symbol_mem_tag (vect_ptr, tag);
var_ann (vect_ptr)->subvars = DR_SUBVARS (dr);
/** Note: If the dataref is in an inner-loop nested in LOOP, and we are
vectorizing LOOP (i.e. outer-loop vectorization), we need to create two
def-use update cycles for the pointer: One relative to the outer-loop
......
......@@ -263,17 +263,14 @@ init_ttree (void)
tree_contains_struct[TRANSLATION_UNIT_DECL][TS_DECL_MINIMAL] = 1;
tree_contains_struct[LABEL_DECL][TS_DECL_MINIMAL] = 1;
tree_contains_struct[FIELD_DECL][TS_DECL_MINIMAL] = 1;
tree_contains_struct[STRUCT_FIELD_TAG][TS_DECL_MINIMAL] = 1;
tree_contains_struct[NAME_MEMORY_TAG][TS_DECL_MINIMAL] = 1;
tree_contains_struct[SYMBOL_MEMORY_TAG][TS_DECL_MINIMAL] = 1;
tree_contains_struct[MEMORY_PARTITION_TAG][TS_DECL_MINIMAL] = 1;
tree_contains_struct[STRUCT_FIELD_TAG][TS_MEMORY_TAG] = 1;
tree_contains_struct[NAME_MEMORY_TAG][TS_MEMORY_TAG] = 1;
tree_contains_struct[SYMBOL_MEMORY_TAG][TS_MEMORY_TAG] = 1;
tree_contains_struct[MEMORY_PARTITION_TAG][TS_MEMORY_TAG] = 1;
tree_contains_struct[STRUCT_FIELD_TAG][TS_STRUCT_FIELD_TAG] = 1;
tree_contains_struct[MEMORY_PARTITION_TAG][TS_MEMORY_PARTITION_TAG] = 1;
tree_contains_struct[VAR_DECL][TS_DECL_WITH_VIS] = 1;
......@@ -370,8 +367,6 @@ tree_code_size (enum tree_code code)
case NAME_MEMORY_TAG:
case SYMBOL_MEMORY_TAG:
return sizeof (struct tree_memory_tag);
case STRUCT_FIELD_TAG:
return sizeof (struct tree_struct_field_tag);
case MEMORY_PARTITION_TAG:
return sizeof (struct tree_memory_partition_tag);
default:
......@@ -2289,7 +2284,6 @@ tree_node_structure (const_tree t)
return TS_FUNCTION_DECL;
case SYMBOL_MEMORY_TAG:
case NAME_MEMORY_TAG:
case STRUCT_FIELD_TAG:
case MEMORY_PARTITION_TAG:
return TS_MEMORY_TAG;
default:
......
......@@ -363,7 +363,6 @@ DEFTREECODE (RESULT_DECL, "result_decl", tcc_declaration, 0)
/* Memory tags used in tree-ssa to represent memory locations in
virtual SSA. */
DEFTREECODE (STRUCT_FIELD_TAG, "struct_field_tag", tcc_declaration, 0)
DEFTREECODE (NAME_MEMORY_TAG, "name_memory_tag", tcc_declaration, 0)
DEFTREECODE (SYMBOL_MEMORY_TAG, "symbol_memory_tag", tcc_declaration, 0)
DEFTREECODE (MEMORY_PARTITION_TAG, "memory_partition_tag", tcc_declaration, 0)
......
......@@ -109,8 +109,7 @@ extern const enum tree_code_class tree_code_type[];
/* Nonzero if CODE represents a memory tag. */
#define MTAG_P(CODE) \
(TREE_CODE (CODE) == STRUCT_FIELD_TAG \
|| TREE_CODE (CODE) == NAME_MEMORY_TAG \
(TREE_CODE (CODE) == NAME_MEMORY_TAG \
|| TREE_CODE (CODE) == SYMBOL_MEMORY_TAG \
|| TREE_CODE (CODE) == MEMORY_PARTITION_TAG)
......@@ -2544,45 +2543,11 @@ struct tree_memory_tag GTY(())
/* True if this tag has global scope. */
unsigned int is_global : 1;
/* True if this tag is the first field of an aggregate type that
can be used to find adjacent SFTs belonging to the same aggregate. */
unsigned int base_for_components : 1;
/* True if this tag should not be grouped into a memory partition. */
unsigned int unpartitionable : 1;
};
#define MTAG_GLOBAL(NODE) (TREE_MEMORY_TAG_CHECK (NODE)->mtag.is_global)
#define MTAG_ALIASES(NODE) (TREE_MEMORY_TAG_CHECK (NODE)->mtag.aliases)
struct tree_struct_field_tag GTY(())
{
struct tree_memory_tag common;
/* Parent variable. */
tree parent_var;
/* Offset inside structure. */
unsigned HOST_WIDE_INT offset;
/* Size of the field. */
unsigned HOST_WIDE_INT size;
/* Alias set for a DECL_NONADDRESSABLE_P field. Otherwise -1. */
alias_set_type alias_set;
};
#define SFT_PARENT_VAR(NODE) (STRUCT_FIELD_TAG_CHECK (NODE)->sft.parent_var)
#define SFT_OFFSET(NODE) (STRUCT_FIELD_TAG_CHECK (NODE)->sft.offset)
#define SFT_SIZE(NODE) (STRUCT_FIELD_TAG_CHECK (NODE)->sft.size)
#define SFT_NONADDRESSABLE_P(NODE) \
(STRUCT_FIELD_TAG_CHECK (NODE)->sft.alias_set != -1)
#define SFT_ALIAS_SET(NODE) (STRUCT_FIELD_TAG_CHECK (NODE)->sft.alias_set)
#define SFT_UNPARTITIONABLE_P(NODE) \
(STRUCT_FIELD_TAG_CHECK (NODE)->sft.common.unpartitionable)
#define SFT_BASE_FOR_COMPONENTS_P(NODE) \
(STRUCT_FIELD_TAG_CHECK (NODE)->sft.common.base_for_components)
/* Memory Partition Tags (MPTs) group memory symbols under one
common name for the purposes of placing memory PHI nodes. */
......@@ -3480,7 +3445,6 @@ union tree_node GTY ((ptr_alias (union lang_tree_node),
struct tree_value_handle GTY ((tag ("TS_VALUE_HANDLE"))) value_handle;
struct tree_constructor GTY ((tag ("TS_CONSTRUCTOR"))) constructor;
struct tree_memory_tag GTY ((tag ("TS_MEMORY_TAG"))) mtag;
struct tree_struct_field_tag GTY ((tag ("TS_STRUCT_FIELD_TAG"))) sft;
struct tree_omp_clause GTY ((tag ("TS_OMP_CLAUSE"))) omp_clause;
struct tree_memory_partition_tag GTY ((tag ("TS_MEMORY_PARTITION_TAG"))) mpt;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment