tree-pass.h (struct ipa_opt_pass_d): Added stmt_fixup field.

2009-11-10  Martin Jambor  <mjambor@suse.cz>

	* tree-pass.h (struct ipa_opt_pass_d): Added stmt_fixup field.
	(execute_all_ipa_stmt_fixups): Declare.
	* ipa-cp.c (pass_ipa_cp): Added stmt_fixup value.
	* ipa-inline.c (pass_ipa_inline): Likewise.
	* ipa-pure-const.c (pass_ipa_pure_cons): Likewise.
	* ipa-reference.c (pass_ipa_reference): Likewise.
	* ipa.c (pass_ipa_whole_program_visibility): Likewise.
	* lto-streamer-out.c (pass_ipa_lto_gimple_out): Likewise.
	(pass_ipa_lto_finish_out): Likewise.
	* lto-wpa-fixup.c (pass_ipa_lto_wpa_fixup): Likewise.
	* passes.c (execute_ipa_stmt_fixups): New function.
	(execute_all_ipa_stmt_fixups): New function.
	* lto-streamer-in.c (input_function): Call execute_all_ipa_stmt_fixups.

From-SVN: r154064
This commit is contained in:
Martin Jambor 2009-11-10 15:43:20 +01:00 committed by Martin Jambor
parent c587836d9d
commit 2c5721d9f3
11 changed files with 77 additions and 2 deletions

View File

@ -1,3 +1,19 @@
2009-11-10 Martin Jambor <mjambor@suse.cz>
* tree-pass.h (struct ipa_opt_pass_d): Added stmt_fixup field.
(execute_all_ipa_stmt_fixups): Declare.
* ipa-cp.c (pass_ipa_cp): Added stmt_fixup value.
* ipa-inline.c (pass_ipa_inline): Likewise.
* ipa-pure-const.c (pass_ipa_pure_cons): Likewise.
* ipa-reference.c (pass_ipa_reference): Likewise.
* ipa.c (pass_ipa_whole_program_visibility): Likewise.
* lto-streamer-out.c (pass_ipa_lto_gimple_out): Likewise.
(pass_ipa_lto_finish_out): Likewise.
* lto-wpa-fixup.c (pass_ipa_lto_wpa_fixup): Likewise.
* passes.c (execute_ipa_stmt_fixups): New function.
(execute_all_ipa_stmt_fixups): New function.
* lto-streamer-in.c (input_function): Call execute_all_ipa_stmt_fixups.
2009-11-10 Eric Botcazou <ebotcazou@adacore.com>
PR ada/20548

View File

@ -1327,6 +1327,7 @@ struct ipa_opt_pass_d pass_ipa_cp =
ipcp_write_summary, /* write_summary */
ipcp_read_summary, /* read_summary */
NULL, /* function_read_summary */
NULL, /* stmt_fixup */
0, /* TODOs */
NULL, /* function_transform */
NULL, /* variable_transform */

View File

@ -2020,6 +2020,7 @@ struct ipa_opt_pass_d pass_ipa_inline =
inline_write_summary, /* write_summary */
inline_read_summary, /* read_summary */
NULL, /* function_read_summary */
NULL, /* stmt_fixup */
0, /* TODOs */
inline_transform, /* function_transform */
NULL, /* variable_transform */

View File

@ -1100,6 +1100,7 @@ struct ipa_opt_pass_d pass_ipa_pure_const =
pure_const_write_summary, /* write_summary */
pure_const_read_summary, /* read_summary */
NULL, /* function_read_summary */
NULL, /* stmt_fixup */
0, /* TODOs */
NULL, /* function_transform */
NULL /* variable_transform */

View File

@ -1511,6 +1511,7 @@ struct ipa_opt_pass_d pass_ipa_reference =
ipa_reference_write_summary, /* write_summary */
ipa_reference_read_summary, /* read_summary */
NULL, /* function_read_summary */
NULL, /* stmt_fixup */
0, /* TODOs */
NULL, /* function_transform */
NULL /* variable_transform */

View File

@ -425,6 +425,7 @@ struct ipa_opt_pass_d pass_ipa_whole_program_visibility =
NULL, /* write_summary */
NULL, /* read_summary */
NULL, /* function_read_summary */
NULL, /* stmt_fixup */
0, /* TODOs */
NULL, /* function_transform */
NULL, /* variable_transform */

View File

