tree-ssa-alias.h (dump_points_to_solution): Declare.

2009-05-25  Richard Guenther  <rguenther@suse.de>

	* tree-ssa-alias.h (dump_points_to_solution): Declare.
	* tree-inline.c (expand_call_inline): Reset the escaped and
	callused solutions.
	* tree-ssa-structalias.c (pass_build_ealias): New.
	* tree-pass.h (pass_build_ealias): Declare.
	* passes.c (init_optimization_passes): Add PTA during 
	early optimizations.
	* tree-ssa-alias.c (dump_alias_info): Dump the ESCAPED
	and CALLUSED solutions.
	(dump_points_to_solution): New function, split out from ...
	(dump_points_to_info_for): ... here.
	* tree-parloops.c (parallelize_loops): Reset the escaped and
	callused solutions.

	* gcc.dg/tree-ssa/ssa-fre-14.c: Adjust.
	* gcc.dg/tree-ssa/ssa-fre-15.c: Likewise.

From-SVN: r147848
This commit is contained in:
Richard Guenther 2009-05-25 13:35:10 +00:00 committed by Richard Biener
parent 0d38b67703
commit 6b8ed1452b
11 changed files with 108 additions and 23 deletions

View File

@ -1,3 +1,19 @@
2009-05-25 Richard Guenther <rguenther@suse.de>
* tree-ssa-alias.h (dump_points_to_solution): Declare.
* tree-inline.c (expand_call_inline): Reset the escaped and
callused solutions.
* tree-ssa-structalias.c (pass_build_ealias): New.
* tree-pass.h (pass_build_ealias): Declare.
* passes.c (init_optimization_passes): Add PTA during
early optimizations.
* tree-ssa-alias.c (dump_alias_info): Dump the ESCAPED
and CALLUSED solutions.
(dump_points_to_solution): New function, split out from ...
(dump_points_to_info_for): ... here.
* tree-parloops.c (parallelize_loops): Reset the escaped and
callused solutions.
2009-05-25 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
PR bootstrap/40027

View File

@ -554,7 +554,11 @@ init_optimization_passes (void)
NEXT_PASS (pass_rename_ssa_copies);
NEXT_PASS (pass_ccp);
NEXT_PASS (pass_forwprop);
NEXT_PASS (pass_update_address_taken);
/* pass_build_ealias is a dummy pass that ensures that we
execute TODO_rebuild_alias at this point. Re-building
alias information also rewrites no longer addressed
locals into SSA form if possible. */
NEXT_PASS (pass_build_ealias);
NEXT_PASS (pass_sra_early);
NEXT_PASS (pass_copy_prop);
NEXT_PASS (pass_merge_phi);

View File

@ -1,3 +1,8 @@
2009-05-25 Richard Guenther <rguenther@suse.de>
* gcc.dg/tree-ssa/ssa-fre-14.c: Adjust.
* gcc.dg/tree-ssa/ssa-fre-15.c: Likewise.
2009-05-25 Ira Rosen <irar@il.ibm.com>
PR tree-optimization/40238

View File

@ -8,6 +8,7 @@ struct Foo
void *data;
double size;
};
void bar(double *);
void foo(double (*q)[4])
{
struct Foo tmp1;
@ -23,6 +24,7 @@ void foo(double (*q)[4])
this store to tmp1 here. */
tmp1.size -= 1.0;
}
bar(a);
}
/* { dg-final { scan-tree-dump "Inserted .* &a" "fre" } } */

View File

@ -8,6 +8,7 @@ struct Foo
void *data;
double size;
};
void bar(double *);
void foo(double (*q)[4])
{
struct Foo tmp1;
@ -22,6 +23,7 @@ void foo(double (*q)[4])
this store to tmp1 here. */
tmp1.size -= 1.0;
}
bar(a);
}
/* { dg-final { scan-tree-dump "Replaced" "fre" } } */

View File

@ -3451,6 +3451,13 @@ expand_call_inline (basic_block bb, gimple stmt, copy_body_data *id)
duplicate our body before altering anything. */
copy_body (id, bb->count, bb->frequency, bb, return_block);
/* Reset the escaped and callused solutions. */
if (cfun->gimple_df)
{
pt_solution_reset (&cfun->gimple_df->escaped);
pt_solution_reset (&cfun->gimple_df->callused);
}
/* Clean up. */
pointer_map_destroy (id->decl_map);
id->decl_map = st;

