diff options
author | Andrew MacLeod <amacleod@redhat.com> | 2013-10-01 15:46:53 +0000 |
---|---|---|
committer | Andrew Macleod <amacleod@gcc.gnu.org> | 2013-10-01 15:46:53 +0000 |
commit | 80560f9521f81ae2c50b52b091b4caaf7d3d4397 (patch) | |
tree | eaa52ec7e3d23ca35b23922da83d4e62a0837824 /gcc/tree-flow.h | |
parent | 70b50ed7b5730785d6a16d6f7faae180e58af06b (diff) | |
download | gcc-80560f9521f81ae2c50b52b091b4caaf7d3d4397.zip gcc-80560f9521f81ae2c50b52b091b4caaf7d3d4397.tar.gz gcc-80560f9521f81ae2c50b52b091b4caaf7d3d4397.tar.bz2 |
tree-into-ssa.c (enum need_phi_state): Relocate from tree-flow.h.
* 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.
From-SVN: r203068
Diffstat (limited to 'gcc/tree-flow.h')
-rw-r--r-- | gcc/tree-flow.h | 137 |
1 files changed, 0 insertions, 137 deletions
diff --git a/gcc/tree-flow.h b/gcc/tree-flow.h index 3f3c3be..46082e2 100644 --- a/gcc/tree-flow.h +++ b/gcc/tree-flow.h @@ -107,132 +107,8 @@ typedef struct !end_htab_p (&(ITER)); \ RESULT = (TYPE) next_htab_element (&(ITER))) -/* It is advantageous to avoid things like life analysis for variables which - do not need PHI nodes. This enum describes whether or not a particular - variable may need a PHI node. */ - -enum need_phi_state { - /* This is the default. If we are still in this state after finding - all the definition and use sites, then we will assume the variable - needs PHI nodes. This is probably an overly conservative assumption. */ - NEED_PHI_STATE_UNKNOWN, - - /* This state indicates that we have seen one or more sets of the - variable in a single basic block and that the sets dominate all - uses seen so far. If after finding all definition and use sites - we are still in this state, then the variable does not need any - PHI nodes. */ - NEED_PHI_STATE_NO, - - /* This state indicates that we have either seen multiple definitions of - the variable in multiple blocks, or that we encountered a use in a - block that was not dominated by the block containing the set(s) of - this variable. This variable is assumed to need PHI nodes. */ - NEED_PHI_STATE_MAYBE -}; - - -/* Immediate use lists are used to directly access all uses for an SSA - name and get pointers to the statement for each use. - - The structure ssa_use_operand_d consists of PREV and NEXT pointers - to maintain the list. A USE pointer, which points to address where - the use is located and a LOC pointer which can point to the - statement where the use is located, or, in the case of the root - node, it points to the SSA name itself. - - The list is anchored by an occurrence of ssa_operand_d *in* the - ssa_name node itself (named 'imm_uses'). This node is uniquely - identified by having a NULL USE pointer. and the LOC pointer - pointing back to the ssa_name node itself. This node forms the - base for a circular list, and initially this is the only node in - the list. - - Fast iteration allows each use to be examined, but does not allow - any modifications to the uses or stmts. - - Normal iteration allows insertion, deletion, and modification. the - iterator manages this by inserting a marker node into the list - immediately before the node currently being examined in the list. - this marker node is uniquely identified by having null stmt *and* a - null use pointer. - - When iterating to the next use, the iteration routines check to see - if the node after the marker has changed. if it has, then the node - following the marker is now the next one to be visited. if not, the - marker node is moved past that node in the list (visualize it as - bumping the marker node through the list). this continues until - the marker node is moved to the original anchor position. the - marker node is then removed from the list. - - If iteration is halted early, the marker node must be removed from - the list before continuing. */ -typedef struct immediate_use_iterator_d -{ - /* This is the current use the iterator is processing. */ - ssa_use_operand_t *imm_use; - /* This marks the last use in the list (use node from SSA_NAME) */ - ssa_use_operand_t *end_p; - /* This node is inserted and used to mark the end of the uses for a stmt. */ - ssa_use_operand_t iter_node; - /* This is the next ssa_name to visit. IMM_USE may get removed before - the next one is traversed to, so it must be cached early. */ - ssa_use_operand_t *next_imm_name; -} imm_use_iterator; - - -/* Use this iterator when simply looking at stmts. Adding, deleting or - modifying stmts will cause this iterator to malfunction. */ - -#define FOR_EACH_IMM_USE_FAST(DEST, ITER, SSAVAR) \ - for ((DEST) = first_readonly_imm_use (&(ITER), (SSAVAR)); \ - !end_readonly_imm_use_p (&(ITER)); \ - (void) ((DEST) = next_readonly_imm_use (&(ITER)))) - -/* Use this iterator to visit each stmt which has a use of SSAVAR. */ - -#define FOR_EACH_IMM_USE_STMT(STMT, ITER, SSAVAR) \ - for ((STMT) = first_imm_use_stmt (&(ITER), (SSAVAR)); \ - !end_imm_use_stmt_p (&(ITER)); \ - (void) ((STMT) = next_imm_use_stmt (&(ITER)))) - -/* Use this to terminate the FOR_EACH_IMM_USE_STMT loop early. Failure to - do so will result in leaving a iterator marker node in the immediate - use list, and nothing good will come from that. */ -#define BREAK_FROM_IMM_USE_STMT(ITER) \ - { \ - end_imm_use_stmt_traverse (&(ITER)); \ - break; \ - } - - -/* Use this iterator in combination with FOR_EACH_IMM_USE_STMT to - get access to each occurrence of ssavar on the stmt returned by - that iterator.. for instance: - - FOR_EACH_IMM_USE_STMT (stmt, iter, var) - { - FOR_EACH_IMM_USE_ON_STMT (use_p, iter) - { - SET_USE (use_p, blah); - } - update_stmt (stmt); - } */ - -#define FOR_EACH_IMM_USE_ON_STMT(DEST, ITER) \ - for ((DEST) = first_imm_use_on_stmt (&(ITER)); \ - !end_imm_use_on_stmt_p (&(ITER)); \ - (void) ((DEST) = next_imm_use_on_stmt (&(ITER)))) - - - -static inline void update_stmt (gimple); static inline int get_lineno (const_gimple); -/* Accessors for basic block annotations. */ -static inline gimple_seq phi_nodes (const_basic_block); -static inline void set_phi_nodes (basic_block, gimple_seq); - /*--------------------------------------------------------------------------- Global declarations ---------------------------------------------------------------------------*/ @@ -403,17 +279,6 @@ extern bool stmt_references_abnormal_ssa_name (gimple); extern tree get_addr_base_and_unit_offset (tree, HOST_WIDE_INT *); extern void dump_enumerated_decls (FILE *, int); -/* In tree-phinodes.c */ -extern void reserve_phi_args_for_new_edge (basic_block); -extern void add_phi_node_to_bb (gimple phi, basic_block bb); -extern gimple create_phi_node (tree, basic_block); -extern void add_phi_arg (gimple, tree, edge, source_location); -extern void remove_phi_args (edge); -extern void remove_phi_node (gimple_stmt_iterator *, bool); -extern void remove_phi_nodes (basic_block); -extern void release_phi_node (gimple); -extern void phinodes_print_statistics (void); - /* In gimple-low.c */ extern void record_vars_into (tree, tree); extern void record_vars (tree); @@ -684,6 +549,4 @@ bool parallelized_function_p (tree); #include "tree-flow-inline.h" -void swap_tree_operands (gimple, tree *, tree *); - #endif /* _TREE_FLOW_H */ |