summaryrefslogtreecommitdiffstats
path: root/gcc/tree-ssa-operands.c
diff options
context:
space:
mode:
authordberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4>2004-10-27 17:45:21 +0000
committerdberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4>2004-10-27 17:45:21 +0000
commit1bd13ef117738b816e270e9fd9e3d475d92eb4f3 (patch)
tree36b6b5291cd04acd1807e64b366402dc565251b6 /gcc/tree-ssa-operands.c
parent746852fec1b23f14c601c2456929ff05f2ff6668 (diff)
downloadppe42-gcc-1bd13ef117738b816e270e9fd9e3d475d92eb4f3.tar.gz
ppe42-gcc-1bd13ef117738b816e270e9fd9e3d475d92eb4f3.zip
2004-10-27 Daniel Berlin <dberlin@dberlin.org>
Fix PR tree-optimization/17133 * tree-cfg.c (rewrite_to_new_ssa_names_bb): Also rewrite must def kill operand. * tree-flow-inline.h: V_MUST_DEF_OP became V_MUST_DEF_RESULT. (get_v_must_def_result_ptr): Modify for new structure of v_must_defs array. (get_v_must_def_kill_ptr): New. (op_iter_next_use): Add support for the kill that occurs in V_MUST_DEFs. (op_iter_next_tree): Ditto. Also V_MAY_DEF_OP became V_MAY_DEF_RESULT. (op_iter_next_def): V_MAY_DEF_OP became V_MAY_DEF_RESULT. (op_iter_init): Initialize new mustu members. (op_iter_next_mustdef): New function. (op_iter_init_mustdef): Ditto. * tree-flow.h (rewrite_def_def_chains): New function. * tree-into-ssa.c (mark_def_sites): Handle mustdefkill operands. (ssa_mark_def_sites): Ditto. (rewrite_stmt): Ditto. (ssa_rewrite_stmt): Ditto. (rewrite_blocks): Factor out from rewrite_into_ssa. (mark_def_block_sites): Ditto. (rewrite_def_def_chains): New function, just rewrites def-def chains without phi node insertion. * tree-pass.h (TODO_fix_def_def_chains): New todo flag. * tree-optimize.c (execute_todo): Handle TODO_fix_def_def_chains. * tree-pretty-print.c (dump_vops): Print out MUST_DEF's so that they include the rhs now. * tree-ssa-ccp.c (visit_assignment): V_MUST_DEF_OP became V_MUST_DEF_RESULT. * tree-ssa-dce.c (mark_operand_necessary): Add phionly argument. Update callers. (mark_really_necessary_kill_operand_phis): New function. (perform_tree_ssa_dce): Call it. (pass_dce): Add TODO_fix_def_def_chains. (pass_cd_dce): Ditto. * tree-ssa-loop-im.c (determine_max_movement): Look at kills as well. (rewrite_mem_refs): Ditto. * tree-ssa-loop-manip.c (find_uses_to_rename_stmt): Look at kills as well. * tree-ssa-operands.c (allocate_v_may_def_optype): v_may_def_operand_type_t became v_def_use_operand_type_t. (allocate_v_must_def_optype) Ditto. (finalize_ssa_v_must_defs): Update for new operand type, as well as setting the use portion as well. (copy_virtual_operands): Copy the kill operand as well. (create_ssa_artficial_load_stmt): V_MUST_DEF_OP became V_MUST_DEF_RESULT. * tree-ssa-operands.h (v_may_def_operand_type): Renamed to v_def_use_operand_type. (v_must_def_optype_d): Use v_def_use_operand_type. (V_MUST_DEF_OP_*): Renamed to V_MUST_DEF_RESULT_* (V_MUST_DEF_KILL_*): New macros. (struct ssa_operand_iterator_d): Add num_v_mustu and v_mustu_i members. Rename existing must_i and num_v_must members to mustd_i and num_v_mustd. (SSA_OP_VMUSTDEFKILL): New flag. (SSA_OP_VIRTUAL_KILLS): New flag. (SSA_OP_ALL_OPERANDS): Add in SSA_OP_ALL_KILLS. (SSA_OP_ALL_KILLS): New flag. (FOR_EACH_SSA_MUSTDEF_OPERAND): New macro. * tree-ssa.c (verify_ssa): Verify virtual kills as well. * tree-vectorizer.c (vect_create_data_ref_ptr): V_MUST_DEF_OP became V_MUST_DEF_RESULT. (rename_variables_in_bb): Rename kill pointer as well. * tree-dfa.c (compute_immediate_uses_for_stmt): Add kills into the immediate uses. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@89695 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-operands.c')
-rw-r--r--gcc/tree-ssa-operands.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/gcc/tree-ssa-operands.c b/gcc/tree-ssa-operands.c
index 953ef8d71b7..55cebf20c8d 100644
--- a/gcc/tree-ssa-operands.c
+++ b/gcc/tree-ssa-operands.c
@@ -174,7 +174,7 @@ allocate_v_may_def_optype (unsigned num)
v_may_def_optype v_may_def_ops;
unsigned size;
size = sizeof (struct v_may_def_optype_d)
- + sizeof (v_may_def_operand_type_t) * (num - 1);
+ + sizeof (v_def_use_operand_type_t) * (num - 1);
v_may_def_ops = ggc_alloc (size);
v_may_def_ops->num_v_may_defs = num;
return v_may_def_ops;
@@ -202,7 +202,7 @@ allocate_v_must_def_optype (unsigned num)
{
v_must_def_optype v_must_def_ops;
unsigned size;
- size = sizeof (struct v_must_def_optype_d) + sizeof (tree) * (num - 1);
+ size = sizeof (struct v_must_def_optype_d) + sizeof (v_def_use_operand_type_t) * (num - 1);
v_must_def_ops = ggc_alloc (size);
v_must_def_ops->num_v_must_defs = num;
return v_must_def_ops;
@@ -650,7 +650,7 @@ finalize_ssa_v_must_defs (v_must_def_optype *old_ops_p,
build_diff = false;
for (x = 0; x < num; x++)
{
- tree var = old_ops->v_must_defs[x];
+ tree var = old_ops->v_must_defs[x].def;
if (TREE_CODE (var) == SSA_NAME)
var = SSA_NAME_VAR (var);
if (var != VARRAY_TREE (build_v_must_defs, x))
@@ -677,17 +677,21 @@ finalize_ssa_v_must_defs (v_must_def_optype *old_ops_p,
/* Look for VAR in the original vector. */
for (i = 0; i < old_num; i++)
{
- result = old_ops->v_must_defs[i];
+ result = old_ops->v_must_defs[i].def;
if (TREE_CODE (result) == SSA_NAME)
result = SSA_NAME_VAR (result);
if (result == var)
{
- v_must_def_ops->v_must_defs[x] = old_ops->v_must_defs[i];
+ v_must_def_ops->v_must_defs[x].def = old_ops->v_must_defs[i].def;
+ v_must_def_ops->v_must_defs[x].use = old_ops->v_must_defs[i].use;
break;
}
}
if (i == old_num)
- v_must_def_ops->v_must_defs[x] = var;
+ {
+ v_must_def_ops->v_must_defs[x].def = var;
+ v_must_def_ops->v_must_defs[x].use = var;
+ }
}
}
VARRAY_POP_ALL (build_v_must_defs);
@@ -1672,7 +1676,10 @@ copy_virtual_operands (tree dst, tree src)
{
*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));
+ {
+ SET_V_MUST_DEF_RESULT (*v_must_defs_new, i, V_MUST_DEF_RESULT (v_must_defs, i));
+ SET_V_MUST_DEF_KILL (*v_must_defs_new, i, V_MUST_DEF_KILL (v_must_defs, i));
+ }
}
}
@@ -1701,7 +1708,7 @@ create_ssa_artficial_load_stmt (stmt_operands_p old_ops, tree new_stmt)
free_vuses (&(ann->operands.vuse_ops));
free_v_may_defs (&(ann->operands.v_may_def_ops));
free_v_must_defs (&(ann->operands.v_must_def_ops));
-
+
/* 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. */
@@ -1713,7 +1720,7 @@ create_ssa_artficial_load_stmt (stmt_operands_p old_ops, tree new_stmt)
for (j = 0; j < NUM_V_MUST_DEFS (old_ops->v_must_def_ops); j++)
{
- op = V_MUST_DEF_OP (old_ops->v_must_def_ops, j);
+ op = V_MUST_DEF_RESULT (old_ops->v_must_def_ops, j);
append_vuse (op);
}
OpenPOWER on IntegriCloud