diff options
author | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-04-26 17:37:33 +0000 |
---|---|---|
committer | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-04-26 17:37:33 +0000 |
commit | fb0c974d0fe4f065e1d8d328c9c3965e9b8db553 (patch) | |
tree | 0d7eb68bfe51ab28e40b7b4005702e4ca1a156ff /gcc/tree-flow-inline.h | |
parent | be70590f5139813bebb6cea275d56bdf0d361182 (diff) | |
download | gcc-fb0c974d0fe4f065e1d8d328c9c3965e9b8db553.tar.gz |
* tree-flow-inline.h (op_iter_next_must_and_may_def): New.
(op_iter_init_must_and_may_def): Likewise.
(unmodifiable_var_p): Move to a later point in the file.
* tree-ssa-operands.h (FOR_EACH_SSA_MUST_AND_MAY_DEF_OPERAND): New.
* tree-ssa-dse.c (need_imm_uses_for): Remove, no longer needed.
(dse_record_phis): Directly check for virtual operands rather than
using need_imm_uses_for.
(dse_optimize_stmt): Handle V_MUST_DEF operands. Handle case where
store has multiple V_{MAY,MUST}_DEF operands.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@98780 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-flow-inline.h')
-rw-r--r-- | gcc/tree-flow-inline.h | 59 |
1 files changed, 49 insertions, 10 deletions
diff --git a/gcc/tree-flow-inline.h b/gcc/tree-flow-inline.h index 9fbf4282de1..87a243daa3c 100644 --- a/gcc/tree-flow-inline.h +++ b/gcc/tree-flow-inline.h @@ -1121,6 +1121,7 @@ op_iter_next_mustdef (use_operand_p *kill, def_operand_p *def, ssa_op_iter *ptr) ptr->done = true; return; } + /* Get the next iterator maydef value for PTR, returning the maydef values in USE and DEF. */ static inline void @@ -1141,6 +1142,34 @@ op_iter_next_maydef (use_operand_p *use, def_operand_p *def, ssa_op_iter *ptr) return; } +/* Get the next iterator mustdef or maydef value for PTR, returning the + mustdef or maydef values in KILL and DEF. */ +static inline void +op_iter_next_must_and_may_def (use_operand_p *kill, + def_operand_p *def, + ssa_op_iter *ptr) +{ + if (ptr->v_mustu_i < ptr->num_v_mustu) + { + *def = V_MUST_DEF_RESULT_PTR (ptr->ops->v_must_def_ops, ptr->v_mustu_i); + *kill = V_MUST_DEF_KILL_PTR (ptr->ops->v_must_def_ops, (ptr->v_mustu_i)++); + return; + } + else if (ptr->v_mayu_i < ptr->num_v_mayu) + { + *def = V_MAY_DEF_RESULT_PTR (ptr->ops->v_may_def_ops, ptr->v_mayu_i); + *kill = V_MAY_DEF_OP_PTR (ptr->ops->v_may_def_ops, (ptr->v_mayu_i)++); + return; + } + else + { + *def = NULL_DEF_OPERAND_P; + *kill = NULL_USE_OPERAND_P; + } + ptr->done = true; + return; +} + /* Initialize iterator PTR to the operands in STMT. Return the first operands in USE and DEF. */ static inline void @@ -1151,16 +1180,6 @@ op_iter_init_maydef (ssa_op_iter *ptr, tree stmt, use_operand_p *use, op_iter_next_maydef (use, def, ptr); } -/* Return true if VAR cannot be modified by the program. */ - -static inline bool -unmodifiable_var_p (tree var) -{ - if (TREE_CODE (var) == SSA_NAME) - var = SSA_NAME_VAR (var); - return TREE_READONLY (var) && (TREE_STATIC (var) || DECL_EXTERNAL (var)); -} - /* Initialize iterator PTR to the operands in STMT. Return the first operands in KILL and DEF. */ @@ -1172,6 +1191,26 @@ op_iter_init_mustdef (ssa_op_iter *ptr, tree stmt, use_operand_p *kill, op_iter_next_mustdef (kill, def, ptr); } +/* 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, + use_operand_p *kill, def_operand_p *def) +{ + op_iter_init (ptr, stmt, SSA_OP_VMUSTDEFKILL | SSA_OP_VMAYUSE); + op_iter_next_must_and_may_def (kill, def, ptr); +} + +/* Return true if VAR cannot be modified by the program. */ + +static inline bool +unmodifiable_var_p (tree var) +{ + if (TREE_CODE (var) == SSA_NAME) + var = SSA_NAME_VAR (var); + return TREE_READONLY (var) && (TREE_STATIC (var) || DECL_EXTERNAL (var)); +} + /* Return true if REF, a COMPONENT_REF, has an ARRAY_REF somewhere in it. */ static inline bool |