diff options
author | Martin Jambor <mjambor@suse.cz> | 2009-11-10 15:43:20 +0100 |
---|---|---|
committer | Martin Jambor <jamborm@gcc.gnu.org> | 2009-11-10 15:43:20 +0100 |
commit | 2c5721d9f36a114809e296686ff39b1324b0cc5b (patch) | |
tree | 6cb5567aec53c0584fb5b316226815f21f6ec6b1 | |
parent | c587836d9d5d1c1ec9182becd91268e0249d8f26 (diff) | |
download | gcc-2c5721d9f36a114809e296686ff39b1324b0cc5b.zip gcc-2c5721d9f36a114809e296686ff39b1324b0cc5b.tar.gz gcc-2c5721d9f36a114809e296686ff39b1324b0cc5b.tar.bz2 |
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
-rw-r--r-- | gcc/ChangeLog | 16 | ||||
-rw-r--r-- | gcc/ipa-cp.c | 1 | ||||
-rw-r--r-- | gcc/ipa-inline.c | 1 | ||||
-rw-r--r-- | gcc/ipa-pure-const.c | 1 | ||||
-rw-r--r-- | gcc/ipa-reference.c | 1 | ||||
-rw-r--r-- | gcc/ipa.c | 1 | ||||
-rw-r--r-- | gcc/lto-streamer-in.c | 5 | ||||
-rw-r--r-- | gcc/lto-streamer-out.c | 2 | ||||
-rw-r--r-- | gcc/lto-wpa-fixup.c | 1 | ||||
-rw-r--r-- | gcc/passes.c | 44 | ||||
-rw-r--r-- | gcc/tree-pass.h | 6 |
11 files changed, 77 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 20477c4..7bcc946 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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 diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c index 79ff16e..2c3b5b7 100644 --- a/gcc/ipa-cp.c +++ b/gcc/ipa-cp.c @@ -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 */ diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c index bc7048f5..08088dd 100644 --- a/gcc/ipa-inline.c +++ b/gcc/ipa-inline.c @@ -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 */ diff --git a/gcc/ipa-pure-const.c b/gcc/ipa-pure-const.c index e37af05..bc03bff 100644 --- a/gcc/ipa-pure-const.c +++ b/gcc/ipa-pure-const.c @@ -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 */ diff --git a/gcc/ipa-reference.c b/gcc/ipa-reference.c index 8610f13..074aea6 100644 --- a/gcc/ipa-reference.c +++ b/gcc/ipa-reference.c @@ -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 */ @@ -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 */ diff --git a/gcc/lto-streamer-in.c b/gcc/lto-streamer-in.c index f7c7936..7e1559c 100644 --- a/gcc/lto-streamer-in.c +++ b/gcc/lto-streamer-in.c @@ -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); diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c index 1ed1939..fee2372 100644 --- a/gcc/lto-streamer-out.c +++ b/gcc/lto-streamer-out.c @@ -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 */ diff --git a/gcc/lto-wpa-fixup.c b/gcc/lto-wpa-fixup.c index 4411588..469af5a 100644 --- a/gcc/lto-wpa-fixup.c +++ b/gcc/lto-wpa-fixup.c @@ -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 */ diff --git a/gcc/passes.c b/gcc/passes.c index 1cef349..fb0dd83 100644 --- a/gcc/passes.c +++ b/gcc/passes.c @@ -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); diff --git a/gcc/tree-pass.h b/gcc/tree-pass.h index e8d6fae..bff027b 100644 --- a/gcc/tree-pass.h +++ b/gcc/tree-pass.h @@ -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); |