@ -1261,6 +1261,7 @@ input_function (tree fn_decl, struct data_in *data_in,
gimple *stmts;
basic_block bb;
struct bitpack_d *bp;
struct cgraph_node *node;
fn = DECL_STRUCT_FUNCTION (fn_decl);
tag = input_record_start (ib);
@ -1340,7 +1341,9 @@ input_function (tree fn_decl, struct data_in *data_in,
gimple_set_body (fn_decl, bb_seq (ei_edge (ei)->dest));
}
fixup_call_stmt_edges (cgraph_node (fn_decl), stmts);
node = cgraph_node (fn_decl);
fixup_call_stmt_edges (node, stmts);
execute_all_ipa_stmt_fixups (node, stmts);
update_ssa (TODO_update_ssa_only_virtuals);
free_dominance_info (CDI_DOMINATORS);

View File

@ -2115,6 +2115,7 @@ struct ipa_opt_pass_d pass_ipa_lto_gimple_out =
lto_output, /* write_summary */
NULL, /* read_summary */
NULL, /* function_read_summary */
NULL, /* stmt_fixup */
0, /* TODOs */
NULL, /* function_transform */
NULL /* variable_transform */
@ -2545,6 +2546,7 @@ struct ipa_opt_pass_d pass_ipa_lto_finish_out =
produce_asm_for_decls, /* write_summary */
NULL, /* read_summary */
NULL, /* function_read_summary */
NULL, /* stmt_fixup */
0, /* TODOs */
NULL, /* function_transform */
NULL /* variable_transform */

View File

@ -274,6 +274,7 @@ struct ipa_opt_pass_d pass_ipa_lto_wpa_fixup =
lto_output_wpa_fixup, /* write_summary */
lto_input_wpa_fixup, /* read_summary */
NULL, /* function_read_summary */
NULL, /* stmt_fixup */
0, /* TODOs */
NULL, /* function_transform */
NULL /* variable_transform */

View File

@ -1755,6 +1755,50 @@ execute_ipa_pass_list (struct opt_pass *pass)
while (pass);
}
/* Execute stmt fixup hooks of all passes in PASS for NODE and STMTS. */
static void
execute_ipa_stmt_fixups (struct opt_pass *pass,
struct cgraph_node *node, gimple *stmts)
{
while (pass)
{
/* Execute all of the IPA_PASSes in the list. */
if (pass->type == IPA_PASS
&& (!pass->gate || pass->gate ()))
{
struct ipa_opt_pass_d *ipa_pass = (struct ipa_opt_pass_d *) pass;
if (ipa_pass->stmt_fixup)
{
pass_init_dump_file (pass);
/* If a timevar is present, start it. */
if (pass->tv_id)
timevar_push (pass->tv_id);
ipa_pass->stmt_fixup (node, stmts);
/* Stop timevar. */
if (pass->tv_id)
timevar_pop (pass->tv_id);
pass_fini_dump_file (pass);
}
if (pass->sub)
execute_ipa_stmt_fixups (pass->sub, node, stmts);
}
pass = pass->next;
}
}
/* Execute stmt fixup hooks of all IPA passes for NODE and STMTS. */
void
execute_all_ipa_stmt_fixups (struct cgraph_node *node, gimple *stmts)
{
execute_ipa_stmt_fixups (all_regular_ipa_passes, node, stmts);
}
extern void debug_properties (unsigned int);
extern void dump_properties (FILE *, unsigned int);

View File

@ -185,7 +185,10 @@ struct ipa_opt_pass_d
as needed so both calls are necessary. */
void (*read_summary) (void);
void (*function_read_summary) (struct cgraph_node *);
/* Hook to convert gimple stmt uids into true gimple statements. The second
parameter is an array of statements indexed by their uid. */
void (*stmt_fixup) (struct cgraph_node *, gimple *);
/* Results of interprocedural propagation of an IPA pass is applied to
function body via this hook. */
unsigned int function_transform_todo_flags_start;
@ -566,6 +569,7 @@ extern void execute_pass_list (struct opt_pass *);
extern void execute_ipa_pass_list (struct opt_pass *);
extern void execute_ipa_summary_passes (struct ipa_opt_pass_d *);
extern void execute_all_ipa_transforms (void);
extern void execute_all_ipa_stmt_fixups (struct cgraph_node *, gimple *);
extern void print_current_pass (FILE *);
extern void debug_pass (void);