* cgraphunit.c (symbol_table::process_new_functions): Update.
* ipa-fnsummary.c (pass_data_inline_parameters): Remove.
(inline_generate_summary): Rename to ...
(ipa_fn_summary_generate): ... this one.
(inline_read_summary): Rename to ...
(ipa_fn_summary_read): ... this one.
(inline_write_summary): Rename to ...
(ipa_fn_summary_write): ... this one.
(inline_free_summary): Rename to ...
(ipa_free_fn_summary): ... this one.
(pass_data_local_fn_summary, pass_local_fn_summary,
make_pass_local_fn_summary, pass_data_ipa_free_fn_summary,
pass_ipa_free_fn_summary, make_pass_ipa_free_fn_summary,
pass_data_ipa_fn_summary, pass_ipa_fn_summary,
make_pass_ipa_fn_summary): New.
* ipa-fnsummary.h (inline_generate_summary, inline_read_summary,
inline_write_summary, inline_free_summary): Remove.
(ipa_free_fn_summary) : New.
* ipa-inline.c (ipa_inline): Update.
(pass_ipa_inline): Do not generate summaries.
* ipa.c (pass_data_ipa_free_fn_summary, pass_ipa_free_fn_summary):
Remove.
* passes.def: Replace pass_inline_parameters by pass_local_fn_summary
and add pass_ipa_fn_summary.
* tree-pass.h (make_pass_ipa_fn_summary, make_pass_local_fn_summary):
New.
(make_pass_inline_parameters): Remove.
* lto.c (do_whole_program_analysis): Replace inline_free_summary
by ipa_free_fn_summary.
* gcc.dg/ipa/ctor-empty-1.c: Update template.
* gcc.dg/ipa/inline-5.c: Likewise.
* gfortran.dg/pr48636.f90: Likewise.
From-SVN: r248375
+2017-05-23 Jan Hubicka <hubicka@ucw.cz>
+
+ * cgraphunit.c (symbol_table::process_new_functions): Update.
+ * ipa-fnsummary.c (pass_data_inline_parameters): Remove.
+ (inline_generate_summary): Rename to ...
+ (ipa_fn_summary_generate): ... this one.
+ (inline_read_summary): Rename to ...
+ (ipa_fn_summary_read): ... this one.
+ (inline_write_summary): Rename to ...
+ (ipa_fn_summary_write): ... this one.
+ (inline_free_summary): Rename to ...
+ (ipa_free_fn_summary): ... this one.
+ (pass_data_local_fn_summary, pass_local_fn_summary,
+ make_pass_local_fn_summary, pass_data_ipa_free_fn_summary,
+ pass_ipa_free_fn_summary, make_pass_ipa_free_fn_summary,
+ pass_data_ipa_fn_summary, pass_ipa_fn_summary,
+ make_pass_ipa_fn_summary): New.
+ * ipa-fnsummary.h (inline_generate_summary, inline_read_summary,
+ inline_write_summary, inline_free_summary): Remove.
+ (ipa_free_fn_summary) : New.
+ * ipa-inline.c (ipa_inline): Update.
+ (pass_ipa_inline): Do not generate summaries.
+ * ipa.c (pass_data_ipa_free_fn_summary, pass_ipa_free_fn_summary):
+ Remove.
+ * passes.def: Replace pass_inline_parameters by pass_local_fn_summary
+ and add pass_ipa_fn_summary.
+ * tree-pass.h (make_pass_ipa_fn_summary, make_pass_local_fn_summary):
+ New.
+ (make_pass_inline_parameters): Remove.
+
2017-05-23 Thomas Schwinge <thomas@codesourcery.com>
* omp-low.c (struct omp_context): Remove "default_kind" member.
and splitting. This is redundant for functions added late.
Just throw away whatever it did. */
if (!summaried_computed)
- inline_free_summary ();
+ ipa_free_fn_summary ();
}
else if (ipa_fn_summaries != NULL)
compute_fn_summary (node, true);
return 0;
}
-namespace {
-
-const pass_data pass_data_inline_parameters =
-{
- GIMPLE_PASS, /* type */
- "inline_param", /* name */
- OPTGROUP_INLINE, /* optinfo_flags */
- TV_INLINE_PARAMETERS, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0, /* todo_flags_finish */
-};
-
-class pass_inline_parameters : public gimple_opt_pass
-{
-public:
- pass_inline_parameters (gcc::context *ctxt)
- : gimple_opt_pass (pass_data_inline_parameters, ctxt)
- {}
-
- /* opt_pass methods: */
- opt_pass * clone () { return new pass_inline_parameters (m_ctxt); }
- virtual unsigned int execute (function *)
- {
- return compute_fn_summary_for_current ();
- }
-
-}; // class pass_inline_parameters
-
-} // anon namespace
-
-gimple_opt_pass *
-make_pass_inline_parameters (gcc::context *ctxt)
-{
- return new pass_inline_parameters (ctxt);
-}
-
-
/* Estimate benefit devirtualizing indirect edge IE, provided KNOWN_VALS,
KNOWN_CONTEXTS and KNOWN_AGGS. */
/* Note function body size. */
-void
-inline_generate_summary (void)
+static void
+ipa_fn_summary_generate (void)
{
struct cgraph_node *node;
ipa_fn_summaries->enable_insertion_hook ();
ipa_register_cgraph_hooks ();
- inline_free_summary ();
+ ipa_free_fn_summary ();
FOR_EACH_DEFINED_FUNCTION (node)
if (!node->alias)
and inliner, so when ipa-cp is active, we don't need to write them
twice. */
-void
-inline_read_summary (void)
+static void
+ipa_fn_summary_read (void)
{
struct lto_file_decl_data **file_data_vec = lto_get_file_decl_data ();
struct lto_file_decl_data *file_data;
Jump functions are shared among ipa-cp and inliner, so when ipa-cp is
active, we don't need to write them twice. */
-void
-inline_write_summary (void)
+static void
+ipa_fn_summary_write (void)
{
struct output_block *ob = create_output_block (LTO_section_ipa_fn_summary);
lto_symtab_encoder_t encoder = ob->decl_state->symtab_node_encoder;
/* Release inline summary. */
void
-inline_free_summary (void)
+ipa_free_fn_summary (void)
{
struct cgraph_node *node;
if (!ipa_call_summaries)
ipa_call_summaries = NULL;
edge_predicate_pool.release ();
}
+
+namespace {
+
+const pass_data pass_data_local_fn_summary =
+{
+ GIMPLE_PASS, /* type */
+ "local-fnsummary", /* name */
+ OPTGROUP_INLINE, /* optinfo_flags */
+ TV_INLINE_PARAMETERS, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
+};
+
+class pass_local_fn_summary : public gimple_opt_pass
+{
+public:
+ pass_local_fn_summary (gcc::context *ctxt)
+ : gimple_opt_pass (pass_data_local_fn_summary, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ opt_pass * clone () { return new pass_local_fn_summary (m_ctxt); }
+ virtual unsigned int execute (function *)
+ {
+ return compute_fn_summary_for_current ();
+ }
+
+}; // class pass_local_fn_summary
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_local_fn_summary (gcc::context *ctxt)
+{
+ return new pass_local_fn_summary (ctxt);
+}
+
+
+/* Free inline summary. */
+
+namespace {
+
+const pass_data pass_data_ipa_free_fn_summary =
+{
+ SIMPLE_IPA_PASS, /* type */
+ "free-fnsummary", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ TV_IPA_FREE_INLINE_SUMMARY, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ /* Early optimizations may make function unreachable. We can not
+ remove unreachable functions as part of the ealry opts pass because
+ TODOs are run before subpasses. Do it here. */
+ ( TODO_remove_functions | TODO_dump_symtab ), /* todo_flags_finish */
+};
+
+class pass_ipa_free_fn_summary : public simple_ipa_opt_pass
+{
+public:
+ pass_ipa_free_fn_summary (gcc::context *ctxt)
+ : simple_ipa_opt_pass (pass_data_ipa_free_fn_summary, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ virtual unsigned int execute (function *)
+ {
+ ipa_free_fn_summary ();
+ return 0;
+ }
+
+}; // class pass_ipa_free_fn_summary
+
+} // anon namespace
+
+simple_ipa_opt_pass *
+make_pass_ipa_free_fn_summary (gcc::context *ctxt)
+{
+ return new pass_ipa_free_fn_summary (ctxt);
+}
+
+namespace {
+
+const pass_data pass_data_ipa_fn_summary =
+{
+ IPA_PASS, /* type */
+ "fnsummary", /* name */
+ OPTGROUP_INLINE, /* optinfo_flags */
+ TV_IPA_INLINING, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_dump_symtab ), /* todo_flags_finish */
+};
+
+class pass_ipa_fn_summary : public ipa_opt_pass_d
+{
+public:
+ pass_ipa_fn_summary (gcc::context *ctxt)
+ : ipa_opt_pass_d (pass_data_ipa_fn_summary, ctxt,
+ ipa_fn_summary_generate, /* generate_summary */
+ ipa_fn_summary_write, /* write_summary */
+ ipa_fn_summary_read, /* read_summary */
+ NULL, /* write_optimization_summary */
+ NULL, /* read_optimization_summary */
+ NULL, /* stmt_fixup */
+ 0, /* function_transform_todo_flags_start */
+ NULL, /* function_transform */
+ NULL) /* variable_transform */
+ {}
+
+ /* opt_pass methods: */
+ virtual unsigned int execute (function *) { return 0; }
+
+}; // class pass_ipa_fn_summary
+
+} // anon namespace
+
+ipa_opt_pass_d *
+make_pass_ipa_fn_summary (gcc::context *ctxt)
+{
+ return new pass_ipa_fn_summary (ctxt);
+}
void ipa_dump_fn_summaries (FILE *f);
void ipa_dump_fn_summary (FILE *f, struct cgraph_node *node);
void ipa_dump_hints (FILE *f, ipa_hints);
-void inline_generate_summary (void);
-void inline_read_summary (void);
-void inline_write_summary (void);
-void inline_free_summary (void);
+void ipa_free_fn_summary (void);
void inline_analyze_function (struct cgraph_node *node);
void estimate_ipcp_clone_size_and_time (struct cgraph_node *,
vec<tree>,
ipa_dump_fn_summaries (dump_file);
/* In WPA we use inline summaries for partitioning process. */
if (!flag_wpa)
- inline_free_summary ();
+ ipa_free_fn_summary ();
return remove_functions ? TODO_remove_functions : 0;
}
public:
pass_ipa_inline (gcc::context *ctxt)
: ipa_opt_pass_d (pass_data_ipa_inline, ctxt,
- inline_generate_summary, /* generate_summary */
- inline_write_summary, /* write_summary */
- inline_read_summary, /* read_summary */
+ NULL, /* generate_summary */
+ NULL, /* write_summary */
+ NULL, /* read_summary */
NULL, /* write_optimization_summary */
NULL, /* read_optimization_summary */
NULL, /* stmt_fixup */
return remove_p;
}
-/* Free inline summary. */
-
-namespace {
-
-const pass_data pass_data_ipa_free_fn_summary =
-{
- SIMPLE_IPA_PASS, /* type */
- "free-inline-summary", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- TV_IPA_FREE_INLINE_SUMMARY, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- /* Early optimizations may make function unreachable. We can not
- remove unreachable functions as part of the ealry opts pass because
- TODOs are run before subpasses. Do it here. */
- ( TODO_remove_functions | TODO_dump_symtab ), /* todo_flags_finish */
-};
-
-class pass_ipa_free_fn_summary : public simple_ipa_opt_pass
-{
-public:
- pass_ipa_free_fn_summary (gcc::context *ctxt)
- : simple_ipa_opt_pass (pass_data_ipa_free_fn_summary, ctxt)
- {}
-
- /* opt_pass methods: */
- virtual unsigned int execute (function *)
- {
- inline_free_summary ();
- return 0;
- }
-
-}; // class pass_ipa_free_fn_summary
-
-} // anon namespace
-
-simple_ipa_opt_pass *
-make_pass_ipa_free_fn_summary (gcc::context *ctxt)
-{
- return new pass_ipa_free_fn_summary (ctxt);
-}
-
/* Generate and emit a static constructor or destructor. WHICH must
be one of 'I' (for a constructor), 'D' (for a destructor), 'P'
(for chp static vars constructor) or 'B' (for chkp static bounds
+2017-05-23 Jan Hubicka <hubicka@ucw.cz>
+
+ * lto.c (do_whole_program_analysis): Replace inline_free_summary
+ by ipa_free_fn_summary.
+
2017-05-23 Martin Liska <mliska@suse.cz>
* lto-symtab.c (lto_cgraph_replace_node): Use
/* Inline summaries are needed for balanced partitioning. Free them now so
the memory can be used for streamer caches. */
- inline_free_summary ();
+ ipa_free_fn_summary ();
/* AUX pointers are used by partitioning code to bookkeep number of
partitions symbol is in. This is no longer needed. */
PUSH_INSERT_PASSES_WITHIN (pass_local_optimization_passes)
NEXT_PASS (pass_fixup_cfg);
NEXT_PASS (pass_rebuild_cgraph_edges);
- NEXT_PASS (pass_inline_parameters);
+ NEXT_PASS (pass_local_fn_summary);
NEXT_PASS (pass_early_inline);
NEXT_PASS (pass_all_early_optimizations);
PUSH_INSERT_PASSES_WITHIN (pass_all_early_optimizations)
POP_INSERT_PASSES ()
NEXT_PASS (pass_release_ssa_names);
NEXT_PASS (pass_rebuild_cgraph_edges);
- NEXT_PASS (pass_inline_parameters);
+ NEXT_PASS (pass_local_fn_summary);
POP_INSERT_PASSES ()
NEXT_PASS (pass_ipa_oacc);
NEXT_PASS (pass_ipa_cp);
NEXT_PASS (pass_ipa_cdtor_merge);
NEXT_PASS (pass_ipa_hsa);
+ NEXT_PASS (pass_ipa_fn_summary);
NEXT_PASS (pass_ipa_inline);
NEXT_PASS (pass_ipa_pure_const);
NEXT_PASS (pass_ipa_reference);
+2017-05-23 Jan Hubicka <hubicka@ucw.cz>
+
+ * gcc.dg/ipa/ctor-empty-1.c: Update template.
+ * gcc.dg/ipa/inline-5.c: Likewise.
+ * gfortran.dg/pr48636.f90: Likewise.
+
2017-05-23 Nathan Sidwell <nathan@acm.org>
* g++.dg/parse/ctor9.C: Adjust expected error.
/* { dg-do compile } */
-/* { dg-options "-O3 -c -fdump-ipa-free-inline-summary" } */
+/* { dg-options "-O3 -c -fdump-ipa-free-fnsummary" } */
static __attribute__((constructor))
void empty_constructor()
{
}
-/* { dg-final { scan-ipa-dump "Reclaiming functions: empty_constructor" "free-inline-summary" } } */
+/* { dg-final { scan-ipa-dump "Reclaiming functions: empty_constructor" "free-fnsummary" } } */
/* Check statements that are eliminated by inlining. */
/* { dg-do compile } */
-/* { dg-options "-O2 -fdump-ipa-inline-details -fno-early-inlining -fno-partial-inlining -fno-ipa-cp" } */
+/* { dg-options "-O2 -fdump-ipa-fnsummary-details -fno-early-inlining -fno-partial-inlining -fno-ipa-cp" } */
struct a {int a,b,c,d,e;};
void t(int);
/* Will be eliminated by inlining */
}
-/* { dg-final { scan-ipa-dump-times "Will be eliminated" 4 "inline" { xfail { { hppa*-*-* } && { ! lp64 } } } } } */
-/* { dg-final { scan-ipa-dump-times "50. will be eliminated" 1 "inline" } } */
+/* { dg-final { scan-ipa-dump-times "Will be eliminated" 4 "fnsummary" { xfail { { hppa*-*-* } && { ! lp64 } } } } } */
+/* { dg-final { scan-ipa-dump-times "50. will be eliminated" 1 "fnsummary" } } */
! { dg-do compile }
-! { dg-options "-O3 -fdump-ipa-inline-details -fno-ipa-cp" }
+! { dg-options "-O3 -fdump-ipa-inline-details -fdump-ipa-fnsummary-details -fno-ipa-cp" }
module foo
implicit none
end program main
! { dg-final { scan-ipa-dump "bar\[^\\n\]*inline copy in MAIN" "inline" } }
-! { dg-final { scan-ipa-dump-times "phi predicate:" 3 "inline" } }
-! { dg-final { scan-ipa-dump "inline hints: loop_iterations" "inline" } }
+! { dg-final { scan-ipa-dump-times "phi predicate:" 3 "fnsummary" } }
+! { dg-final { scan-ipa-dump "inline hints: loop_iterations" "fnsummary" } }
*ctxt);
extern simple_ipa_opt_pass *make_pass_ipa_increase_alignment (gcc::context
*ctxt);
+extern ipa_opt_pass_d *make_pass_ipa_fn_summary (gcc::context *ctxt);
extern ipa_opt_pass_d *make_pass_ipa_inline (gcc::context *ctxt);
extern simple_ipa_opt_pass *make_pass_ipa_free_lang_data (gcc::context *ctxt);
extern simple_ipa_opt_pass *make_pass_ipa_free_fn_summary (gcc::context *ctxt);
extern rtl_opt_pass *make_pass_rtl_seqabstr (gcc::context *ctxt);
extern gimple_opt_pass *make_pass_release_ssa_names (gcc::context *ctxt);
extern gimple_opt_pass *make_pass_early_inline (gcc::context *ctxt);
-extern gimple_opt_pass *make_pass_inline_parameters (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_local_fn_summary (gcc::context *ctxt);
extern gimple_opt_pass *make_pass_update_address_taken (gcc::context *ctxt);
extern gimple_opt_pass *make_pass_convert_switch (gcc::context *ctxt);
extern gimple_opt_pass *make_pass_lower_vaarg (gcc::context *ctxt);