aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-optimize.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@gcc.gnu.org>2004-06-19 15:33:06 +0000
committerJan Hubicka <hubicka@gcc.gnu.org>2004-06-19 15:33:06 +0000
commit242229bbdc6beacddb4ed263c759d3ca52dae927 (patch)
tree2ee8a7629143f7f2514ddf9a48376c6ac3d11bc0 /gcc/tree-optimize.c
parentff98621c682005e2a224f62c1aa5028353a5357e (diff)
downloadgcc-242229bbdc6beacddb4ed263c759d3ca52dae927.zip
gcc-242229bbdc6beacddb4ed263c759d3ca52dae927.tar.gz
gcc-242229bbdc6beacddb4ed263c759d3ca52dae927.tar.bz2
CFG transparent RTL expansion:
* Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
Diffstat (limited to 'gcc/tree-optimize.c')
-rw-r--r--gcc/tree-optimize.c51
1 files changed, 9 insertions, 42 deletions
diff --git a/gcc/tree-optimize.c b/gcc/tree-optimize.c
index 16ddd8f..30e1e7c 100644
--- a/gcc/tree-optimize.c
+++ b/gcc/tree-optimize.c
@@ -84,33 +84,6 @@ static struct tree_opt_pass pass_gimple =
TODO_dump_func /* todo_flags_finish */
};
-/* Pass: replace the outermost BIND_EXPR. We removed all of them while
- optimizing, but the tree->rtl expander requires it. */
-
-static void
-execute_rebuild_bind (void)
-{
- DECL_SAVED_TREE (current_function_decl)
- = build (BIND_EXPR, void_type_node, NULL_TREE,
- DECL_SAVED_TREE (current_function_decl), NULL_TREE);
-}
-
-static struct tree_opt_pass pass_rebuild_bind =
-{
- NULL, /* name */
- NULL, /* gate */
- execute_rebuild_bind, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- 0, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
-};
-
/* Gate: execute, or not, all of the non-trivial optimizations. */
static bool
@@ -141,9 +114,8 @@ static struct tree_opt_pass pass_all_optimizations =
passes. */
static void
-execute_del_cfg (void)
+execute_free_datastructures (void)
{
- basic_block bb;
tree *chain;
/* ??? This isn't the right place for this. Worse, it got computed
@@ -160,27 +132,23 @@ execute_del_cfg (void)
/* Re-chain the statements from the blocks. */
chain = &DECL_SAVED_TREE (current_function_decl);
*chain = alloc_stmt_list ();
- FOR_EACH_BB (bb)
- {
- append_to_statement_list_force (bb->stmt_list, chain);
- }
- /* And get rid of the cfg. */
- delete_tree_cfg ();
+ /* And get rid of annotations we no longer need. */
+ delete_tree_cfg_annotations ();
}
-static struct tree_opt_pass pass_del_cfg =
+static struct tree_opt_pass pass_free_datastructures =
{
NULL, /* name */
NULL, /* gate */
- execute_del_cfg, /* execute */
+ execute_free_datastructures, /* execute */
NULL, /* sub */
NULL, /* next */
0, /* static_pass_number */
0, /* tv_id */
PROP_cfg, /* properties_required */
0, /* properties_provided */
- PROP_cfg, /* properties_destroyed */
+ 0, /* properties_destroyed */
0, /* todo_flags_start */
0 /* todo_flags_finish */
};
@@ -283,16 +251,16 @@ init_tree_optimization_passes (void)
NEXT_PASS (pass_mudflap_1);
NEXT_PASS (pass_lower_cf);
NEXT_PASS (pass_lower_eh);
+ NEXT_PASS (pass_build_cfg);
+ NEXT_PASS (pass_tree_profile);
NEXT_PASS (pass_all_optimizations);
NEXT_PASS (pass_mudflap_2);
- NEXT_PASS (pass_rebuild_bind);
+ NEXT_PASS (pass_free_datastructures);
NEXT_PASS (pass_expand);
NEXT_PASS (pass_rest_of_compilation);
*p = NULL;
p = &pass_all_optimizations.sub;
- NEXT_PASS (pass_build_cfg);
- NEXT_PASS (pass_tree_profile);
NEXT_PASS (pass_referenced_vars);
NEXT_PASS (pass_build_pta);
NEXT_PASS (pass_build_ssa);
@@ -335,7 +303,6 @@ init_tree_optimization_passes (void)
NEXT_PASS (pass_del_ssa);
NEXT_PASS (pass_nrv);
NEXT_PASS (pass_remove_useless_vars);
- NEXT_PASS (pass_del_cfg);
*p = NULL;
#undef NEXT_PASS