This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
patch: [mem-ssa] remove V_MUST_DEFs
- From: Aldy Hernandez <aldyh at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org, dnovillo at redhat dot com
- Date: Fri, 17 Mar 2006 16:35:42 -0400
- Subject: patch: [mem-ssa] remove V_MUST_DEFs
Here is a patch to remove the V_MUST_DEFs and related machinery, as
discussed.
Bootstrapped and regtested on x86_64-linux. I have also run nullstone
before and after to make sure there were no regressions.
There is one regression: gcc.dg/tree-ssa/complex-4.c in which DCE fails
to remove the original store clearing the complex variable. Diego looked
at it, and suggested we fix DSE (not DCE) instead. I will do so in a
followup patch.
I will also be renaming V_MAY_DEF/etc to VDEF/etc in a subsequent patch.
Diego has approved this for the mem-ssa branch. Committing.
Aldy
* testsuite/gcc.dg/tree-ssa/20040517-1.c: Expect 2 V_MAY_DEFs.
* testsuite/gcc.dg/tree-ssa/pr26421.c: Same.
* tree-ssa-operands.c: Remove build_v_must_defs.
(init_ssa_operands): Delete build_v_must_defs.
(finalize_ssa_v_must_def_ops): Remove.
(finalize_ssa_v_must_defs): Remove.
(finalize_ssa_stmt_operands): Do not call
finalize_ssa_v_must_defs.
(start_ssa_stmt_operands): Do not check build_v_must_defs.
(append_v_must_def): Delete.
(copy_virtual_operands): Do not copy V_MUST_DEFs.
(get_modify_expr_operands): Remove reference to V_MUST_DEF from
comment. Remove opf_kill_def.
(build_ssa_operands): Remove references to v_must_defs.
(copy_virtual_operands): Same.
(copy_virtual_operands): Same.
(fini_ssa_operands): Same.
(free_ssa_operands): Same.
(add_mustdef_op): Remove.
Remove mustdef_optype_p.
(alloc_mustdef): Remove.
Remove references to V_MUST_DEFs in comment at top of file.
(get_expr_operands): Remove opf_kill_def.
(opf_kill_def): Remove.
(add_virtual_operand): Remove opf_kill_def.
(get_indirect_ref_operands): Same.
(get_tmr_operands): Same.
* tree-vectorizer.c (rename_variables_in_bb): Remove
SSA_OP_ALL_KILLS.
* tree-ssa-loop-manip.c (find_uses_to_rename_stmt): Remove
SSA_OP_ALL_KILLS.
(check_loop_closed_ssa_stmt): Same.
* tree-ssa.c (verify_def): Remove V_MUST_DEF from comment.
(verify_use): Same.
(verify_ssa): Remove V_MUST_DEFs traces.
(verify_ssa): Remove SSA_OP_ALL_KILLS.
* tree-into-ssa.c (mark_def_sites): Change SSA_OP_VMUSTDEF to
SSA_OP_VMAYDEF.
(rewrite_update_stmt): Remove SSA_OP_VIRTUAL_KILLS.
(rewrite_stmt): Remove SSA_OP_ALL_KILLS.
* tree-ssa-operands.h (struct stmt_operands_d): Remove V_MUST_DEF
references.
(MUSTDEF_OPS): Remove.
(SSA_OP_VMUSTDEF): Remove.
(FOR_EACH_SSA_MUSTDEF_OPERAND): Remove.
(struct mustdef_optype_d): Remove.
Remove mustdef_optype_p.
(struct stmt_operands_d): Remove mustdef_ops.
(ssa_operand_iterator_d): Remove mustdefs and mustkills.
(SSA_OP_VIRTUAL_DEFS): Remove SSA_OP_VMUSTDEF.
(MUSTDEF_RESULT_PTR): Remove.
(MUSTDEF_RESULT): Remove.
(MUSTDEF_KILL_PTR): Remove.
(MUSTDEF_KILL): Remove.
(MUSTDEF_NUM): Remove.
(MUSTDEF_VECT): Remove.
(SSA_OP_VIRTUAL_KILLS): Remove.
(SSA_OP_ALL_VIRTUALS): Remove SSA_OP_VIRTUAL_KILLS.
(SSA_OP_VMUSTKILL): Remove.
(SSA_OP_ALL_KILLS): Remove.
(SSA_OP_ALL_OPERANDS): Remove SSA_OP_ALL_KILLS.
* tree-flow-inline.h (op_iter_init_def): Remove
SSA_OP_VIRTUAL_KILLS.
(delink_stmt_imm_use): Remove SSA_OP_ALL_KILLS.
* tree-ssa-pre.c (compute_rvuse_and_antic_safe): Remove
SSA_OP_VIRTUAL_KILLS.
* tree-ssa-loop-im.c (determine_max_movement): Remove
SSA_OP_VIRTUAL_KILLS.
(gather_mem_refs_stmt): Same.
(gather_mem_refs_stmt): Same.
* tree-ssa-dce.c (mark_really_necessary_kill_operand_phis): Delete.
(perform_tree_ssa_dce): Remove call to
mark_really_necessary_kill_operand_phis.
* tree-flow-inline.h (op_iter_init): Remove setting of mustdefs
and mustkills.
(op_iter_next_use): Do not check mustkills.
(op_iter_next_def): Do not check mustdefs.
(op_iter_next_tree): Do not check mustkills or mustdefs.
(clear_and_done_ssa_iter): Do not set mustdefs or mustkills.
(op_iter_next_maymustdef): Do not check mustkills.
(op_iter_init_must_and_may_def): Remove SSA_OP_VMUSTKILL.
(op_iter_init_mustdef): Remove.
* tree-ssa-live.c (create_ssa_var_map): Change SSA_OP_VMUSTDEF to
SSA_OP_VMAYDEF.
* tree-ssa-dse.c (dse_optimize_stmt): Remove SSA_OP_VMUSTDEF.
* tree-ssa-ccp.c: Remove V_MUST_DEF traces from comments.
(visit_assignment): Same.
* tree-ssa-copy.c (copy_prop_visit_assignment): Same.
* tree-sra.c (mark_all_v_defs_1): Remove V_MUST_DEF from comment.
* tree-outof-ssa.c (check_replaceable): Remove SSA_OP_VMUSTDEF.
* tree-pretty-print.c (dump_vops): Remove printing of V_MUST_DEF.
Remove kill_p variable.
* tree-dfa.c (struct dfa_stats_d): Remove num_v_must_defs.
(dump_dfa_stats): Remove code related to V_MUST_DEFs.
(collect_dfa_stats_r): Do not set num_v_must_defs.
(mark_new_vars_to_rename): Remove v_must_defs_{before,after}
code.
* tree-into-ssa.c (mark_def_sites): Change SSA_OP_VMUSTKILL to
SSA_OP_VMAYUSE.
* tree-ssa-pre.c (compute_rvuse_and_antic_safe): Remove
SSA_OP_VMUSTDEF and SSA_OP_VMUSTKILL.
* tree-ssa-propagate.c (stmt_makes_single_store): Remove
SSA_OP_VMUSTDEF.
Index: testsuite/gcc.dg/tree-ssa/20040517-1.c
===================================================================
--- testsuite/gcc.dg/tree-ssa/20040517-1.c (revision 112059)
+++ testsuite/gcc.dg/tree-ssa/20040517-1.c (working copy)
@@ -17,5 +17,5 @@ void bar (void)
malloc functions may clobber global memory. Only the function result
does not alias any other pointer.
Hence, we must have a VDEF for a before and after the call to foo(). */
-/* { dg-final { scan-tree-dump-times "V_MAY_DEF" 1 "alias1"} } */
+/* { dg-final { scan-tree-dump-times "V_MAY_DEF" 2 "alias1"} } */
/* { dg-final { cleanup-tree-dump "alias1" } } */
Index: testsuite/gcc.dg/tree-ssa/pr26421.c
===================================================================
--- testsuite/gcc.dg/tree-ssa/pr26421.c (revision 112059)
+++ testsuite/gcc.dg/tree-ssa/pr26421.c (working copy)
@@ -16,5 +16,5 @@ int foo(void)
return a.i;
}
-/* { dg-final { scan-tree-dump-times "V_MAY_DEF" 1 "alias1" } } */
+/* { dg-final { scan-tree-dump-times "V_MAY_DEF" 2 "alias1" } } */
/* { dg-final { cleanup-tree-dump "alias1" } } */
Index: tree-ssa-operands.c
===================================================================
--- tree-ssa-operands.c (revision 112059)
+++ tree-ssa-operands.c (working copy)
@@ -53,16 +53,15 @@ Boston, MA 02110-1301, USA. */
The operand tree is the parsed by the various get_* routines which look
through the stmt tree for the occurrence of operands which may be of
interest, and calls are made to the append_* routines whenever one is
- found. There are 5 of these routines, each representing one of the
- 5 types of operands. Defs, Uses, Virtual Uses, Virtual May Defs, and
- Virtual Must Defs.
+ found. There are 4 of these routines, each representing one of the
+ 4 types of operands. Defs, Uses, Virtual Uses, and Virtual May Defs.
The append_* routines check for duplication, and simply keep a list of
unique objects for each operand type in the build_* extendable vectors.
Once the stmt tree is completely parsed, the finalize_ssa_operands()
routine is called, which proceeds to perform the finalization routine
- on each of the 5 operand vectors which have been built up.
+ on each of the 4 operand vectors which have been built up.
If the stmt had a previous operand cache, the finalization routines
attempt to match up the new operands with the old ones. If it's a perfect
@@ -85,9 +84,6 @@ Boston, MA 02110-1301, USA. */
call-clobbered variable. */
#define opf_is_def (1 << 0)
-/* Operand is the target of an assignment expression. */
-#define opf_kill_def (1 << 1)
-
/* No virtual operands should be created in the expression. This is used
when traversing ADDR_EXPR nodes which have different semantics than
other expressions. Inside an ADDR_EXPR node, the only operands that we
@@ -113,9 +109,6 @@ static VEC(tree,heap) *build_v_may_defs;
/* Array for building all the VUSE operands. */
static VEC(tree,heap) *build_vuses;
-/* Array for building all the V_MUST_DEF operands. */
-static VEC(tree,heap) *build_v_must_defs;
-
/* These arrays are the cached operand vectors for call clobbered calls. */
static bool ops_active = false;
@@ -128,7 +121,6 @@ static def_optype_p free_defs = NULL;
static use_optype_p free_uses = NULL;
static vuse_optype_p free_vuses = NULL;
static maydef_optype_p free_maydefs = NULL;
-static mustdef_optype_p free_mustdefs = NULL;
/* Return the DECL_UID of the base variable of T. */
@@ -241,7 +233,6 @@ init_ssa_operands (void)
build_uses = VEC_alloc (tree, heap, 10);
build_vuses = VEC_alloc (tree, heap, 25);
build_v_may_defs = VEC_alloc (tree, heap, 25);
- build_v_must_defs = VEC_alloc (tree, heap, 25);
gcc_assert (operand_memory == NULL);
operand_memory_index = SSA_OPERAND_MEMORY_SIZE;
@@ -258,14 +249,12 @@ fini_ssa_operands (void)
struct ssa_operand_memory_d *ptr;
VEC_free (tree, heap, build_defs);
VEC_free (tree, heap, build_uses);
- VEC_free (tree, heap, build_v_must_defs);
VEC_free (tree, heap, build_v_may_defs);
VEC_free (tree, heap, build_vuses);
free_defs = NULL;
free_uses = NULL;
free_vuses = NULL;
free_maydefs = NULL;
- free_mustdefs = NULL;
while ((ptr = operand_memory) != NULL)
{
operand_memory = operand_memory->next;
@@ -386,27 +375,6 @@ alloc_vuse (int num)
return ret;
}
-
-
-
-
-static inline struct mustdef_optype_d *
-alloc_mustdef (void)
-{
- struct mustdef_optype_d *ret;
- if (free_mustdefs)
- {
- ret = free_mustdefs;
- free_mustdefs = free_mustdefs->next;
- }
- else
- ret = (struct mustdef_optype_d *)ssa_operand_alloc (sizeof (struct mustdef_optype_d));
- VUSE_VECT_NUM_ELEM (ret->usev) = 1;
- return ret;
-}
-
-
-
/* Make sure PTR is in the correct immediate use list. Since uses are simply
pointers into the stmt TREE, there is no way of telling if anyone has
changed what this pointer points to via TREE_OPERANDS (exp, 0) = <...>.
@@ -570,22 +538,6 @@ add_maydef_op (tree stmt, tree op, int n
return new;
}
-/* Adds OP to the list of mustdefs of statement STMT after LAST, and moves
- LAST to the new element. */
-
-static inline mustdef_optype_p
-add_mustdef_op (tree stmt, tree op, mustdef_optype_p *last)
-{
- mustdef_optype_p new;
-
- new = alloc_mustdef ();
- MUSTDEF_RESULT (new) = op;
- MUSTDEF_KILL (new) = op;
- INITIALIZE_USE (MUSTDEF_KILL_PTR (new), &MUSTDEF_KILL (new), stmt);
- APPEND_OP_AFTER (new, *last);
- return new;
-}
-
struct maydef_optype_d *
realloc_maydef (struct maydef_optype_d *ptr, int num_elem)
@@ -1141,93 +1093,6 @@ finalize_ssa_vuses (tree stmt)
}
-/* Takes elements from build_v_must_defs and turns them into mustdef operands of
- STMT. */
-
-static inline void
-finalize_ssa_v_must_def_ops (tree stmt)
-{
- unsigned new_i;
- struct mustdef_optype_d new_list;
- mustdef_optype_p old_ops, ptr, last;
- tree act;
- unsigned old_base, new_base;
-
- new_list.next = NULL;
- last = &new_list;
-
- old_ops = MUSTDEF_OPS (stmt);
-
- new_i = 0;
- while (old_ops && new_i < VEC_length (tree, build_v_must_defs))
- {
- act = VEC_index (tree, build_v_must_defs, new_i);
- new_base = get_name_decl (act);
- old_base = get_name_decl (MUSTDEF_KILL (old_ops));
-
- if (old_base == new_base)
- {
- /* If variables are the same, reuse this node. */
- MOVE_HEAD_AFTER (old_ops, last);
- set_virtual_use_link (MUSTDEF_KILL_PTR (last), stmt);
- new_i++;
- }
- else if (old_base < new_base)
- {
- /* If old is less than new, old goes to the free list. */
- delink_imm_use (MUSTDEF_KILL_PTR (old_ops));
- MOVE_HEAD_TO_FREELIST (old_ops, mustdef);
- }
- else
- {
- /* This is a new operand. */
- add_mustdef_op (stmt, act, &last);
- new_i++;
- }
- }
-
- /* If there is anything remaining in the build_v_must_defs list, simply emit it. */
- for ( ; new_i < VEC_length (tree, build_v_must_defs); new_i++)
- add_mustdef_op (stmt, VEC_index (tree, build_v_must_defs, new_i), &last);
-
- last->next = NULL;
-
- /* If there is anything in the old list, free it. */
- if (old_ops)
- {
- for (ptr = old_ops; ptr; ptr = ptr->next)
- delink_imm_use (MUSTDEF_KILL_PTR (ptr));
- old_ops->next = free_mustdefs;
- free_mustdefs = old_ops;
- }
-
- /* Now set the stmt's operands. */
- MUSTDEF_OPS (stmt) = new_list.next;
-
-#ifdef ENABLE_CHECKING
- {
- unsigned x = 0;
- for (ptr = MUSTDEF_OPS (stmt); ptr; ptr = ptr->next)
- x++;
-
- gcc_assert (x == VEC_length (tree, build_v_must_defs));
- }
-#endif
-}
-
-static void
-finalize_ssa_v_must_defs (tree stmt)
-{
- /* In the presence of subvars, there may be more than one V_MUST_DEF
- per statement (one for each subvar). It is a bit expensive to
- verify that all must-defs in a statement belong to subvars if
- there is more than one must-def, so we don't do it. Suffice to
- say, if you reach here without having subvars, and have num >1,
- you have hit a bug. */
- finalize_ssa_v_must_def_ops (stmt);
- VEC_truncate (tree, build_v_must_defs, 0);
-}
-
/* Finalize all the build vectors, fill the new ones into INFO. */
@@ -1236,7 +1101,6 @@ finalize_ssa_stmt_operands (tree stmt)
{
finalize_ssa_defs (stmt);
finalize_ssa_uses (stmt);
- finalize_ssa_v_must_defs (stmt);
finalize_ssa_v_may_defs (stmt);
finalize_ssa_vuses (stmt);
}
@@ -1251,7 +1115,6 @@ start_ssa_stmt_operands (void)
gcc_assert (VEC_length (tree, build_uses) == 0);
gcc_assert (VEC_length (tree, build_vuses) == 0);
gcc_assert (VEC_length (tree, build_v_may_defs) == 0);
- gcc_assert (VEC_length (tree, build_v_must_defs) == 0);
}
@@ -1311,22 +1174,6 @@ append_vuse (tree var)
}
-/* Add VAR to the list of virtual must definitions for INFO. */
-
-static inline void
-append_v_must_def (tree var)
-{
- unsigned i;
-
- /* Don't allow duplicate entries. */
- for (i = 0; i < VEC_length (tree, build_v_must_defs); i++)
- if (var == VEC_index (tree, build_v_must_defs, i))
- return;
-
- VEC_safe_push (tree, heap, build_v_must_defs, (tree)var);
-}
-
-
/* REF is a tree that contains the entire pointer dereference
expression, if available, or NULL otherwise. ALIAS is the variable
we are asking if REF can access. OFFSET and SIZE come from the
@@ -1495,7 +1342,7 @@ add_virtual_operand (tree var, stmt_ann_
at runtime, then the program is ill formed. If the statement is
not executed then all is well. At the very least, we cannot ICE. */
if ((flags & opf_non_specific) && unmodifiable_var_p (var))
- flags &= ~(opf_is_def | opf_kill_def);
+ flags &= ~opf_is_def;
/* The variable is not a GIMPLE register. Add it (or its aliases) to
virtual operands, unless the caller has specifically requested
@@ -1509,22 +1356,7 @@ add_virtual_operand (tree var, stmt_ann_
{
/* The variable is not aliased or it is an alias tag. */
if (flags & opf_is_def)
- {
- if (flags & opf_kill_def)
- {
- /* V_MUST_DEF for non-aliased, non-GIMPLE register
- variable definitions. */
- gcc_assert (!MTAG_P (var)
- || TREE_CODE (var) == STRUCT_FIELD_TAG);
- append_v_must_def (var);
- }
- else
- {
- /* Add a V_MAY_DEF for call-clobbered variables and
- memory tags. */
- append_v_may_def (var);
- }
- }
+ append_v_may_def (var);
else
append_vuse (var);
}
@@ -1669,9 +1501,6 @@ get_indirect_ref_operands (tree stmt, tr
tree ptr = *pptr;
stmt_ann_t s_ann = stmt_ann (stmt);
- /* Stores into INDIRECT_REF operands are never killing definitions. */
- flags &= ~opf_kill_def;
-
if (SSA_VAR_P (ptr))
{
struct ptr_info_def *pi = NULL;
@@ -1750,9 +1579,6 @@ get_tmr_operands (tree stmt, tree expr,
get_expr_operands (stmt, &TMR_BASE (expr), opf_none);
get_expr_operands (stmt, &TMR_INDEX (expr), opf_none);
- /* MEM_REFs should never be killing. */
- flags &= ~opf_kill_def;
-
if (TMR_SYMBOL (expr))
{
stmt_ann_t ann = stmt_ann (stmt);
@@ -1779,12 +1605,7 @@ get_tmr_operands (tree stmt, tree expr,
{
bool exact;
if (overlap_subvar (offset, maxsize, sv->var, &exact))
- {
- int subvar_flags = flags;
- if (!exact || size != maxsize)
- subvar_flags &= ~opf_kill_def;
- add_stmt_operand (&sv->var, s_ann, subvar_flags);
- }
+ add_stmt_operand (&sv->var, s_ann, flags);
}
}
@@ -2072,19 +1893,17 @@ get_modify_expr_operands (tree stmt, tre
get_expr_operands (stmt, &TREE_OPERAND (expr, 1), opf_none);
/* For the LHS, use a regular definition (OPF_IS_DEF) for GIMPLE
- registers. If the LHS is a store to memory, we will either need
- a preserving definition (V_MAY_DEF) or a killing definition
- (V_MUST_DEF).
+ registers. If the LHS is a store to memory, we will need
+ a preserving definition (V_MAY_DEF).
Preserving definitions are those that modify a part of an
aggregate object for which no subvars have been computed (or the
reference does not correspond exactly to one of them). Stores
through a pointer are also represented with V_MAY_DEF operators.
- The determination of whether to use a preserving or a killing
- definition is done while scanning the LHS of the assignment. By
- default, assume that we will emit a V_MUST_DEF. */
- get_expr_operands (stmt, &TREE_OPERAND (expr, 0), opf_is_def|opf_kill_def);
+ We used to distinguish between preserving and killing definitions.
+ We always emit preserving definitions now. */
+ get_expr_operands (stmt, &TREE_OPERAND (expr, 0), opf_is_def);
}
@@ -2199,11 +2018,8 @@ get_expr_operands (tree stmt, tree *expr
if (overlap_subvar (offset, maxsize, sv->var, &exact))
{
- int subvar_flags = flags;
none = false;
- if (!exact || size != maxsize)
- subvar_flags &= ~opf_kill_def;
- add_stmt_operand (&sv->var, s_ann, subvar_flags);
+ add_stmt_operand (&sv->var, s_ann, flags);
}
}
@@ -2220,8 +2036,7 @@ get_expr_operands (tree stmt, tree *expr
/* Even if we found subvars above we need to ensure to see
immediate uses for d in s.a[d]. In case of s.a having
a subvar or we would miss it otherwise. */
- get_expr_operands (stmt, &TREE_OPERAND (expr, 0),
- flags & ~opf_kill_def);
+ get_expr_operands (stmt, &TREE_OPERAND (expr, 0), flags);
if (code == COMPONENT_REF)
{
@@ -2277,11 +2092,6 @@ get_expr_operands (tree stmt, tree *expr
}
case BIT_FIELD_REF:
- /* Stores using BIT_FIELD_REF are always preserving definitions. */
- flags &= ~opf_kill_def;
-
- /* Fallthru */
-
case TRUTH_NOT_EXPR:
case VIEW_CONVERT_EXPR:
do_unary:
@@ -2423,7 +2233,6 @@ build_ssa_operands (tree stmt)
parse_ssa_operands (stmt);
operand_build_sort_virtual (build_vuses);
operand_build_sort_virtual (build_v_may_defs);
- operand_build_sort_virtual (build_v_must_defs);
finalize_ssa_stmt_operands (stmt);
}
@@ -2437,7 +2246,6 @@ free_ssa_operands (stmt_operands_p ops)
ops->def_ops = NULL;
ops->use_ops = NULL;
ops->maydef_ops = NULL;
- ops->mustdef_ops = NULL;
ops->vuse_ops = NULL;
}
@@ -2478,7 +2286,7 @@ copy_virtual_operands (tree dest, tree s
{
tree t;
ssa_op_iter iter, old_iter;
- use_operand_p use_p, u2;
+ use_operand_p use_p;
vuse_vec_p u3, u4;
def_operand_p def_p, d2;
@@ -2489,16 +2297,12 @@ copy_virtual_operands (tree dest, tree s
append_vuse (t);
FOR_EACH_SSA_TREE_OPERAND (t, src, iter, SSA_OP_VMAYDEF)
append_v_may_def (t);
- FOR_EACH_SSA_TREE_OPERAND (t, src, iter, SSA_OP_VMUSTDEF)
- append_v_must_def (t);
if (VEC_length (tree, build_vuses) == 0
- && VEC_length (tree, build_v_may_defs) == 0
- && VEC_length (tree, build_v_must_defs) == 0)
+ && VEC_length (tree, build_v_may_defs) == 0)
return;
/* Now commit the virtual operands to this stmt. */
- finalize_ssa_v_must_defs (dest);
finalize_ssa_v_may_defs (dest);
finalize_ssa_vuses (dest);
@@ -2524,22 +2328,6 @@ copy_virtual_operands (tree dest, tree s
}
gcc_assert (op_iter_done (&old_iter));
- op_iter_init_mustdef (&old_iter, src, &u2, &d2);
- u3 = NULL;
- FOR_EACH_SSA_MUSTDEF_OPERAND (def_p, use_p, dest, iter)
- {
- if (u3 != NULL)
- {
- gcc_assert (VUSE_VECT_NUM_ELEM (*u3) == 1);
- u2 = VUSE_ELEMENT_PTR (*u3, 0);
- }
- gcc_assert (!op_iter_done (&old_iter));
- SET_USE (use_p, USE_FROM_PTR (u2));
- SET_DEF (def_p, DEF_FROM_PTR (d2));
- op_iter_next_maymustdef (&u3, &d2, &old_iter);
- }
- gcc_assert (op_iter_done (&old_iter));
-
}
@@ -2586,14 +2374,11 @@ create_ssa_artficial_load_stmt (tree new
/* Remove any virtual operands that were found. */
VEC_truncate (tree, build_v_may_defs, 0);
- VEC_truncate (tree, build_v_must_defs, 0);
VEC_truncate (tree, build_vuses, 0);
/* For each VDEF on the original statement, we want to create a
- VUSE of the V_MAY_DEF result or V_MUST_DEF op on the new
- statement. */
- FOR_EACH_SSA_TREE_OPERAND (op, old_stmt, iter,
- (SSA_OP_VMAYDEF | SSA_OP_VMUSTDEF))
+ VUSE of the V_MAY_DEF result on the new statement. */
+ FOR_EACH_SSA_TREE_OPERAND (op, old_stmt, iter, SSA_OP_VMAYDEF)
append_vuse (op);
/* Now build the operands for this new stmt. */
Index: tree-vectorizer.c
===================================================================
--- tree-vectorizer.c (revision 112059)
+++ tree-vectorizer.c (working copy)
@@ -230,8 +230,7 @@ rename_variables_in_bb (basic_block bb)
for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
{
stmt = bsi_stmt (bsi);
- FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter,
- (SSA_OP_ALL_USES | SSA_OP_ALL_KILLS))
+ FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, SSA_OP_ALL_USES)
rename_use_op (use_p);
}
Index: tree-ssa-loop-manip.c
===================================================================
--- tree-ssa-loop-manip.c (revision 112059)
+++ tree-ssa-loop-manip.c (working copy)
@@ -263,7 +263,7 @@ find_uses_to_rename_stmt (tree stmt, bit
tree var;
basic_block bb = bb_for_stmt (stmt);
- FOR_EACH_SSA_TREE_OPERAND (var, stmt, iter, SSA_OP_ALL_USES | SSA_OP_ALL_KILLS)
+ FOR_EACH_SSA_TREE_OPERAND (var, stmt, iter, SSA_OP_ALL_USES)
find_uses_to_rename_use (bb, var, use_blocks, need_phis);
}
@@ -407,7 +407,7 @@ check_loop_closed_ssa_stmt (basic_block
ssa_op_iter iter;
tree var;
- FOR_EACH_SSA_TREE_OPERAND (var, stmt, iter, SSA_OP_ALL_USES | SSA_OP_ALL_KILLS)
+ FOR_EACH_SSA_TREE_OPERAND (var, stmt, iter, SSA_OP_ALL_USES)
check_loop_closed_ssa_use (bb, var);
}
Index: tree-ssa.c
===================================================================
--- tree-ssa.c (revision 112059)
+++ tree-ssa.c (working copy)
@@ -156,8 +156,7 @@ verify_ssa_name (tree ssa_name, bool is_
it means that the block in that array slot contains the
definition of SSA_NAME.
- IS_VIRTUAL is true if SSA_NAME is created by a V_MAY_DEF or a
- V_MUST_DEF. */
+ IS_VIRTUAL is true if SSA_NAME is created by a V_MAY_DEF. */
static bool
verify_def (basic_block bb, basic_block *definition_block, tree ssa_name,
@@ -208,8 +207,7 @@ err:
is flowing through an abnormal edge (only used when checking PHI
arguments).
- IS_VIRTUAL is true if SSA_NAME is created by a V_MAY_DEF or a
- V_MUST_DEF.
+ IS_VIRTUAL is true if SSA_NAME is created by a V_MAY_DEF.
If NAMES_DEFINED_IN_BB is not NULL, it contains a bitmap of ssa names
that are defined before STMT in basic block BB. */
@@ -719,17 +717,16 @@ verify_ssa (bool check_modified_stmt)
if (base_address
&& SSA_VAR_P (base_address)
- && ZERO_SSA_OPERANDS (stmt, SSA_OP_VMAYDEF|SSA_OP_VMUSTDEF))
+ && ZERO_SSA_OPERANDS (stmt, SSA_OP_VMAYDEF))
{
error ("statement makes a memory store, but has no "
- "V_MAY_DEFS nor V_MUST_DEFS");
+ "V_MAY_DEFS");
print_generic_stmt (stderr, stmt, TDF_VOPS);
goto err;
}
}
- FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter,
- SSA_OP_ALL_USES | SSA_OP_ALL_KILLS)
+ FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, SSA_OP_ALL_USES)
{
op = USE_FROM_PTR (use_p);
if (verify_use (bb, definition_block[SSA_NAME_VERSION (op)],
Index: tree-into-ssa.c
===================================================================
--- tree-into-ssa.c (revision 112059)
+++ tree-into-ssa.c (working copy)
@@ -648,7 +648,7 @@ mark_def_sites (struct dom_walk_data *wa
/* If a variable is used before being set, then the variable is live
across a block boundary, so mark it live-on-entry to BB. */
FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter,
- SSA_OP_USE | SSA_OP_VUSE | SSA_OP_VMUSTKILL)
+ SSA_OP_USE | SSA_OP_VUSE | SSA_OP_VMAYUSE)
{
tree sym = USE_FROM_PTR (use_p);
gcc_assert (DECL_P (sym));
@@ -675,8 +675,8 @@ mark_def_sites (struct dom_walk_data *wa
REWRITE_THIS_STMT (stmt) = 1;
}
- /* Now process the defs and must-defs made by this statement. */
- FOR_EACH_SSA_TREE_OPERAND (def, stmt, iter, SSA_OP_DEF | SSA_OP_VMUSTDEF)
+ /* Now process the defs and vdefs made by this statement. */
+ FOR_EACH_SSA_TREE_OPERAND (def, stmt, iter, SSA_OP_DEF | SSA_OP_VMAYDEF)
{
gcc_assert (DECL_P (def));
set_def_block (def, bb, false);
@@ -1039,8 +1039,7 @@ rewrite_stmt (struct dom_walk_data *walk
/* Step 1. Rewrite USES and VUSES in the statement. */
if (REWRITE_THIS_STMT (stmt))
- FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter,
- SSA_OP_ALL_USES|SSA_OP_ALL_KILLS)
+ FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, SSA_OP_ALL_USES)
{
tree var = USE_FROM_PTR (use_p);
gcc_assert (DECL_P (var));
@@ -1470,8 +1469,7 @@ rewrite_update_stmt (struct dom_walk_dat
maybe_replace_use (use_p);
if (need_to_update_vops_p)
- FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter,
- SSA_OP_VIRTUAL_USES | SSA_OP_VIRTUAL_KILLS)
+ FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, SSA_OP_VIRTUAL_USES)
maybe_replace_use (use_p);
}
Index: tree-ssa-operands.h
===================================================================
--- tree-ssa-operands.h (revision 112059)
+++ tree-ssa-operands.h (working copy)
@@ -103,15 +103,6 @@ struct vuse_optype_d
};
typedef struct vuse_optype_d *vuse_optype_p;
-/* This represents the V_MUST_DEFS for a stmt. */
-struct mustdef_optype_d
-{
- struct mustdef_optype_d *next;
- tree def_var;
- vuse_vec_t usev;
-};
-typedef struct mustdef_optype_d *mustdef_optype_p;
-
#define SSA_OPERAND_MEMORY_SIZE (2048 - sizeof (void *))
@@ -129,10 +120,9 @@ struct stmt_operands_d
struct def_optype_d * def_ops;
struct use_optype_d * use_ops;
- /* Virtual operands (V_MAY_DEF, VUSE, and V_MUST_DEF). */
+ /* Virtual operands (V_MAY_DEF, VUSE). */
struct maydef_optype_d * maydef_ops;
struct vuse_optype_d * vuse_ops;
- struct mustdef_optype_d * mustdef_ops;
};
typedef struct stmt_operands_d *stmt_operands_p;
@@ -148,7 +138,6 @@ typedef struct stmt_operands_d *stmt_ope
#define USE_OPS(STMT) (stmt_ann (STMT)->operands.use_ops)
#define VUSE_OPS(STMT) (stmt_ann (STMT)->operands.vuse_ops)
#define MAYDEF_OPS(STMT) (stmt_ann (STMT)->operands.maydef_ops)
-#define MUSTDEF_OPS(STMT) (stmt_ann (STMT)->operands.mustdef_ops)
#define USE_OP_PTR(OP) (&((OP)->use_ptr))
#define USE_OP(OP) (USE_FROM_PTR (USE_OP_PTR (OP)))
@@ -168,13 +157,6 @@ typedef struct stmt_operands_d *stmt_ope
#define MAYDEF_NUM(OP) VUSE_VECT_NUM_ELEM ((OP)->usev)
#define MAYDEF_VECT(OP) &((OP)->usev)
-#define MUSTDEF_RESULT_PTR(OP) (&((OP)->def_var))
-#define MUSTDEF_RESULT(OP) ((OP)->def_var)
-#define MUSTDEF_KILL_PTR(OP) VUSE_OP_PTR (OP, 0)
-#define MUSTDEF_KILL(OP) VUSE_OP (OP, 0)
-#define MUSTDEF_NUM(OP) VUSE_VECT_NUM_ELEM ((OP)->usev)
-#define MUSTDEF_VECT(OP) &((OP)->usev)
-
#define PHI_RESULT_PTR(PHI) get_phi_result_ptr (PHI)
#define PHI_RESULT(PHI) DEF_FROM_PTR (PHI_RESULT_PTR (PHI))
#define SET_PHI_RESULT(PHI, V) SET_DEF (PHI_RESULT_PTR (PHI), (V))
@@ -230,8 +212,6 @@ typedef struct ssa_operand_iterator_d
vuse_optype_p vuses;
maydef_optype_p maydefs;
maydef_optype_p mayuses;
- mustdef_optype_p mustdefs;
- mustdef_optype_p mustkills;
enum ssa_op_iter_type iter_type;
int phi_i;
int num_phi;
@@ -248,20 +228,14 @@ typedef struct ssa_operand_iterator_d
#define SSA_OP_VUSE 0x04 /* VUSE operands. */
#define SSA_OP_VMAYUSE 0x08 /* USE portion of V_MAY_DEFS. */
#define SSA_OP_VMAYDEF 0x10 /* DEF portion of V_MAY_DEFS. */
-#define SSA_OP_VMUSTDEF 0x20 /* V_MUST_DEF definitions. */
-#define SSA_OP_VMUSTKILL 0x40 /* V_MUST_DEF kills. */
/* These are commonly grouped operand flags. */
#define SSA_OP_VIRTUAL_USES (SSA_OP_VUSE | SSA_OP_VMAYUSE)
-#define SSA_OP_VIRTUAL_DEFS (SSA_OP_VMAYDEF | SSA_OP_VMUSTDEF)
-#define SSA_OP_VIRTUAL_KILLS (SSA_OP_VMUSTKILL)
-#define SSA_OP_ALL_VIRTUALS (SSA_OP_VIRTUAL_USES | SSA_OP_VIRTUAL_KILLS \
- | SSA_OP_VIRTUAL_DEFS)
+#define SSA_OP_VIRTUAL_DEFS (SSA_OP_VMAYDEF)
+#define SSA_OP_ALL_VIRTUALS (SSA_OP_VIRTUAL_USES | SSA_OP_VIRTUAL_DEFS)
#define SSA_OP_ALL_USES (SSA_OP_VIRTUAL_USES | SSA_OP_USE)
#define SSA_OP_ALL_DEFS (SSA_OP_VIRTUAL_DEFS | SSA_OP_DEF)
-#define SSA_OP_ALL_KILLS (SSA_OP_VIRTUAL_KILLS)
-#define SSA_OP_ALL_OPERANDS (SSA_OP_ALL_USES | SSA_OP_ALL_DEFS \
- | SSA_OP_ALL_KILLS)
+#define SSA_OP_ALL_OPERANDS (SSA_OP_ALL_USES | SSA_OP_ALL_DEFS)
/* This macro executes a loop over the operands of STMT specified in FLAG,
returning each operand as a 'tree' in the variable TREEVAR. ITER is an
@@ -295,14 +269,6 @@ typedef struct ssa_operand_iterator_d
!op_iter_done (&(ITER)); \
op_iter_next_maymustdef (&(USEVAR), &(DEFVAR), &(ITER)))
-/* This macro executes a loop over the V_MUST_DEF operands of STMT. The def
- and kill for each V_MUST_DEF is returned in DEFVAR and KILLVAR.
- ITER is an ssa_op_iter structure used to control the loop. */
-#define FOR_EACH_SSA_MUSTDEF_OPERAND(DEFVAR, KILLVAR, STMT, ITER) \
- for (op_iter_init_mustdef (&(ITER), STMT, &(KILLVAR), &(DEFVAR)); \
- !op_iter_done (&(ITER)); \
- op_iter_next_mustdef (&(KILLVAR), &(DEFVAR), &(ITER)))
-
/* This macro executes a loop over the V_{MUST,MAY}_DEF of STMT. The def
and kill for each V_{MUST,MAY}_DEF is returned in DEFVAR and KILLVAR.
ITER is an ssa_op_iter structure used to control the loop. */
Index: tree-flow-inline.h
===================================================================
--- tree-flow-inline.h (revision 112059)
+++ tree-flow-inline.h (working copy)
@@ -914,12 +914,6 @@ op_iter_next_use (ssa_op_iter *ptr)
}
return use_p;
}
- if (ptr->mustkills)
- {
- use_p = MUSTDEF_KILL_PTR (ptr->mustkills);
- ptr->mustkills = ptr->mustkills->next;
- return use_p;
- }
if (ptr->phi_i < ptr->num_phi)
{
return PHI_ARG_DEF_PTR (ptr->phi_stmt, (ptr->phi_i)++);
@@ -942,12 +936,6 @@ op_iter_next_def (ssa_op_iter *ptr)
ptr->defs = ptr->defs->next;
return def_p;
}
- if (ptr->mustdefs)
- {
- def_p = MUSTDEF_RESULT_PTR (ptr->mustdefs);
- ptr->mustdefs = ptr->mustdefs->next;
- return def_p;
- }
if (ptr->maydefs)
{
def_p = MAYDEF_RESULT_PTR (ptr->maydefs);
@@ -992,24 +980,12 @@ op_iter_next_tree (ssa_op_iter *ptr)
}
return val;
}
- if (ptr->mustkills)
- {
- val = MUSTDEF_KILL (ptr->mustkills);
- ptr->mustkills = ptr->mustkills->next;
- return val;
- }
if (ptr->defs)
{
val = DEF_OP (ptr->defs);
ptr->defs = ptr->defs->next;
return val;
}
- if (ptr->mustdefs)
- {
- val = MUSTDEF_RESULT (ptr->mustdefs);
- ptr->mustdefs = ptr->mustdefs->next;
- return val;
- }
if (ptr->maydefs)
{
val = MAYDEF_RESULT (ptr->maydefs);
@@ -1035,8 +1011,6 @@ clear_and_done_ssa_iter (ssa_op_iter *pt
ptr->vuses = NULL;
ptr->maydefs = NULL;
ptr->mayuses = NULL;
- ptr->mustdefs = NULL;
- ptr->mustkills = NULL;
ptr->iter_type = ssa_op_iter_none;
ptr->phi_i = 0;
ptr->num_phi = 0;
@@ -1059,8 +1033,6 @@ op_iter_init (ssa_op_iter *ptr, tree stm
ptr->vuses = (flags & SSA_OP_VUSE) ? VUSE_OPS (stmt) : NULL;
ptr->maydefs = (flags & SSA_OP_VMAYDEF) ? MAYDEF_OPS (stmt) : NULL;
ptr->mayuses = (flags & SSA_OP_VMAYUSE) ? MAYDEF_OPS (stmt) : NULL;
- ptr->mustdefs = (flags & SSA_OP_VMUSTDEF) ? MUSTDEF_OPS (stmt) : NULL;
- ptr->mustkills = (flags & SSA_OP_VMUSTKILL) ? MUSTDEF_OPS (stmt) : NULL;
ptr->done = false;
ptr->phi_i = 0;
@@ -1086,7 +1058,7 @@ op_iter_init_use (ssa_op_iter *ptr, tree
static inline def_operand_p
op_iter_init_def (ssa_op_iter *ptr, tree stmt, int flags)
{
- gcc_assert ((flags & (SSA_OP_ALL_USES | SSA_OP_VIRTUAL_KILLS)) == 0);
+ gcc_assert ((flags & SSA_OP_ALL_USES) == 0);
op_iter_init (ptr, stmt, flags);
ptr->iter_type = ssa_op_iter_def;
return op_iter_next_def (ptr);
@@ -1119,14 +1091,6 @@ op_iter_next_maymustdef (vuse_vec_p *use
return;
}
- if (ptr->mustkills)
- {
- *def = MUSTDEF_RESULT_PTR (ptr->mustkills);
- *use = MUSTDEF_VECT (ptr->mustkills);
- ptr->mustkills = ptr->mustkills->next;
- return;
- }
-
*def = NULL_DEF_OPERAND_P;
*use = NULL;
ptr->done = true;
@@ -1166,33 +1130,12 @@ op_iter_init_maydef (ssa_op_iter *ptr, t
/* Initialize iterator PTR to the operands in STMT. Return the first operands
in KILL and DEF. */
static inline void
-op_iter_init_mustdef (ssa_op_iter *ptr, tree stmt, use_operand_p *kill,
- def_operand_p *def)
-{
- vuse_vec_p vp;
- gcc_assert (TREE_CODE (stmt) != PHI_NODE);
-
- op_iter_init (ptr, stmt, SSA_OP_VMUSTKILL);
- ptr->iter_type = ssa_op_iter_maymustdef;
- op_iter_next_maymustdef (&vp, def, ptr);
- if (vp != NULL)
- {
- gcc_assert (VUSE_VECT_NUM_ELEM (*vp) == 1);
- *kill = VUSE_ELEMENT_PTR (*vp, 0);
- }
- else
- *kill = NULL_USE_OPERAND_P;
-}
-
-/* Initialize iterator PTR to the operands in STMT. Return the first operands
- in KILL and DEF. */
-static inline void
op_iter_init_must_and_may_def (ssa_op_iter *ptr, tree stmt,
vuse_vec_p *kill, def_operand_p *def)
{
gcc_assert (TREE_CODE (stmt) != PHI_NODE);
- op_iter_init (ptr, stmt, SSA_OP_VMUSTKILL|SSA_OP_VMAYUSE);
+ op_iter_init (ptr, stmt, SSA_OP_VMAYUSE);
ptr->iter_type = ssa_op_iter_maymustdef;
op_iter_next_maymustdef (kill, def, ptr);
}
@@ -1287,8 +1230,7 @@ delink_stmt_imm_use (tree stmt)
use_operand_p use_p;
if (ssa_operands_active ())
- FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter,
- (SSA_OP_ALL_USES | SSA_OP_ALL_KILLS))
+ FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, SSA_OP_ALL_USES)
delink_imm_use (use_p);
}
Index: tree-ssa-pre.c
===================================================================
--- tree-ssa-pre.c (revision 112059)
+++ tree-ssa-pre.c (working copy)
@@ -1916,15 +1916,13 @@ compute_rvuse_and_antic_safe (void)
tree stmt = bsi_stmt (bsi);
if (first_store_uid[bb->index] == 0
- && !ZERO_SSA_OPERANDS (stmt, SSA_OP_VMAYUSE | SSA_OP_VMAYDEF
- | SSA_OP_VMUSTDEF | SSA_OP_VMUSTKILL))
+ && !ZERO_SSA_OPERANDS (stmt, SSA_OP_VMAYUSE | SSA_OP_VMAYDEF))
{
first_store_uid[bb->index] = stmt_ann (stmt)->uid;
}
- FOR_EACH_SSA_USE_OPERAND (usep, stmt, iter, SSA_OP_VIRTUAL_KILLS
- | SSA_OP_VMAYUSE)
+ FOR_EACH_SSA_USE_OPERAND (usep, stmt, iter, SSA_OP_VMAYUSE)
{
tree use = USE_FROM_PTR (usep);
bitmap repbit = get_representative (vuse_names,
Index: tree-ssa-loop-im.c
===================================================================
--- tree-ssa-loop-im.c (revision 112059)
+++ tree-ssa-loop-im.c (working copy)
@@ -496,7 +496,7 @@ determine_max_movement (tree stmt, bool
if (!add_dependency (val, lim_data, loop, true))
return false;
- FOR_EACH_SSA_TREE_OPERAND (val, stmt, iter, SSA_OP_VIRTUAL_USES | SSA_OP_VIRTUAL_KILLS)
+ FOR_EACH_SSA_TREE_OPERAND (val, stmt, iter, SSA_OP_VIRTUAL_USES)
if (!add_dependency (val, lim_data, loop, false))
return false;
@@ -1270,15 +1270,13 @@ gather_mem_refs_stmt (struct loop *loop,
}
ref->is_stored |= is_stored;
- FOR_EACH_SSA_TREE_OPERAND (vname, stmt, oi,
- SSA_OP_VIRTUAL_USES | SSA_OP_VIRTUAL_KILLS)
+ FOR_EACH_SSA_TREE_OPERAND (vname, stmt, oi, SSA_OP_VIRTUAL_USES)
bitmap_set_bit (ref->vops, DECL_UID (SSA_NAME_VAR (vname)));
record_mem_ref_loc (&ref->locs, stmt, mem);
return;
fail:
- FOR_EACH_SSA_TREE_OPERAND (vname, stmt, oi,
- SSA_OP_VIRTUAL_USES | SSA_OP_VIRTUAL_KILLS)
+ FOR_EACH_SSA_TREE_OPERAND (vname, stmt, oi, SSA_OP_VIRTUAL_USES)
bitmap_set_bit (clobbered_vops, DECL_UID (SSA_NAME_VAR (vname)));
}
Index: tree-ssa-dce.c
===================================================================
--- tree-ssa-dce.c (revision 112059)
+++ tree-ssa-dce.c (working copy)
@@ -554,72 +554,6 @@ propagate_necessity (struct edge_list *e
}
}
}
-
-
-/* Propagate necessity around virtual phi nodes used in kill operands.
- The reason this isn't done during propagate_necessity is because we don't
- want to keep phis around that are just there for must-defs, unless we
- absolutely have to. After we've rewritten the reaching definitions to be
- correct in the previous part of the fixup routine, we can simply propagate
- around the information about which of these virtual phi nodes are really
- used, and set the NECESSARY flag accordingly.
- Note that we do the minimum here to ensure that we keep alive the phis that
- are actually used in the corrected SSA form. In particular, some of these
- phis may now have all of the same operand, and will be deleted by some
- other pass. */
-
-static void
-mark_really_necessary_kill_operand_phis (void)
-{
- basic_block bb;
- int i;
-
- /* Seed the worklist with the new virtual phi arguments and virtual
- uses */
- FOR_EACH_BB (bb)
- {
- block_stmt_iterator bsi;
- tree phi;
-
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
- {
- if (!is_gimple_reg (PHI_RESULT (phi)) && NECESSARY (phi))
- {
- for (i = 0; i < PHI_NUM_ARGS (phi); i++)
- mark_operand_necessary (PHI_ARG_DEF (phi, i), true);
- }
- }
-
- for (bsi = bsi_last (bb); !bsi_end_p (bsi); bsi_prev (&bsi))
- {
- tree stmt = bsi_stmt (bsi);
-
- if (NECESSARY (stmt))
- {
- use_operand_p use_p;
- ssa_op_iter iter;
- FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter,
- SSA_OP_VIRTUAL_USES | SSA_OP_VIRTUAL_KILLS)
- {
- tree use = USE_FROM_PTR (use_p);
- mark_operand_necessary (use, true);
- }
- }
- }
- }
-
- /* Mark all virtual phis still in use as necessary, and all of their
- arguments that are phis as necessary. */
- while (VEC_length (tree, worklist) > 0)
- {
- tree use = VEC_pop (tree, worklist);
-
- for (i = 0; i < PHI_NUM_ARGS (use); i++)
- mark_operand_necessary (PHI_ARG_DEF (use, i), true);
- }
-}
-
-
/* Eliminate unnecessary statements. Any instruction not marked as necessary
@@ -904,7 +838,6 @@ perform_tree_ssa_dce (bool aggressive)
propagate_necessity (el);
- mark_really_necessary_kill_operand_phis ();
eliminate_unnecessary_stmts ();
if (aggressive)
Index: tree-flow-inline.h
===================================================================
--- tree-flow-inline.h (revision 112059)
+++ tree-flow-inline.h (working copy)
@@ -914,12 +914,6 @@ op_iter_next_use (ssa_op_iter *ptr)
}
return use_p;
}
- if (ptr->mustkills)
- {
- use_p = MUSTDEF_KILL_PTR (ptr->mustkills);
- ptr->mustkills = ptr->mustkills->next;
- return use_p;
- }
if (ptr->phi_i < ptr->num_phi)
{
return PHI_ARG_DEF_PTR (ptr->phi_stmt, (ptr->phi_i)++);
@@ -942,12 +936,6 @@ op_iter_next_def (ssa_op_iter *ptr)
ptr->defs = ptr->defs->next;
return def_p;
}
- if (ptr->mustdefs)
- {
- def_p = MUSTDEF_RESULT_PTR (ptr->mustdefs);
- ptr->mustdefs = ptr->mustdefs->next;
- return def_p;
- }
if (ptr->maydefs)
{
def_p = MAYDEF_RESULT_PTR (ptr->maydefs);
@@ -992,24 +980,12 @@ op_iter_next_tree (ssa_op_iter *ptr)
}
return val;
}
- if (ptr->mustkills)
- {
- val = MUSTDEF_KILL (ptr->mustkills);
- ptr->mustkills = ptr->mustkills->next;
- return val;
- }
if (ptr->defs)
{
val = DEF_OP (ptr->defs);
ptr->defs = ptr->defs->next;
return val;
}
- if (ptr->mustdefs)
- {
- val = MUSTDEF_RESULT (ptr->mustdefs);
- ptr->mustdefs = ptr->mustdefs->next;
- return val;
- }
if (ptr->maydefs)
{
val = MAYDEF_RESULT (ptr->maydefs);
@@ -1035,8 +1011,6 @@ clear_and_done_ssa_iter (ssa_op_iter *pt
ptr->vuses = NULL;
ptr->maydefs = NULL;
ptr->mayuses = NULL;
- ptr->mustdefs = NULL;
- ptr->mustkills = NULL;
ptr->iter_type = ssa_op_iter_none;
ptr->phi_i = 0;
ptr->num_phi = 0;
@@ -1059,8 +1033,6 @@ op_iter_init (ssa_op_iter *ptr, tree stm
ptr->vuses = (flags & SSA_OP_VUSE) ? VUSE_OPS (stmt) : NULL;
ptr->maydefs = (flags & SSA_OP_VMAYDEF) ? MAYDEF_OPS (stmt) : NULL;
ptr->mayuses = (flags & SSA_OP_VMAYUSE) ? MAYDEF_OPS (stmt) : NULL;
- ptr->mustdefs = (flags & SSA_OP_VMUSTDEF) ? MUSTDEF_OPS (stmt) : NULL;
- ptr->mustkills = (flags & SSA_OP_VMUSTKILL) ? MUSTDEF_OPS (stmt) : NULL;
ptr->done = false;
ptr->phi_i = 0;
@@ -1086,7 +1058,7 @@ op_iter_init_use (ssa_op_iter *ptr, tree
static inline def_operand_p
op_iter_init_def (ssa_op_iter *ptr, tree stmt, int flags)
{
- gcc_assert ((flags & (SSA_OP_ALL_USES | SSA_OP_VIRTUAL_KILLS)) == 0);
+ gcc_assert ((flags & SSA_OP_ALL_USES) == 0);
op_iter_init (ptr, stmt, flags);
ptr->iter_type = ssa_op_iter_def;
return op_iter_next_def (ptr);
@@ -1119,14 +1091,6 @@ op_iter_next_maymustdef (vuse_vec_p *use
return;
}
- if (ptr->mustkills)
- {
- *def = MUSTDEF_RESULT_PTR (ptr->mustkills);
- *use = MUSTDEF_VECT (ptr->mustkills);
- ptr->mustkills = ptr->mustkills->next;
- return;
- }
-
*def = NULL_DEF_OPERAND_P;
*use = NULL;
ptr->done = true;
@@ -1166,33 +1130,12 @@ op_iter_init_maydef (ssa_op_iter *ptr, t
/* Initialize iterator PTR to the operands in STMT. Return the first operands
in KILL and DEF. */
static inline void
-op_iter_init_mustdef (ssa_op_iter *ptr, tree stmt, use_operand_p *kill,
- def_operand_p *def)
-{
- vuse_vec_p vp;
- gcc_assert (TREE_CODE (stmt) != PHI_NODE);
-
- op_iter_init (ptr, stmt, SSA_OP_VMUSTKILL);
- ptr->iter_type = ssa_op_iter_maymustdef;
- op_iter_next_maymustdef (&vp, def, ptr);
- if (vp != NULL)
- {
- gcc_assert (VUSE_VECT_NUM_ELEM (*vp) == 1);
- *kill = VUSE_ELEMENT_PTR (*vp, 0);
- }
- else
- *kill = NULL_USE_OPERAND_P;
-}
-
-/* Initialize iterator PTR to the operands in STMT. Return the first operands
- in KILL and DEF. */
-static inline void
op_iter_init_must_and_may_def (ssa_op_iter *ptr, tree stmt,
vuse_vec_p *kill, def_operand_p *def)
{
gcc_assert (TREE_CODE (stmt) != PHI_NODE);
- op_iter_init (ptr, stmt, SSA_OP_VMUSTKILL|SSA_OP_VMAYUSE);
+ op_iter_init (ptr, stmt, SSA_OP_VMAYUSE);
ptr->iter_type = ssa_op_iter_maymustdef;
op_iter_next_maymustdef (kill, def, ptr);
}
@@ -1287,8 +1230,7 @@ delink_stmt_imm_use (tree stmt)
use_operand_p use_p;
if (ssa_operands_active ())
- FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter,
- (SSA_OP_ALL_USES | SSA_OP_ALL_KILLS))
+ FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, SSA_OP_ALL_USES)
delink_imm_use (use_p);
}
Index: tree-ssa-live.c
===================================================================
--- tree-ssa-live.c (revision 112059)
+++ tree-ssa-live.c (working copy)
@@ -472,7 +472,7 @@ create_ssa_var_map (int flags)
#ifdef ENABLE_CHECKING
/* Validate that virtual ops don't get used in funny ways. */
FOR_EACH_SSA_TREE_OPERAND (use, stmt, iter,
- SSA_OP_VIRTUAL_USES | SSA_OP_VMUSTDEF)
+ SSA_OP_VIRTUAL_USES | SSA_OP_VMAYDEF)
{
bitmap_set_bit (used_in_virtual_ops,
DECL_UID (SSA_NAME_VAR (use)));
Index: tree-ssa-dse.c
===================================================================
--- tree-ssa-dse.c (revision 112059)
+++ tree-ssa-dse.c (working copy)
@@ -234,7 +234,7 @@ dse_optimize_stmt (struct dom_walk_data
/* If this statement has no virtual defs, then there is nothing
to do. */
- if (ZERO_SSA_OPERANDS (stmt, (SSA_OP_VMAYDEF|SSA_OP_VMUSTDEF)))
+ if (ZERO_SSA_OPERANDS (stmt, SSA_OP_VMAYDEF))
return;
/* We know we have virtual definitions. If this is a MODIFY_EXPR that's
Index: tree-ssa-ccp.c
===================================================================
--- tree-ssa-ccp.c (revision 112059)
+++ tree-ssa-ccp.c (working copy)
@@ -127,11 +127,10 @@ Software Foundation, 51 Franklin Street,
We should be able to deduce that the predicate 'a.a != B' is always
false. To achieve this, we associate constant values to the SSA
- names in the V_MAY_DEF and V_MUST_DEF operands for each store.
- Additionally, since we also glob partial loads/stores with the base
- symbol, we also keep track of the memory reference where the
- constant value was stored (in the MEM_REF field of PROP_VALUE_T).
- For instance,
+ names in the V_MAY_DEF operands for each store. Additionally,
+ since we also glob partial loads/stores with the base symbol, we
+ also keep track of the memory reference where the constant value
+ was stored (in the MEM_REF field of PROP_VALUE_T). For instance,
# a_5 = V_MAY_DEF <a_4>
a.a = 2;
@@ -224,9 +223,9 @@ typedef enum
/* Array of propagated constant values. After propagation,
CONST_VAL[I].VALUE holds the constant value for SSA_NAME(I). If
the constant is held in an SSA name representing a memory store
- (i.e., a V_MAY_DEF or V_MUST_DEF), CONST_VAL[I].MEM_REF will
- contain the actual memory reference used to store (i.e., the LHS of
- the assignment doing the store). */
+ (i.e., a V_MAY_DEF), CONST_VAL[I].MEM_REF will contain the actual
+ memory reference used to store (i.e., the LHS of the assignment
+ doing the store). */
static prop_value_t *const_val;
/* True if we are also propagating constants in stores and loads. */
@@ -1249,9 +1248,9 @@ visit_assignment (tree stmt, tree *outpu
}
else if (do_store_ccp && stmt_makes_single_store (stmt))
{
- /* Otherwise, set the names in V_MAY_DEF/V_MUST_DEF operands
- to the new constant value and mark the LHS as the memory
- reference associated with VAL. */
+ /* Otherwise, set the names in V_MAY_DEF operands to the new
+ constant value and mark the LHS as the memory reference
+ associated with VAL. */
ssa_op_iter i;
tree vdef;
bool changed;
Index: tree-ssa-copy.c
===================================================================
--- tree-ssa-copy.c (revision 112059)
+++ tree-ssa-copy.c (working copy)
@@ -572,8 +572,8 @@ copy_prop_visit_assignment (tree stmt, t
}
else if (stmt_makes_single_store (stmt))
{
- /* Otherwise, set the names in V_MAY_DEF/V_MUST_DEF operands
- to be a copy of RHS. */
+ /* Otherwise, set the names in V_MAY_DEF operands to be a copy
+ of RHS. */
ssa_op_iter i;
tree vdef;
bool changed;
Index: tree-sra.c
===================================================================
--- tree-sra.c (revision 112059)
+++ tree-sra.c (working copy)
@@ -1448,7 +1448,7 @@ decide_instantiations (void)
/* Phase Four: Update the function to match the replacements created. */
-/* Mark all the variables in V_MAY_DEF or V_MUST_DEF operands for STMT for
+/* Mark all the variables in V_MAY_DEF operands for STMT for
renaming. This becomes necessary when we modify all of a non-scalar. */
static void
Index: tree-outof-ssa.c
===================================================================
--- tree-outof-ssa.c (revision 112059)
+++ tree-outof-ssa.c (working copy)
@@ -1571,8 +1571,8 @@ check_replaceable (temp_expr_table_p tab
if (version_ref_count (map, def) != 1)
return false;
- /* There must be no V_MAY_DEFS or V_MUST_DEFS. */
- if (!(ZERO_SSA_OPERANDS (stmt, (SSA_OP_VMAYDEF | SSA_OP_VMUSTDEF))))
+ /* There must be no VDEFs. */
+ if (!(ZERO_SSA_OPERANDS (stmt, SSA_OP_VMAYDEF)))
return false;
/* Float expressions must go through memory if float-store is on. */
Index: tree-pretty-print.c
===================================================================
--- tree-pretty-print.c (revision 112059)
+++ tree-pretty-print.c (working copy)
@@ -2571,7 +2571,6 @@ dump_vops (pretty_printer *buffer, tree
tree use;
use_operand_p use_p;
def_operand_p def_p;
- use_operand_p kill_p;
ssa_op_iter iter;
vuse_vec_p vv;
@@ -2592,18 +2591,6 @@ dump_vops (pretty_printer *buffer, tree
newline_and_indent (buffer, spc);
}
- FOR_EACH_SSA_MUSTDEF_OPERAND (def_p, kill_p, stmt, iter)
- {
- pp_string (buffer, "# ");
- dump_generic_node (buffer, DEF_FROM_PTR (def_p),
- spc + 2, flags, false);
- pp_string (buffer, " = V_MUST_DEF <");
- dump_generic_node (buffer, USE_FROM_PTR (kill_p),
- spc + 2, flags, false);
- pp_string (buffer, ">;");
- newline_and_indent (buffer, spc);
- }
-
FOR_EACH_SSA_TREE_OPERAND (use, stmt, iter, SSA_OP_VUSE)
{
pp_string (buffer, "# VUSE <");
Index: tree-dfa.c
===================================================================
--- tree-dfa.c (revision 112059)
+++ tree-dfa.c (working copy)
@@ -61,7 +61,6 @@ struct dfa_stats_d
int max_num_phi_args;
long num_v_may_defs;
long num_vuses;
- long num_v_must_defs;
};
@@ -483,11 +482,6 @@ dump_dfa_stats (FILE *file)
fprintf (file, fmt_str_1, "V_MAY_DEF operands", dfa_stats.num_v_may_defs,
SCALE (size), LABEL (size));
- size = dfa_stats.num_v_must_defs * sizeof (tree *);
- total += size;
- fprintf (file, fmt_str_1, "V_MUST_DEF operands", dfa_stats.num_v_must_defs,
- SCALE (size), LABEL (size));
-
size = dfa_stats.num_phis * sizeof (struct tree_phi_node);
total += size;
fprintf (file, fmt_str_1, "PHI nodes", dfa_stats.num_phis,
@@ -582,8 +576,6 @@ collect_dfa_stats_r (tree *tp, int *walk
dfa_stats_p->num_uses += NUM_SSA_OPERANDS (t, SSA_OP_USE);
dfa_stats_p->num_v_may_defs += NUM_SSA_OPERANDS (t, SSA_OP_VMAYDEF);
dfa_stats_p->num_vuses += NUM_SSA_OPERANDS (t, SSA_OP_VUSE);
- dfa_stats_p->num_v_must_defs +=
- NUM_SSA_OPERANDS (t, SSA_OP_VMUSTDEF);
break;
}
@@ -802,7 +794,6 @@ mark_new_vars_to_rename (tree stmt)
bitmap vars_in_vops_to_rename;
bool found_exposed_symbol = false;
int v_may_defs_before, v_may_defs_after;
- int v_must_defs_before, v_must_defs_after;
if (TREE_CODE (stmt) == PHI_NODE)
return;
@@ -820,10 +811,9 @@ mark_new_vars_to_rename (tree stmt)
rename them if there are not any newly exposed symbols in the
statement operands. */
v_may_defs_before = NUM_SSA_OPERANDS (stmt, SSA_OP_VMAYDEF);
- v_must_defs_before = NUM_SSA_OPERANDS (stmt, SSA_OP_VMUSTDEF);
FOR_EACH_SSA_TREE_OPERAND (val, stmt, iter,
- SSA_OP_VMAYDEF | SSA_OP_VUSE | SSA_OP_VMUSTDEF)
+ SSA_OP_VMAYDEF | SSA_OP_VUSE)
{
if (!DECL_P (val))
val = SSA_NAME_VAR (val);
@@ -835,7 +825,6 @@ mark_new_vars_to_rename (tree stmt)
update_stmt (stmt);
v_may_defs_after = NUM_SSA_OPERANDS (stmt, SSA_OP_VMAYDEF);
- v_must_defs_after = NUM_SSA_OPERANDS (stmt, SSA_OP_VMUSTDEF);
FOR_EACH_SSA_TREE_OPERAND (val, stmt, iter, SSA_OP_ALL_OPERANDS)
if (DECL_P (val))
@@ -850,8 +839,7 @@ mark_new_vars_to_rename (tree stmt)
vanishing VDEFs because in those cases, the names that were formerly
generated by this statement are not going to be available anymore. */
if (found_exposed_symbol
- || v_may_defs_before > v_may_defs_after
- || v_must_defs_before > v_must_defs_after)
+ || v_may_defs_before > v_may_defs_after)
mark_set_for_renaming (vars_in_vops_to_rename);
BITMAP_FREE (vars_in_vops_to_rename);
Index: tree-into-ssa.c
===================================================================
--- tree-into-ssa.c (revision 112059)
+++ tree-into-ssa.c (working copy)
@@ -648,7 +648,7 @@ mark_def_sites (struct dom_walk_data *wa
/* If a variable is used before being set, then the variable is live
across a block boundary, so mark it live-on-entry to BB. */
FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter,
- SSA_OP_USE | SSA_OP_VUSE | SSA_OP_VMUSTKILL)
+ SSA_OP_USE | SSA_OP_VUSE | SSA_OP_VMAYUSE)
{
tree sym = USE_FROM_PTR (use_p);
gcc_assert (DECL_P (sym));
@@ -675,8 +675,8 @@ mark_def_sites (struct dom_walk_data *wa
REWRITE_THIS_STMT (stmt) = 1;
}
- /* Now process the defs and must-defs made by this statement. */
- FOR_EACH_SSA_TREE_OPERAND (def, stmt, iter, SSA_OP_DEF | SSA_OP_VMUSTDEF)
+ /* Now process the defs and vdefs made by this statement. */
+ FOR_EACH_SSA_TREE_OPERAND (def, stmt, iter, SSA_OP_DEF | SSA_OP_VMAYDEF)
{
gcc_assert (DECL_P (def));
set_def_block (def, bb, false);
@@ -1039,8 +1039,7 @@ rewrite_stmt (struct dom_walk_data *walk
/* Step 1. Rewrite USES and VUSES in the statement. */
if (REWRITE_THIS_STMT (stmt))
- FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter,
- SSA_OP_ALL_USES|SSA_OP_ALL_KILLS)
+ FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, SSA_OP_ALL_USES)
{
tree var = USE_FROM_PTR (use_p);
gcc_assert (DECL_P (var));
@@ -1470,8 +1469,7 @@ rewrite_update_stmt (struct dom_walk_dat
maybe_replace_use (use_p);
if (need_to_update_vops_p)
- FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter,
- SSA_OP_VIRTUAL_USES | SSA_OP_VIRTUAL_KILLS)
+ FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, SSA_OP_VIRTUAL_USES)
maybe_replace_use (use_p);
}
Index: tree-ssa-pre.c
===================================================================
--- tree-ssa-pre.c (revision 112059)
+++ tree-ssa-pre.c (working copy)
@@ -1916,15 +1916,13 @@ compute_rvuse_and_antic_safe (void)
tree stmt = bsi_stmt (bsi);
if (first_store_uid[bb->index] == 0
- && !ZERO_SSA_OPERANDS (stmt, SSA_OP_VMAYUSE | SSA_OP_VMAYDEF
- | SSA_OP_VMUSTDEF | SSA_OP_VMUSTKILL))
+ && !ZERO_SSA_OPERANDS (stmt, SSA_OP_VMAYUSE | SSA_OP_VMAYDEF))
{
first_store_uid[bb->index] = stmt_ann (stmt)->uid;
}
- FOR_EACH_SSA_USE_OPERAND (usep, stmt, iter, SSA_OP_VIRTUAL_KILLS
- | SSA_OP_VMAYUSE)
+ FOR_EACH_SSA_USE_OPERAND (usep, stmt, iter, SSA_OP_VMAYUSE)
{
tree use = USE_FROM_PTR (usep);
bitmap repbit = get_representative (vuse_names,
Index: tree-ssa-propagate.c
===================================================================
--- tree-ssa-propagate.c (revision 112059)
+++ tree-ssa-propagate.c (working copy)
@@ -687,7 +687,7 @@ ssa_propagate (ssa_prop_visit_stmt_fn vi
}
-/* Return the first V_MAY_DEF or V_MUST_DEF operand for STMT. */
+/* Return the first V_MAY_DEF operand for STMT. */
tree
first_vdef (tree stmt)
@@ -741,7 +741,7 @@ stmt_makes_single_store (tree stmt)
if (TREE_CODE (stmt) != MODIFY_EXPR)
return false;
- if (ZERO_SSA_OPERANDS (stmt, SSA_OP_VMAYDEF|SSA_OP_VMUSTDEF))
+ if (ZERO_SSA_OPERANDS (stmt, SSA_OP_VMAYDEF))
return false;
lhs = TREE_OPERAND (stmt, 0);