aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-dse.c
diff options
context:
space:
mode:
authorBrian Booth <bbooth@redhat.com>2004-06-10 21:41:08 +0000
committerBrian Booth <bbooth@gcc.gnu.org>2004-06-10 21:41:08 +0000
commita32b97a20d6638f3cee28919f4e6bd7b1d9b39e8 (patch)
tree390a758454170e0dc2e6aea71342ec3d64fd2501 /gcc/tree-ssa-dse.c
parentd57f1617211f3309887c6ee18fca97ea7029ebc7 (diff)
downloadgcc-a32b97a20d6638f3cee28919f4e6bd7b1d9b39e8.zip
gcc-a32b97a20d6638f3cee28919f4e6bd7b1d9b39e8.tar.gz
gcc-a32b97a20d6638f3cee28919f4e6bd7b1d9b39e8.tar.bz2
tree-ssa.texi: Remove references to VDEF and add descriptions of V_MAY_DEF and V_MUST_DEF.
* doc/tree-ssa.texi: Remove references to VDEF and add descriptions of V_MAY_DEF and V_MUST_DEF. * tree-dfa.c (dfa_stats_d): Add num_v_must_defs and rename num_vdefs to num_v_may_defs. (compute_immediate_uses_for_stmt): Rename occurences of vdef to v_may_def. (redirect_immediate_uses): Ditto. (dump_dfa_stats): Ditto. Also added code to dump num_v_must_defs. (collect_dfa_stats_r): Rename occurences of vdef to v_may_def. Also add code to sum up the number of v_must_defs. (vdefs_disappeared_p): Replace with... (v_may_defs_disappeared_p): This. (v_must_defs_disappeared_p): New function. (mark_new_vars_to_rename): Rename occurences of vdef to v_may_def. Also add code to mark new variables found in V_MUST_DEFs for renameing. * tree-flow.h (stmt_ann_d): Add v_must_def_ops and replace vdef_ops to v_may_def_ops. (get_vdef_ops): Replace with... (get_v_may_def_ops): This. * tree-flow-inline.h (get_vdef_ops): Replace with... (get_v_may_def_ops): This. (get_v_must_def_ops): New function. (get_vdef_result_ptr): Replace with... (get_v_may_def_result_ptr): This. (get_vdef_op_ptr): Ditto with... (get_v_may_def_op_ptr); This. (get_v_must_def_op_ptr): New function. * tree-into-ssa.c (mark_def_sites): Rename occurences of vdef to v_may_def. Also add code to mark statements with V_MUST_DEFs as definition sites. (rewrite_stmt): Rename occurences of vdef to v_may_def. Also add code to register new V_MUST_DEFs made by the statement. * tree-outof-ssa.c (VIRTUAL_PARTITION): Update comments. (check_replaceable): Rename occurences of vdef to v_may_def. Also add check for V_MUST_DEFs. (find_replaceable_in_bb): Ditto. * tree-pretty-print.c (dump_vops): Rename occurences of vdef to v_may_def. Also add code to dump V_MUST_DEFs. * tree-sra.c (mark_all_vdefs): Replace with... (mark_all_v_may_defs): This. (mark_all_v_must_defs): New function. (create_scalar_copies): Replace call to mark_all_vdefs with calls to mark_all_v_may_defs and mark_all_v_must_defs. (scalarize_structures): Rename occurences of vdef to v_may_def. Also add a check for V_MUST_DEFs. (scalarize_modify_expr): Rename occurences of vdef to v_may_def. * tree-ssa-alias.c (global_var): Update comment. (compute_may_aliases): Ditto. (compute_points_to_and_addr_escape): Rename occurences of vdef to v_may_def. Also add code to mark variables in V_MUST_DEF operands as being written to. (group_aliases): Update comment. (maybe_create_global_var): Ditto. * tree-ssa.c (verify_ssa): Rename occurences of vdef to v_may_def. Also add a check for V_MUST_DEFs on GIMPLE registers. (replace_immediate_uses): Rename occurences of vdef to v_may_def. * tree-ssa-ccp.c (visit_stmt): Rename occurences of vdef to v_may_def. Also add code to mark all V_MUST_DEF operands VARYING. (initialize): Ditto. (set_rhs): Rename occurences of vdef to v_may_def. Also add code to update SSA_NAMEs in V_MUST_DEFs. * tree-ssa-copy.c (cprop_into_stmt): Rename occurences of vdef to v_may_def. * tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Rename occurences of vdef to v_may_def. Also add code to mark statements with V_MUST_DEFs as necessary. (propagate_necessity): Rename occurences of vdef to v_may_def. * tree-ssa-dom.c (redirect_edges_and_update_ssa_graph): Rename occurences of vdef to v_may_def. Also add code to mark operands in V_MUST_DEFs for renaming. (eliminate_redundant_computations): Rename occurences of vdef to v_may_def. (record_equivalences_from_stmt): Rename occurences of vdef to v_may_def. Also add code to record VUSEs for V_MUST_DEFs. (optimize_stmt): Remove unnesessary variable vdefs. Update comment. (register_definitions_for_stmt): Rename occurences of vdef to v_may_def. Also add code to register definitions made with V_MUST_DEFs. * tree-ssa-dse.c (fix_stmt_vdefs): Replace with... (fix_stmt_v_may_defs): This. (fix_phi_uses): Rename occurences of vdef to v_may_def. (dse_optimize_stmt): Ditto. * tree-ssa-live.c (create_ssa_var_map): Rename occurences of vdef to v_may_def. Also add code to mark V_MUST_DEF operands as being used in virtual operators. * tree-ssa-loop.c (mark_defs_for_rewrite): Rename occurences of vdef to v_may_def. Also add code to mark V_MUST_DEF operands for renaming. * tree-ssa-operands.c (opf_kill_def): New flag for killing definitions. (build_vdefs): Renamed to... (build_v_may_defs): This. (build_v_must_defs): New variable. (voperands_d): Add v_must_def_ops and replace vdef_ops with v_may_def_ops. (append_vdef): Replace with... (append_v_may_def): This. (append_v_must_def): New function. (NUM_FREE): Increment for V_MUST_DEF (optype_freelist): Increment its size for V_MUST_DEF (allocate_vdef_optype): Replace with... (allocate_v_may_def_optype): This. (allocate_v_must_def_optype): New function. (free_vdefs): Replace with... (free_v_may_defs): This. (free_v_must_defs): New function. (remove_vdefs): Replace with... (remove_v_may_defs): This. (remove_v_must_defs): New function. (init_ssa_operands): Rename occurences of vdef to v_may_def. Also add code to initialize build_v_must_defs. (finalize_ssa_vdefs): Replace with... (finalize_ssa_v_may_defs): This. (finalize_ssa_vuses): Rename occurences of vdef to v_may_def. (finalize_ssa_v_must_defs): New function. (finalize_ssa_stmt_operands): Replace call to finalize_ssa_vdefs with calls to finalize_ssa_v_may_defs and finalize_ssa_v_must_defs. (verify_start_operands): Rename occurences of vdef to v_may_def. Also add check for build_v_must_defs. (get_stmt_operands): Rename occurences of vdef to v_may_def. Also add code to handle V_MUST_DEFs and to use opf_kill_def for killing definitions. (get_expr_operands): Update comment and use opf_kill_def for killing definitions. (add_stmt_operand): Replace code that appends VDEFs with code that appends V_MUST_DEFs when opf_kill_def is set and V_MAY_DEFs otherwise. (add_call_clobber_ops): Update comments. * tree-ssa-operands.h (vdef_optype_d): Replace with... (v_may_def_optype_d): This. (v_must_def_optype_d): New structure. (VDEF_OPS): Replace with... (V_MAY_DEF_OPS): This. (STMT_VDEF_OPS): Same with... (STMT_V_MAY_DEF_OPS): This. (NUM_VDEFS): And... (NUM_V_MAY_DEFS): This. (VDEF_RESULT_PTR): As well as... (V_MAY_DEF_RESULT_PTR): This. (VDEF_RESULT): Same goes for... (V_MAY_DEF_RESULT): This. (VDEF_OP_PTR): And... (V_MAY_DEF_OP_PTR): This. (VDEF_OP): And... (V_MAY_DEF_OP): This. (V_MUST_DEF_OPS): New macro. (STMT_V_MUST_DEF_OPS): Ditto. (NUM_V_MUST_DEFS): Ditto. (V_MUST_DEF_OP_PTR): Ditto. (V_MUST_DEF_OP): Ditto. (remove_vdefs): Replace signature with... (remove_v_may_defs): This. (remove_v_must_defs): New function signature. * tree-ssa-pre.c (subst_phis): Replace call to remove_vdefs with calls to remove_v_may_defs and remove_v_must_defs. (process_left_occs_and_kills): Rename occurences of vdef to v_may_def. Also add code that marks left occurences of operands in V_MUST_DEFs. * tree-tailcall.c (find_tail_calls): Rename occurences of vdef to v_may_def. Also add check for V_MUST_DEFs. (eliminate_tail_call):Rename occurences of vdef to v_may_def. testsuite: * gcc.dg/tree-ssa/20031015-1.c: Scan for V_MAY_DEF instead of VDEF. * gcc.dg/tree-ssa/20040517-1.c: Ditto. From-SVN: r82947
Diffstat (limited to 'gcc/tree-ssa-dse.c')
-rw-r--r--gcc/tree-ssa-dse.c67
1 files changed, 34 insertions, 33 deletions
diff --git a/gcc/tree-ssa-dse.c b/gcc/tree-ssa-dse.c
index fca08ac..88ca136 100644
--- a/gcc/tree-ssa-dse.c
+++ b/gcc/tree-ssa-dse.c
@@ -95,7 +95,7 @@ static void dse_optimize_stmt (struct dom_walk_data *,
static void dse_record_phis (struct dom_walk_data *, basic_block);
static void dse_finalize_block (struct dom_walk_data *, basic_block);
static void fix_phi_uses (tree, tree);
-static void fix_stmt_vdefs (tree, tree);
+static void fix_stmt_v_may_defs (tree, tree);
static void record_voperand_set (bitmap, bitmap *, unsigned int);
/* Function indicating whether we ought to include information for 'var'
@@ -109,70 +109,71 @@ need_imm_uses_for (tree var)
}
-/* Replace uses in PHI which match VDEF_RESULTs in STMT with the
- corresponding VDEF_OP in STMT. */
+/* Replace uses in PHI which match V_MAY_DEF_RESULTs in STMT with the
+ corresponding V_MAY_DEF_OP in STMT. */
static void
fix_phi_uses (tree phi, tree stmt)
{
stmt_ann_t ann = stmt_ann (stmt);
- vdef_optype vdefs;
+ v_may_def_optype v_may_defs;
unsigned int i;
int j;
get_stmt_operands (stmt);
- vdefs = VDEF_OPS (ann);
+ v_may_defs = V_MAY_DEF_OPS (ann);
- /* Walk each VDEF in STMT. */
- for (i = 0; i < NUM_VDEFS (vdefs); i++)
+ /* Walk each V_MAY_DEF in STMT. */
+ for (i = 0; i < NUM_V_MAY_DEFS (v_may_defs); i++)
{
- tree vdef = VDEF_RESULT (vdefs, i);
+ tree v_may_def = V_MAY_DEF_RESULT (v_may_defs, i);
- /* Find any uses in the PHI which match VDEF and replace
- them with the appropriate VDEF_OP. */
+ /* Find any uses in the PHI which match V_MAY_DEF and replace
+ them with the appropriate V_MAY_DEF_OP. */
for (j = 0; j < PHI_NUM_ARGS (phi); j++)
- if (vdef == PHI_ARG_DEF (phi, j))
- PHI_ARG_DEF (phi, j) = VDEF_OP (vdefs, i);
+ if (v_may_def == PHI_ARG_DEF (phi, j))
+ PHI_ARG_DEF (phi, j) = V_MAY_DEF_OP (v_may_defs, i);
}
}
-/* Replace the VDEF_OPs in STMT1 which match VDEF_RESULTs in STMT2 with
- the appropriate VDEF_OPs from STMT2. */
+/* Replace the V_MAY_DEF_OPs in STMT1 which match V_MAY_DEF_RESULTs
+ in STMT2 with the appropriate V_MAY_DEF_OPs from STMT2. */
static void
-fix_stmt_vdefs (tree stmt1, tree stmt2)
+fix_stmt_v_may_defs (tree stmt1, tree stmt2)
{
stmt_ann_t ann1 = stmt_ann (stmt1);
stmt_ann_t ann2 = stmt_ann (stmt2);
- vdef_optype vdefs1;
- vdef_optype vdefs2;
+ v_may_def_optype v_may_defs1;
+ v_may_def_optype v_may_defs2;
unsigned int i, j;
get_stmt_operands (stmt1);
get_stmt_operands (stmt2);
- vdefs1 = VDEF_OPS (ann1);
- vdefs2 = VDEF_OPS (ann2);
+ v_may_defs1 = V_MAY_DEF_OPS (ann1);
+ v_may_defs2 = V_MAY_DEF_OPS (ann2);
- /* Walk each VDEF_OP in stmt1. */
- for (i = 0; i < NUM_VDEFS (vdefs1); i++)
+ /* Walk each V_MAY_DEF_OP in stmt1. */
+ for (i = 0; i < NUM_V_MAY_DEFS (v_may_defs1); i++)
{
- tree vdef1 = VDEF_OP (vdefs1, i);
+ tree v_may_def1 = V_MAY_DEF_OP (v_may_defs1, i);
- /* Find the appropriate VDEF_RESULT in STMT2. */
- for (j = 0; j < NUM_VDEFS (vdefs2); j++)
+ /* Find the appropriate V_MAY_DEF_RESULT in STMT2. */
+ for (j = 0; j < NUM_V_MAY_DEFS (v_may_defs2); j++)
{
- if (vdef1 == VDEF_RESULT (vdefs2, j))
+ if (v_may_def1 == V_MAY_DEF_RESULT (v_may_defs2, j))
{
/* Update. */
- *VDEF_OP_PTR (vdefs1, i) = VDEF_OP (vdefs2, j);
+ *V_MAY_DEF_OP_PTR (v_may_defs1, i) =
+ V_MAY_DEF_OP (v_may_defs2, j);
break;
}
}
#ifdef ENABLE_CHECKING
- /* If we did not find a corresponding VDEF_RESULT, then something
+ /* If we did not find a corresponding V_MAY_DEF_RESULT, then something
has gone terribly wrong. */
- if (j == NUM_VDEFS (vdefs2))
+ if (j == NUM_V_MAY_DEFS (v_may_defs2))
abort ();
#endif
@@ -234,14 +235,14 @@ dse_optimize_stmt (struct dom_walk_data *walk_data,
struct dse_global_data *dse_gd = walk_data->global_data;
tree stmt = bsi_stmt (bsi);
stmt_ann_t ann = stmt_ann (stmt);
- vdef_optype vdefs;
+ v_may_def_optype v_may_defs;
get_stmt_operands (stmt);
- vdefs = VDEF_OPS (ann);
+ v_may_defs = V_MAY_DEF_OPS (ann);
/* If this statement has no virtual uses, then there is nothing
to do. */
- if (NUM_VDEFS (vdefs) == 0)
+ if (NUM_V_MAY_DEFS (v_may_defs) == 0)
return;
/* We know we have virtual definitions. If this is a MODIFY_EXPR, then
@@ -269,7 +270,7 @@ dse_optimize_stmt (struct dom_walk_data *walk_data,
represents the only use of this store.
Note this does not handle the case where the store has
- multiple VDEFs which all reach a set of PHI nodes in the
+ multiple V_MAY_DEFs which all reach a set of PHI nodes in the
same block. */
while (num_uses == 1
&& TREE_CODE (use) == PHI_NODE
@@ -300,7 +301,7 @@ dse_optimize_stmt (struct dom_walk_data *walk_data,
if (skipped_phi)
fix_phi_uses (skipped_phi, stmt);
else
- fix_stmt_vdefs (use, stmt);
+ fix_stmt_v_may_defs (use, stmt);
if (dump_file && (dump_flags & TDF_DETAILS))
{