Commit 6b8ed145 by Richard Guenther Committed by Richard Biener

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
parent 0d38b677
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> 2009-05-25 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
PR bootstrap/40027 PR bootstrap/40027
......
...@@ -554,7 +554,11 @@ init_optimization_passes (void) ...@@ -554,7 +554,11 @@ init_optimization_passes (void)
NEXT_PASS (pass_rename_ssa_copies); NEXT_PASS (pass_rename_ssa_copies);
NEXT_PASS (pass_ccp); NEXT_PASS (pass_ccp);
NEXT_PASS (pass_forwprop); 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_sra_early);
NEXT_PASS (pass_copy_prop); NEXT_PASS (pass_copy_prop);
NEXT_PASS (pass_merge_phi); NEXT_PASS (pass_merge_phi);
......
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> 2009-05-25 Ira Rosen <irar@il.ibm.com>
PR tree-optimization/40238 PR tree-optimization/40238
......
...@@ -8,6 +8,7 @@ struct Foo ...@@ -8,6 +8,7 @@ struct Foo
void *data; void *data;
double size; double size;
}; };
void bar(double *);
void foo(double (*q)[4]) void foo(double (*q)[4])
{ {
struct Foo tmp1; struct Foo tmp1;
...@@ -23,6 +24,7 @@ void foo(double (*q)[4]) ...@@ -23,6 +24,7 @@ void foo(double (*q)[4])
this store to tmp1 here. */ this store to tmp1 here. */
tmp1.size -= 1.0; tmp1.size -= 1.0;
} }
bar(a);
} }
/* { dg-final { scan-tree-dump "Inserted .* &a" "fre" } } */ /* { dg-final { scan-tree-dump "Inserted .* &a" "fre" } } */
......
...@@ -8,6 +8,7 @@ struct Foo ...@@ -8,6 +8,7 @@ struct Foo
void *data; void *data;
double size; double size;
}; };
void bar(double *);
void foo(double (*q)[4]) void foo(double (*q)[4])
{ {
struct Foo tmp1; struct Foo tmp1;
...@@ -22,6 +23,7 @@ void foo(double (*q)[4]) ...@@ -22,6 +23,7 @@ void foo(double (*q)[4])
this store to tmp1 here. */ this store to tmp1 here. */
tmp1.size -= 1.0; tmp1.size -= 1.0;
} }
bar(a);
} }
/* { dg-final { scan-tree-dump "Replaced" "fre" } } */ /* { dg-final { scan-tree-dump "Replaced" "fre" } } */
......
...@@ -3451,6 +3451,13 @@ expand_call_inline (basic_block bb, gimple stmt, copy_body_data *id) ...@@ -3451,6 +3451,13 @@ expand_call_inline (basic_block bb, gimple stmt, copy_body_data *id)
duplicate our body before altering anything. */ duplicate our body before altering anything. */
copy_body (id, bb->count, bb->frequency, bb, return_block); 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. */ /* Clean up. */
pointer_map_destroy (id->decl_map); pointer_map_destroy (id->decl_map);
id->decl_map = st; id->decl_map = st;
......
...@@ -1886,6 +1886,16 @@ parallelize_loops (void) ...@@ -1886,6 +1886,16 @@ parallelize_loops (void)
free_stmt_vec_info_vec (); free_stmt_vec_info_vec ();
htab_delete (reduction_list); 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; return changed;
} }
......
...@@ -350,6 +350,7 @@ extern struct gimple_opt_pass pass_ccp; ...@@ -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_phi_only_cprop;
extern struct gimple_opt_pass pass_build_ssa; extern struct gimple_opt_pass pass_build_ssa;
extern struct gimple_opt_pass pass_build_alias; 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_dominator;
extern struct gimple_opt_pass pass_dce; extern struct gimple_opt_pass pass_dce;
extern struct gimple_opt_pass pass_dce_loop; extern struct gimple_opt_pass pass_dce_loop;
......
...@@ -330,7 +330,14 @@ dump_alias_info (FILE *file) ...@@ -330,7 +330,14 @@ dump_alias_info (FILE *file)
dump_variable (file, var); 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++) for (i = 1; i < num_ssa_names; i++)
{ {
...@@ -380,37 +387,45 @@ get_ptr_info (tree t) ...@@ -380,37 +387,45 @@ get_ptr_info (tree t)
return pi; return pi;
} }
/* Dump points-to information for SSA_NAME PTR into FILE. */ /* Dump the points-to set *PT into FILE. */
void void
dump_points_to_info_for (FILE *file, tree ptr) dump_points_to_solution (FILE *file, struct pt_solution *pt)
{ {
struct ptr_info_def *pi = SSA_NAME_PTR_INFO (ptr); if (pt->anything)
fprintf (file, ", points-to anything");
print_generic_expr (file, ptr, dump_flags); if (pt->nonlocal)
fprintf (file, ", points-to non-local");
if (pi) if (pt->escaped)
fprintf (file, ", points-to escaped");
if (pt->null)
fprintf (file, ", points-to NULL");
if (pt->vars)
{ {
if (pi->pt.anything) fprintf (file, ", points-to vars: ");
fprintf (file, ", points-to anything"); dump_decl_set (file, pt->vars);
if (pt->vars_contains_global)
fprintf (file, " (includes global vars)");
}
}
if (pi->pt.nonlocal) /* Dump points-to information for SSA_NAME PTR into FILE. */
fprintf (file, ", points-to non-local");
if (pi->pt.escaped) void
fprintf (file, ", points-to escaped"); dump_points_to_info_for (FILE *file, tree ptr)
{
struct ptr_info_def *pi = SSA_NAME_PTR_INFO (ptr);
if (pi->pt.null) print_generic_expr (file, ptr, dump_flags);
fprintf (file, ", points-to NULL");
if (pi->pt.vars) if (pi)
{ dump_points_to_solution (file, &pi->pt);
fprintf (file, ", points-to vars: "); else
dump_decl_set (file, pi->pt.vars); fprintf (file, ", points-to anything");
if (pi->pt.vars_contains_global)
fprintf (file, " (includes global vars)");
}
}
fprintf (file, "\n"); fprintf (file, "\n");
} }
......
...@@ -90,6 +90,7 @@ extern unsigned int walk_aliased_vdefs (tree, tree, ...@@ -90,6 +90,7 @@ extern unsigned int walk_aliased_vdefs (tree, tree,
extern struct ptr_info_def *get_ptr_info (tree); extern struct ptr_info_def *get_ptr_info (tree);
extern void dump_alias_info (FILE *); extern void dump_alias_info (FILE *);
extern void debug_alias_info (void); 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 dump_points_to_info_for (FILE *, tree);
extern void debug_points_to_info_for (tree); extern void debug_points_to_info_for (tree);
extern void dump_alias_stats (FILE *); extern void dump_alias_stats (FILE *);
......
...@@ -5436,6 +5436,28 @@ struct gimple_opt_pass pass_build_alias = ...@@ -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. */ /* Return true if we should execute IPA PTA. */
static bool static bool
......
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