tree-ssa-structalias.c (pt_solution_set_var): New function.

2010-07-02  Richard Guenther  <rguenther@suse.de>

	* tree-ssa-structalias.c (pt_solution_set_var): New function.
	* tree-ssa-alias.h (pt_solution_set_var): Declare.
	* tree-ssa-loop-ivopts.c (copy_ref_info): Also copy or create
	points-to information.

From-SVN: r161716
This commit is contained in:
Richard Guenther 2010-07-02 13:25:23 +00:00 committed by Richard Biener
parent c3ac3ddf84
commit 90fa9e17bf
4 changed files with 41 additions and 0 deletions

View file

@ -1,3 +1,10 @@
2010-07-02 Richard Guenther <rguenther@suse.de>
* tree-ssa-structalias.c (pt_solution_set_var): New function.
* tree-ssa-alias.h (pt_solution_set_var): Declare.
* tree-ssa-loop-ivopts.c (copy_ref_info): Also copy or create
points-to information.
2010-07-02 Christian Borntraeger <borntraeger@de.ibm.com>
* config/s390/s390.c (override_options): Adopt prefetching

View file

@ -132,6 +132,8 @@ extern bool pt_solutions_same_restrict_base (struct pt_solution *,
struct pt_solution *);
extern void pt_solution_reset (struct pt_solution *);
extern void pt_solution_set (struct pt_solution *, bitmap, bool, bool);
extern void pt_solution_set_var (struct pt_solution *, tree);
extern void dump_pta_stats (FILE *);
extern GTY(()) struct pt_solution ipa_escaped_pt;

View file

@ -5549,6 +5549,27 @@ copy_ref_info (tree new_ref, tree old_ref)
TMR_ORIGINAL (new_ref) = unshare_and_remove_ssa_names (old_ref);
TREE_SIDE_EFFECTS (new_ref) = TREE_SIDE_EFFECTS (old_ref);
TREE_THIS_VOLATILE (new_ref) = TREE_THIS_VOLATILE (old_ref);
/* We can transfer points-to information from an old pointer
or decl base to the new one. */
if (TMR_BASE (new_ref)
&& TREE_CODE (TMR_BASE (new_ref)) == SSA_NAME
&& POINTER_TYPE_P (TREE_TYPE (TMR_BASE (new_ref)))
&& !SSA_NAME_PTR_INFO (TMR_BASE (new_ref)))
{
tree base = get_base_address (old_ref);
if ((INDIRECT_REF_P (base)
|| TREE_CODE (base) == MEM_REF)
&& TREE_CODE (TREE_OPERAND (base, 0)) == SSA_NAME)
duplicate_ssa_name_ptr_info
(TMR_BASE (new_ref), SSA_NAME_PTR_INFO (TREE_OPERAND (base, 0)));
else if (TREE_CODE (base) == VAR_DECL
|| TREE_CODE (base) == PARM_DECL
|| TREE_CODE (base) == RESULT_DECL)
{
struct ptr_info_def *pi = get_ptr_info (TMR_BASE (new_ref));
pt_solution_set_var (&pi->pt, base);
}
}
}
}

View file

@ -5817,6 +5817,17 @@ pt_solution_set (struct pt_solution *pt, bitmap vars,
pt->vars_contains_restrict = vars_contains_restrict;
}
/* Set the points-to solution *PT to point only to the variable VAR. */
void
pt_solution_set_var (struct pt_solution *pt, tree var)
{
memset (pt, 0, sizeof (struct pt_solution));
pt->vars = BITMAP_GGC_ALLOC ();
bitmap_set_bit (pt->vars, DECL_UID (var));
pt->vars_contains_global = is_global_var (var);
}
/* Computes the union of the points-to solutions *DEST and *SRC and
stores the result in *DEST. This changes the points-to bitmap
of *DEST and thus may not be used if that might be shared.