diff options
author | Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz> | 2004-06-30 23:11:28 +0200 |
---|---|---|
committer | Zdenek Dvorak <rakdver@gcc.gnu.org> | 2004-06-30 21:11:28 +0000 |
commit | 5f240ec46eaea80964f62124351e64cda949592e (patch) | |
tree | 4c5126e282f3640784ee7d2bb37012cbef9d3ff5 /gcc/tree-ssa-operands.c | |
parent | 43e7557b6e0632e056b517ff41ab1c7161fed9e6 (diff) | |
download | gcc-5f240ec46eaea80964f62124351e64cda949592e.zip gcc-5f240ec46eaea80964f62124351e64cda949592e.tar.gz gcc-5f240ec46eaea80964f62124351e64cda949592e.tar.bz2 |
tree-ssa-loop-ch.c: New file.
* tree-ssa-loop-ch.c: New file.
* Makefile.in (tree-ssa-loop-ch.o): Add.
(tree-into-ssa.o): Add GGC_H dependency.
* tree-cfg.c (tree_duplicate_bb): Copy virtual arguments.
* tree-flow.h (rewrite_into_ssa): Declaration changed.
(rewrite_ssa_into_ssa, compute_global_livein, duplicate_ssa_name):
Declare.
* tree-into-ssa.c: Include ggc.h.
(struct def_blocks_d): Add phi_blocks field.
(struct mark_def_sites_global_data): Add names_to_rename field.
(struct ssa_name_info): New.
(compute_global_livein): Export.
(set_def_block, insert_phi_nodes, mark_def_sites, set_livein_block,
insert_phi_nodes_1, rewrite_finalize_block, insert_phi_nodes_for,
register_new_def, get_reaching_def, def_blocks_free,
get_def_blocks_for, rewrite_into_ssa): Modified to work with
rewrite_ssa_into_ssa.
(get_ssa_name_ann, get_phi_state, set_phi_state, get_current_def,
set_current_def, ssa_mark_def_sites_initialize_block,
ssa_mark_phi_uses, ssa_mark_def_sites, duplicate_ssa_name,
ssa_register_new_def, ssa_rewrite_initialize_block,
ssa_rewrite_phi_arguments, ssa_rewrite_finalize_block,
ssa_rewrite_stmt, rewrite_ssa_into_ssa, rewrite_all_into_ssa): New
functions.
(pass_build_ssa): Call rewrite_all_into_ssa.
* tree-optimize.c (execute_todo, execute_one_pass,
tree_rest_of_compilation): Allocate vars_to_rename only once.
* tree-ssa-dom.c (tree_ssa_dominator_optimize): Provide parameter
to rewrite_into_ssa.
* tree-ssa-loop.c (should_duplicate_loop_header_p,
mark_defs_for_rewrite, duplicate_blocks, do_while_loop_p,
copy_loop_headers, gate_ch, pass_ch): Moved to tree-ssa-loop-ch.c.
Use rewrite_ssa_into_ssa.
* tree-ssa-operands.c (copy_virtual_operands): New function.
* tree-ssa-operands.h (copy_virtual_operands): Declare.
* tree.h (struct tree_ssa_name): Add aux field.
(SSA_NAME_AUX): New macro to access it.
From-SVN: r83932
Diffstat (limited to 'gcc/tree-ssa-operands.c')
-rw-r--r-- | gcc/tree-ssa-operands.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/gcc/tree-ssa-operands.c b/gcc/tree-ssa-operands.c index 3129b9a..c44189f 100644 --- a/gcc/tree-ssa-operands.c +++ b/gcc/tree-ssa-operands.c @@ -1446,4 +1446,43 @@ add_call_read_ops (tree stmt, voperands_t prev_vops) } } +/* Copies virtual operands from SRC to DST. */ + +void +copy_virtual_operands (tree dst, tree src) +{ + vuse_optype vuses = STMT_VUSE_OPS (src); + v_may_def_optype v_may_defs = STMT_V_MAY_DEF_OPS (src); + v_must_def_optype v_must_defs = STMT_V_MUST_DEF_OPS (src); + vuse_optype *vuses_new = &stmt_ann (dst)->vuse_ops; + v_may_def_optype *v_may_defs_new = &stmt_ann (dst)->v_may_def_ops; + v_must_def_optype *v_must_defs_new = &stmt_ann (dst)->v_must_def_ops; + unsigned i; + + if (vuses) + { + *vuses_new = allocate_vuse_optype (NUM_VUSES (vuses)); + for (i = 0; i < NUM_VUSES (vuses); i++) + SET_VUSE_OP (*vuses_new, i, VUSE_OP (vuses, i)); + } + + if (v_may_defs) + { + *v_may_defs_new = allocate_v_may_def_optype (NUM_V_MAY_DEFS (v_may_defs)); + for (i = 0; i < NUM_V_MAY_DEFS (v_may_defs); i++) + { + SET_V_MAY_DEF_OP (*v_may_defs_new, i, V_MAY_DEF_OP (v_may_defs, i)); + SET_V_MAY_DEF_RESULT (*v_may_defs_new, i, + V_MAY_DEF_RESULT (v_may_defs, i)); + } + } + + if (v_must_defs) + { + *v_must_defs_new = allocate_v_must_def_optype (NUM_V_MUST_DEFS (v_must_defs)); + for (i = 0; i < NUM_V_MUST_DEFS (v_must_defs); i++) + SET_V_MUST_DEF_OP (*v_must_defs_new, i, V_MUST_DEF_OP (v_must_defs, i)); + } +} + #include "gt-tree-ssa-operands.h" |