diff options
author | amacleod <amacleod@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-10-01 15:46:53 +0000 |
---|---|---|
committer | amacleod <amacleod@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-10-01 15:46:53 +0000 |
commit | 8f6fa493f6996ec343ead1770530605326197ff9 (patch) | |
tree | eaa52ec7e3d23ca35b23922da83d4e62a0837824 /gcc/gimple.h | |
parent | 24e28cb5278924fc604ac2c61162db3fa3b8f201 (diff) | |
download | gcc-8f6fa493f6996ec343ead1770530605326197ff9.tar.gz |
* tree-into-ssa.c (enum need_phi_state): Relocate from tree-flow.h.
(dump_decl_set): Move to gimple.c.
* gimple.h: Don't include tree-ssa-operands.h.
(dump_decl_set): Add prototype.
(gimple_vuse_op, gimple_vdef_op, update_stmt, update_stmt_if_modified):
Move to gimple-ssa.h.
(phi_ssa_name_p, phi_nodes, phi_nodes_ptr, gimple_phi_arg_def,
gimple_phi_arg_def_ptr, gimple_phi_arg_edge, gimple_phi_arg_location,
gimple_phi_arg_location_from_edge, gimple_phi_arg_set_location,
gimple_phi_arg_has_location): Relocate from tree-flow-inline.h
* gimple.c (walk_stmt_load_store_ops): Use gimple_phi_arg_def rather
than PHI_ARG_DEF.
(dump_decl_set): Relocate here.
* gimple-ssa.h: New file.
(gimple_vuse_op, gimple_vdef_op, update_stmt, update_stmt_if_modified):
Relocate from gimple.h.
* tree-cfg.c (has_zero_uses_1, single_imm_use_1): Move to...
* tree-ssa-operands.c (swap_ssa_operands): Rename from
swap_tree_operands and remove non-ssa path.
(has_zero_uses_1, single_imm_use_1): Relocate from tree-cfg.c.
* tree-ssa-reassoc.c (linearize_expr_tree, repropagate_negates): Use
swap_ssa_operands.
* tree-vect-loop.c (destroy_loop_vec_info, vect_is_slp_reduction,
vect_is_simple_reduction_1): Use swap_ssa_operands.
* tree-flow.h: Move various prototypes to tree-phinodes.h.
(enum need_phi_state): Move to tree-into-ssa.c.
(struct immediate_use_iterator_d, FOR_EACH_IMM_*,
BREAK_FROM_IMM_USE_STMT): Move to ssa-iterators.h.
(swap_tree_operands): Rename and move prototype to tree-ssa-operands.h.
* tree-flow-inline.h (delink_imm_use, link_imm_use_to_list,
link_imm_use, set_ssa_use_from_ptr, link_imm_use_stmt, relink_imm_use,
relink_imm_use_stmt, end_readonly_imm_use_p, first_readonly_imm_use,
next_readonly_imm_use, has_zero_uses, has_single_use, single_imm_use,
num_imm_uses): Move to ssa-iterators.h.
(get_use_from_ptr, get_def_from_ptr): Move to tree-ssa-operands.h
(gimple_phi_arg_imm_use_ptr, phi_arg_index_from_use): Move to
tree-phinodes.h.
(op_iter_done, op_iter_next_def, op_iter_next_tree,
clear_and_done_ssa_iter, op_iter_init, op_iter_init_use,
op_iter_init_def, op_iter_init_tree, single_ssa_tree_operand,
single_ssa_use_operand, single_ssa_def_operand, zero_ssa_operands,
num_ssa_operands, delink_stmt_imm_use, single_phi_def,
op_iter_init_phiuse, op_iter_init_phidef, end_imm_use_stmt_p,
end_imm_use_stmt_traverse, move_use_after_head, link_use_stmts_after,
first_imm_use_stmt, next_imm_use_stmt, first_imm_use_on_stmt,
end_imm_use_on_stmt_p, next_imm_use_on_stmt): Move to ssa-iterators.h.
(gimple_phi_arg_def, gimple_phi_arg_def_ptr, gimple_phi_arg_edge,
gimple_phi_arg_location, gimple_phi_arg_location_from_edge,
gimple_phi_arg_set_location, gimple_phi_arg_has_location, phi_nodes,
phi_nodes_ptr, phi_ssa_name_p): Move to gimple.h.
(set_phi_nodes): Move to tree-phinodes.h.
* tree-ssa-operands.h (enum ssa_op_iter_type,
struct ssa_operand_iterator_d, SSA_OP*, FOR_EACH_SSA*, SINGLE_SSA*,
ZERO_SSA_OPERANDS, NUM_SSA_OPERANDS): Move to ssa-iterators.h.
(dump_decl_set): Remove prototype.
(get_use_from_ptr, get_def_from_ptr): Relocate from tree-flow.h.
* tree-phinodes.h: New file. Move some prototypes from tree-flow.h.
(set_phi_nodes): Relocate from tree-flow-inline.h.
(gimple_phi_arg_imm_use_ptr, phi_arg_index_from_use): Relocate from
tree-flow-inline.h
* tree-ssa.h: Add tree-phinodes.h, gimple-ssa.h, ssa-iterators.h to
include list. Temporarily add gimple.h to include list.
* ssa-iterators.h: New file.
(struct immediate_use_iterator_d, FOR_EACH_IMM_*,
BREAK_FROM_IMM_USE_STMT): Relocate from tree-flow.h.
(enum ssa_op_iter_type, struct ssa_operand_iterator_d, SSA_OP*,
FOR_EACH_SSA*, SINGLE_SSA*, ZERO_SSA_OPERANDS, NUM_SSA_OPERANDS):
Relocate from tree-ssa-operands.h.
(delink_imm_use, link_imm_use_to_list, link_imm_use,
set_ssa_use_from_ptr, link_imm_use_stmt, relink_imm_use,
relink_imm_use_stmt, end_readonly_imm_use_p, first_readonly_imm_use,
next_readonly_imm_use, has_zero_uses, has_single_use, single_imm_use,
num_imm_uses, get_use_from_ptr, get_def_from_ptr,
phi_arg_index_from_use, op_iter_done, op_iter_next_def,
op_iter_next_tree, clear_and_done_ssa_iter, op_iter_init,
op_iter_init_use, op_iter_init_def, op_iter_init_tree,
single_ssa_tree_operand, single_ssa_use_operand, single_ssa_def_operand,
zero_ssa_operands, num_ssa_operands, delink_stmt_imm_use,
single_phi_def, op_iter_init_phiuse, op_iter_init_phidef,
end_imm_use_stmt_p, end_imm_use_stmt_traverse, move_use_after_head,
link_use_stmts_after, first_imm_use_stmt, next_imm_use_stmt,
first_imm_use_on_stmt, end_imm_use_on_stmt_p, next_imm_use_on_stmt):
Relocate from tree-flow-inline.h.
* tree-outof-ssa.h: Change _SSAEXPAND_H macro to GCC_TREE_OUTOF_SSA_H.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@203068 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gimple.h')
-rw-r--r-- | gcc/gimple.h | 141 |
1 files changed, 91 insertions, 50 deletions
diff --git a/gcc/gimple.h b/gcc/gimple.h index 376fda2c6f2..2d324e6623b 100644 --- a/gcc/gimple.h +++ b/gcc/gimple.h @@ -28,7 +28,6 @@ along with GCC; see the file COPYING3. If not see #include "ggc.h" #include "basic-block.h" #include "tree.h" -#include "tree-ssa-operands.h" #include "tree-ssa-alias.h" #include "internal-fn.h" @@ -1055,6 +1054,7 @@ extern void omp_firstprivatize_variable (struct gimplify_omp_ctx *, tree); extern tree gimple_boolify (tree); extern gimple_predicate rhs_predicate_for (tree); extern tree canonicalize_cond_expr_cond (tree); +extern void dump_decl_set (FILE *, bitmap); /* In omp-low.c. */ extern tree omp_reduction_init (tree, tree); @@ -1462,34 +1462,6 @@ gimple_set_use_ops (gimple g, struct use_optype_d *use) } -/* Return the set of VUSE operand for statement G. */ - -static inline use_operand_p -gimple_vuse_op (const_gimple g) -{ - struct use_optype_d *ops; - if (!gimple_has_mem_ops (g)) - return NULL_USE_OPERAND_P; - ops = g->gsops.opbase.use_ops; - if (ops - && USE_OP_PTR (ops)->use == &g->gsmembase.vuse) - return USE_OP_PTR (ops); - return NULL_USE_OPERAND_P; -} - -/* Return the set of VDEF operand for statement G. */ - -static inline def_operand_p -gimple_vdef_op (gimple g) -{ - if (!gimple_has_mem_ops (g)) - return NULL_DEF_OPERAND_P; - if (g->gsmembase.vdef) - return &g->gsmembase.vdef; - return NULL_DEF_OPERAND_P; -} - - /* Return the single VUSE operand of the statement G. */ static inline tree @@ -1590,27 +1562,6 @@ gimple_expr_code (const_gimple stmt) } -/* Mark statement S as modified, and update it. */ - -static inline void -update_stmt (gimple s) -{ - if (gimple_has_ops (s)) - { - gimple_set_modified (s, true); - update_stmt_operands (s); - } -} - -/* Update statement S if it has been optimized. */ - -static inline void -update_stmt_if_modified (gimple s) -{ - if (gimple_modified_p (s)) - update_stmt_operands (s); -} - /* Return true if statement STMT contains volatile operands. */ static inline bool @@ -3572,6 +3523,96 @@ gimple_phi_set_arg (gimple gs, unsigned index, struct phi_arg_d * phiarg) gs->gimple_phi.args[index] = *phiarg; } +/* PHI nodes should contain only ssa_names and invariants. A test + for ssa_name is definitely simpler; don't let invalid contents + slip in in the meantime. */ + +static inline bool +phi_ssa_name_p (const_tree t) +{ + if (TREE_CODE (t) == SSA_NAME) + return true; + gcc_checking_assert (is_gimple_min_invariant (t)); + return false; +} + +/* Return the PHI nodes for basic block BB, or NULL if there are no + PHI nodes. */ + +static inline gimple_seq +phi_nodes (const_basic_block bb) +{ + gcc_checking_assert (!(bb->flags & BB_RTL)); + return bb->il.gimple.phi_nodes; +} + +/* Return a pointer to the PHI nodes for basic block BB. */ + +static inline gimple_seq * +phi_nodes_ptr (basic_block bb) +{ + gcc_checking_assert (!(bb->flags & BB_RTL)); + return &bb->il.gimple.phi_nodes; +} + +/* Return the tree operand for argument I of PHI node GS. */ + +static inline tree +gimple_phi_arg_def (gimple gs, size_t index) +{ + return gimple_phi_arg (gs, index)->def; +} + + +/* Return a pointer to the tree operand for argument I of PHI node GS. */ + +static inline tree * +gimple_phi_arg_def_ptr (gimple gs, size_t index) +{ + return &gimple_phi_arg (gs, index)->def; +} + +/* Return the edge associated with argument I of phi node GS. */ + +static inline edge +gimple_phi_arg_edge (gimple gs, size_t i) +{ + return EDGE_PRED (gimple_bb (gs), i); +} + +/* Return the source location of gimple argument I of phi node GS. */ + +static inline source_location +gimple_phi_arg_location (gimple gs, size_t i) +{ + return gimple_phi_arg (gs, i)->locus; +} + +/* Return the source location of the argument on edge E of phi node GS. */ + +static inline source_location +gimple_phi_arg_location_from_edge (gimple gs, edge e) +{ + return gimple_phi_arg (gs, e->dest_idx)->locus; +} + +/* Set the source location of gimple argument I of phi node GS to LOC. */ + +static inline void +gimple_phi_arg_set_location (gimple gs, size_t i, source_location loc) +{ + gimple_phi_arg (gs, i)->locus = loc; +} + +/* Return TRUE if argument I of phi node GS has a location record. */ + +static inline bool +gimple_phi_arg_has_location (gimple gs, size_t i) +{ + return gimple_phi_arg_location (gs, i) != UNKNOWN_LOCATION; +} + + /* Return the region number for GIMPLE_RESX GS. */ static inline int |