Update pass manager to handle generate_summary/transform functions
Diego Novillo
dnovillo@google.com
Thu May 1 15:09:00 GMT 2008
2008/4/5 Jan Hubicka <jh@suse.cz>:
> > * tree-pass.h (opt_pass): Add IPA_PASS.
> > (varpool_node, cgraph_node): Forward declare.
> > (ipa_opt_pass): Define.
> > (pass_ipa_inline): Turn into ipa_opt_pass.
> > (pass_apply_inline): Remove.
> > * ipa-inline.c (pass_ipa_inline): Turn into ipa_opt_pass.
> > (apply_inline): Turn into ....
> > (inline_transform): ... this one.
> > (inline_generate_summary): New function.
> > (pass_apply_inline): Remove.
> > * function.h (ipa_opt_pass): Forward declare structure;
typedef;
> > vector.
> > (struct function): Add ipa_transforms_to_apply.
> > * passes.c (register_one_dump_file): Work on IPA_PASS.
> > (init_optimization_passes): Remove pass_inline_parameters and
> > pass_apply_inline.
> > (pass_init_dump_file, pass_fini_dump_file): Break out from ....
> > (execute_one_pass) ... here; apply transforms when possible.
> > (add_ipa_transform_pass, execute_ipa_summary_asses,
> > execute_one_ipa_transform_pass): New.
> > (execute_ipa_pass_list): Update for IPA_PASS type.
OK with a few minor nits.
> > ! TODO_remove_functions, /* todo_flags_finish */
> > ! TODO_dump_cgraph | TODO_dump_func
> > ! | TODO_remove_functions /* todo_flags_finish */
Align vertically. It reads better.
> > + /* Initialize pass dump file. */
Vertical spacing. Mention argument PASS maybe as 'Initialize
dump file for PASS.'
> > + const char *dname, *aname;
> > + dname = lang_hooks.decl_printable_name
(current_function_decl, 2);
> > + aname = (IDENTIFIER_POINTER
> > + (DECL_ASSEMBLER_NAME (current_function_decl)));
> > + fprintf (dump_file, "\n;; Appli transform to function %s
(%s)%s\n\n", dname, aname,
s/Appli/Apply/
> > + /* Flush pass dump file. */
> > + static void
Vertical space. Mention PASS argument in comment.
> > + /* Schedule IPA transform pass DATA for CFUN. */
> > + static void
Vertical spacing.
> > +
> > + /* Execute IPA pass function summary generation. */
> > + static void
Likewise. Document DATA.
> > + /* Execute IPA pass function transform. */
> > + static void
Likewise. Document NODE and IPA_PASS.
Diego.
More information about the Gcc-patches
mailing list