View File

@ -1886,6 +1886,16 @@ parallelize_loops (void)
free_stmt_vec_info_vec ();
htab_delete (reduction_list);
/* Parallelization will cause new function calls to be inserted through
which local variables will escape. Reset the points-to solutions
for ESCAPED and CALLUSED. */
if (changed)
{
pt_solution_reset (&cfun->gimple_df->escaped);
pt_solution_reset (&cfun->gimple_df->callused);
}
return changed;
}

View File

@ -350,6 +350,7 @@ extern struct gimple_opt_pass pass_ccp;
extern struct gimple_opt_pass pass_phi_only_cprop;
extern struct gimple_opt_pass pass_build_ssa;
extern struct gimple_opt_pass pass_build_alias;
extern struct gimple_opt_pass pass_build_ealias;
extern struct gimple_opt_pass pass_dominator;
extern struct gimple_opt_pass pass_dce;
extern struct gimple_opt_pass pass_dce_loop;

View File

@ -330,7 +330,14 @@ dump_alias_info (FILE *file)
dump_variable (file, var);
}
fprintf (file, "\n\nFlow-insensitive points-to information for %s\n\n", funcname);
fprintf (file, "\nCall clobber information\n");
fprintf (file, "\nESCAPED");
dump_points_to_solution (file, &cfun->gimple_df->escaped);
fprintf (file, "\nCALLUSED");
dump_points_to_solution (file, &cfun->gimple_df->callused);
fprintf (file, "\n\nFlow-insensitive points-to information\n\n");
for (i = 1; i < num_ssa_names; i++)
{
@ -380,6 +387,32 @@ get_ptr_info (tree t)
return pi;
}
/* Dump the points-to set *PT into FILE. */
void
dump_points_to_solution (FILE *file, struct pt_solution *pt)
{
if (pt->anything)
fprintf (file, ", points-to anything");
if (pt->nonlocal)
fprintf (file, ", points-to non-local");
if (pt->escaped)
fprintf (file, ", points-to escaped");
if (pt->null)
fprintf (file, ", points-to NULL");
if (pt->vars)
{
fprintf (file, ", points-to vars: ");
dump_decl_set (file, pt->vars);
if (pt->vars_contains_global)
fprintf (file, " (includes global vars)");
}
}
/* Dump points-to information for SSA_NAME PTR into FILE. */
void
@ -390,27 +423,9 @@ dump_points_to_info_for (FILE *file, tree ptr)
print_generic_expr (file, ptr, dump_flags);
if (pi)
{
if (pi->pt.anything)
fprintf (file, ", points-to anything");
if (pi->pt.nonlocal)
fprintf (file, ", points-to non-local");
if (pi->pt.escaped)
fprintf (file, ", points-to escaped");
if (pi->pt.null)
fprintf (file, ", points-to NULL");
if (pi->pt.vars)
{
fprintf (file, ", points-to vars: ");
dump_decl_set (file, pi->pt.vars);
if (pi->pt.vars_contains_global)
fprintf (file, " (includes global vars)");
}
}
dump_points_to_solution (file, &pi->pt);
else
fprintf (file, ", points-to anything");
fprintf (file, "\n");
}

View File

@ -90,6 +90,7 @@ extern unsigned int walk_aliased_vdefs (tree, tree,
extern struct ptr_info_def *get_ptr_info (tree);
extern void dump_alias_info (FILE *);
extern void debug_alias_info (void);
extern void dump_points_to_solution (FILE *, struct pt_solution *);
extern void dump_points_to_info_for (FILE *, tree);
extern void debug_points_to_info_for (tree);
extern void dump_alias_stats (FILE *);

View File

@ -5436,6 +5436,28 @@ struct gimple_opt_pass pass_build_alias =
}
};
/* A dummy pass to cause points-to information to be computed via
TODO_rebuild_alias. */
struct gimple_opt_pass pass_build_ealias =
{
{
GIMPLE_PASS,
"ealias", /* name */
gate_tree_pta, /* gate */
NULL, /* execute */
NULL, /* sub */
NULL, /* next */
0, /* static_pass_number */
TV_NONE, /* tv_id */
PROP_cfg | PROP_ssa, /* properties_required */
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
TODO_rebuild_alias | TODO_dump_func /* todo_flags_finish */
}
};
/* Return true if we should execute IPA PTA. */
static bool