aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple-pretty-print.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2010-04-15 13:16:44 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2010-04-15 13:16:44 +0000
commit25a6a8731ca102e1995fe996722a0637b1311445 (patch)
tree381556e2947cff452ab7c67fc87d183b8ec9da09 /gcc/gimple-pretty-print.c
parentcbdd87d44471ec0b9099dd8d6e32ae09039a1b48 (diff)
downloadgcc-25a6a8731ca102e1995fe996722a0637b1311445.zip
gcc-25a6a8731ca102e1995fe996722a0637b1311445.tar.gz
gcc-25a6a8731ca102e1995fe996722a0637b1311445.tar.bz2
tree-ssa-structalias.c (struct variable_info): Add is_fn_info flag.
2010-04-15 Richard Guenther <rguenther@suse.de> * tree-ssa-structalias.c (struct variable_info): Add is_fn_info flag. (new_var_info): Initialize it. (dump_constraints): Support printing last added constraints. (debug_constraints): Adjust. (dump_constraint_graph): Likewise. (make_heapvar_for): Check for NULL cfun. (get_function_part_constraint): New function. (get_fi_for_callee): Likewise. (find_func_aliases): Properly implement IPA PTA constraints. (process_ipa_clobber): New function. (find_func_clobbers): Likewise. (insert_into_field_list_sorted): Remove. (create_function_info_for): Properly allocate vars for IPA mode. Do not use insert_into_field_list_sorted. (create_variable_info_for): Properly generate constraints for global vars in IPA mode. (dump_solution_for_var): Always dump the solution. (set_uids_in_ptset): Initialize DECL_PT_UID if in ipa-mode. (find_what_var_points_to): Adjust. (pt_solution_set): Change. (pt_solution_ior_into): New function. (pt_solution_empty_p): Export. (pt_solution_includes_global): Adjust. (pt_solution_includes_1): Likewise. (pt_solutions_intersect_1): Likewise. (dump_sa_points_to_info): Check some invariants. (solve_constraints): Move constraint dumping ... (compute_points_to_sets): ... here. (ipa_pta_execute): ... and here. (compute_may_aliases): Do not re-compute points-to info locally if IPA info is available. (ipa_escaped_pt): New global var. (ipa_pta_execute): Properly implement IPA PTA. * tree-into-ssa.c (dump_decl_set): Support dumping decls not in referenced-vars. * tree-flow.h (struct gimple_df): Add ipa_pta flag. * tree-ssa-alias.c (ptr_deref_may_alias_decl_p): Adjust. (dump_points_to_solution): Likewise. * tree-dfa.c (dump_variable): Also dump DECL_PT_UID. * tree-inline.c (remap_ssa_name): Copy IPA points-to solution. (remap_gimple_stmt): Reset call clobber/use information if necessary. (copy_decl_to_var): Copy DECL_PT_UID. (copy_result_decl_to_var): Likewise. * tree.c (make_node_stat): Initialize DECL_PT_UID. (copy_node_stat): Copy it. * tree.h (DECL_PT_UID): New macro. (SET_DECL_PT_UID): Likewise. (DECL_PT_UID_SET_P): Likewise. (struct tree_decl_minimal): Add pt_uid member. * tree-ssa-alias.h (struct pt_solution): Add ipa_escaped flag. (pt_solution_empty_p): Declare. (pt_solution_set): Adjust. (ipa_escaped_pt): Declare. * cfgexpand.c (update_alias_info_with_stack_vars): Adjust. * gimple-pretty-print.c (pp_points_to_solution): New function. (dump_gimple_call): Dump call clobber/use information. * tree-dump.c (dump_option_value_in): Add TDF_ALIAS entry. * tree-pass.h (TDF_ALIAS): New dump option. * tree-pretty-print.c (dump_decl_name): Dump DECL_PT_UID if asked to. * doc/invoke.texi (-fipa-pta): Update documentation. * gcc.dg/ipa/ipa-pta-1.c: New testcase. * gcc.dg/ipa/ipa-pta-2.c: Likewise. * gcc.dg/ipa/ipa-pta-3.c: Likewise. * gcc.dg/ipa/ipa-pta-4.c: Likewise. * gcc.dg/ipa/ipa-pta-5.c: Likewise. * gcc.dg/ipa/ipa-pta-6.c: Likewise. * gcc.dg/ipa/ipa-pta-7.c: Likewise. * gcc.dg/ipa/ipa-pta-8.c: Likewise. * gcc.dg/ipa/ipa-pta-9.c: Likewise. * gcc.dg/ipa/ipa-pta-10.c: Likewise. * gcc.dg/ipa/ipa-pta-11.c: Likewise. * gcc.dg/ipa/ipa-pta-12.c: Likewise. * gcc.dg/ipa/ipa-pta-13.c: Likewise. * gcc.dg/torture/ipa-pta-2.c: Likewise. * gcc.dg/torture/ipa-pta-1.c: Adjust. From-SVN: r158374
Diffstat (limited to 'gcc/gimple-pretty-print.c')
-rw-r--r--gcc/gimple-pretty-print.c73
1 files changed, 73 insertions, 0 deletions
diff --git a/gcc/gimple-pretty-print.c b/gcc/gimple-pretty-print.c
index 6329d51..0f38616 100644
--- a/gcc/gimple-pretty-print.c
+++ b/gcc/gimple-pretty-print.c
@@ -477,6 +477,60 @@ dump_gimple_call_args (pretty_printer *buffer, gimple gs, int flags)
}
}
+/* Dump the points-to solution *PT to BUFFER. */
+
+static void
+pp_points_to_solution (pretty_printer *buffer, struct pt_solution *pt)
+{
+ if (pt->anything)
+ {
+ pp_string (buffer, "anything ");
+ return;
+ }
+ if (pt->nonlocal)
+ pp_string (buffer, "nonlocal ");
+ if (pt->escaped)
+ pp_string (buffer, "escaped ");
+ if (pt->ipa_escaped)
+ pp_string (buffer, "unit-escaped ");
+ if (pt->null)
+ pp_string (buffer, "null ");
+ if (pt->vars
+ && !bitmap_empty_p (pt->vars))
+ {
+ bitmap_iterator bi;
+ unsigned i;
+ pp_string (buffer, "{ ");
+ EXECUTE_IF_SET_IN_BITMAP (pt->vars, 0, i, bi)
+ {
+ struct tree_decl_minimal in;
+ tree var;
+ in.uid = i;
+ var = (tree) htab_find_with_hash (gimple_referenced_vars (cfun),
+ &in, i);
+ if (var)
+ {
+ dump_generic_node (buffer, var, 0, dump_flags, false);
+ if (DECL_PT_UID (var) != DECL_UID (var))
+ {
+ pp_string (buffer, "ptD.");
+ pp_decimal_int (buffer, DECL_PT_UID (var));
+ }
+ }
+ else
+ {
+ pp_string (buffer, "D.");
+ pp_decimal_int (buffer, i);
+ }
+ pp_character (buffer, ' ');
+ }
+ pp_character (buffer, '}');
+ if (pt->vars_contains_global)
+ pp_string (buffer, " (glob)");
+ if (pt->vars_contains_restrict)
+ pp_string (buffer, " (restr)");
+ }
+}
/* Dump the call statement GS. BUFFER, SPC and FLAGS are as in
dump_gimple_stmt. */
@@ -486,6 +540,25 @@ dump_gimple_call (pretty_printer *buffer, gimple gs, int spc, int flags)
{
tree lhs = gimple_call_lhs (gs);
+ if (flags & TDF_ALIAS)
+ {
+ struct pt_solution *pt;
+ pt = gimple_call_use_set (gs);
+ if (!pt_solution_empty_p (pt))
+ {
+ pp_string (buffer, "# USE = ");
+ pp_points_to_solution (buffer, pt);
+ newline_and_indent (buffer, spc);
+ }
+ pt = gimple_call_clobber_set (gs);
+ if (!pt_solution_empty_p (pt))
+ {
+ pp_string (buffer, "# CLB = ");
+ pp_points_to_solution (buffer, pt);
+ newline_and_indent (buffer, spc);
+ }
+ }
+
if (flags & TDF_RAW)
{
dump_gimple_fmt (buffer, spc, flags, "%G <%T, %T",