20#ifndef GCC_SSA_ITERATORS_H
21#define GCC_SSA_ITERATORS_H
75#define FOR_EACH_IMM_USE_FAST(DEST, ITER, SSAVAR) \
76 for ((DEST) = first_readonly_imm_use (&(ITER), (SSAVAR)); \
77 !end_readonly_imm_use_p (&(ITER)); \
78 (void) ((DEST) = next_readonly_imm_use (&(ITER))))
98#define FOR_EACH_IMM_USE_STMT(STMT, ITER, SSAVAR) \
99 for (struct auto_end_imm_use_stmt_traverse \
100 auto_end_imm_use_stmt_traverse \
101 ((((STMT) = first_imm_use_stmt (&(ITER), (SSAVAR))), \
103 !end_imm_use_stmt_p (&(ITER)); \
104 (void) ((STMT) = next_imm_use_stmt (&(ITER))))
119#define FOR_EACH_IMM_USE_ON_STMT(DEST, ITER) \
120 for ((DEST) = first_imm_use_on_stmt (&(ITER)); \
121 !end_imm_use_on_stmt_p (&(ITER)); \
122 (void) ((DEST) = next_imm_use_on_stmt (&(ITER))))
156#define SSA_OP_USE 0x01
157#define SSA_OP_DEF 0x02
158#define SSA_OP_VUSE 0x04
159#define SSA_OP_VDEF 0x08
161#define SSA_OP_VIRTUAL_USES (SSA_OP_VUSE)
162#define SSA_OP_VIRTUAL_DEFS (SSA_OP_VDEF)
163#define SSA_OP_ALL_VIRTUALS (SSA_OP_VIRTUAL_USES | SSA_OP_VIRTUAL_DEFS)
164#define SSA_OP_ALL_USES (SSA_OP_VIRTUAL_USES | SSA_OP_USE)
165#define SSA_OP_ALL_DEFS (SSA_OP_VIRTUAL_DEFS | SSA_OP_DEF)
166#define SSA_OP_ALL_OPERANDS (SSA_OP_ALL_USES | SSA_OP_ALL_DEFS)
171#define FOR_EACH_SSA_TREE_OPERAND(TREEVAR, STMT, ITER, FLAGS) \
172 for (TREEVAR = op_iter_init_tree (&(ITER), STMT, FLAGS); \
173 !op_iter_done (&(ITER)); \
174 (void) (TREEVAR = op_iter_next_tree (&(ITER))))
179#define FOR_EACH_SSA_USE_OPERAND(USEVAR, STMT, ITER, FLAGS) \
180 for (USEVAR = op_iter_init_use (&(ITER), STMT, FLAGS); \
181 !op_iter_done (&(ITER)); \
182 USEVAR = op_iter_next_use (&(ITER)))
187#define FOR_EACH_SSA_DEF_OPERAND(DEFVAR, STMT, ITER, FLAGS) \
188 for (DEFVAR = op_iter_init_def (&(ITER), STMT, FLAGS); \
189 !op_iter_done (&(ITER)); \
190 DEFVAR = op_iter_next_def (&(ITER)))
195#define FOR_EACH_PHI_ARG(USEVAR, STMT, ITER, FLAGS) \
196 for ((USEVAR) = op_iter_init_phiuse (&(ITER), STMT, FLAGS); \
197 !op_iter_done (&(ITER)); \
198 (USEVAR) = op_iter_next_use (&(ITER)))
203#define FOR_EACH_PHI_OR_STMT_USE(USEVAR, STMT, ITER, FLAGS) \
204 for ((USEVAR) = (gimple_code (STMT) == GIMPLE_PHI \
205 ? op_iter_init_phiuse (&(ITER), \
206 as_a <gphi *> (STMT), \
208 : op_iter_init_use (&(ITER), STMT, FLAGS)); \
209 !op_iter_done (&(ITER)); \
210 (USEVAR) = op_iter_next_use (&(ITER)))
214#define FOR_EACH_PHI_OR_STMT_DEF(DEFVAR, STMT, ITER, FLAGS) \
215 for ((DEFVAR) = (gimple_code (STMT) == GIMPLE_PHI \
216 ? op_iter_init_phidef (&(ITER), \
217 as_a <gphi *> (STMT), \
219 : op_iter_init_def (&(ITER), STMT, FLAGS)); \
220 !op_iter_done (&(ITER)); \
221 (DEFVAR) = op_iter_next_def (&(ITER)))
226#define SINGLE_SSA_TREE_OPERAND(STMT, FLAGS) \
227 single_ssa_tree_operand (STMT, FLAGS)
232#define SINGLE_SSA_USE_OPERAND(STMT, FLAGS) \
233 single_ssa_use_operand (STMT, FLAGS)
238#define SINGLE_SSA_DEF_OPERAND(STMT, FLAGS) \
239 single_ssa_def_operand (STMT, FLAGS)
242#define ZERO_SSA_OPERANDS(STMT, FLAGS) zero_ssa_operands (STMT, FLAGS)
245#define NUM_SSA_OPERANDS(STMT, FLAGS) num_ssa_operands (STMT, FLAGS)
268 linknode->
prev = list;
271 list->
next = linknode;
427 if (ptr == ptr->
next)
457 unsigned int num = 0;
461 for (ptr = start->next; ptr != start; ptr = ptr->
next)
466 for (ptr = start->next; ptr != start; ptr = ptr->
next)
513 ptr->
flags &= ~SSA_OP_VDEF;
533 ptr->
flags &= ~SSA_OP_DEF;
554 ptr->
flags &= ~SSA_OP_VDEF;
573 ptr->
flags &= ~SSA_OP_DEF;
619 case GIMPLE_TRANSACTION:
621 flags &= ~SSA_OP_DEF;
795 if ((flags &
comp) == 0)
826 if ((flags &
comp) == 0)
871 if (last_p->
next == use_p)
const union tree_node * const_tree
Definition coretypes.h:98
union tree_node * tree
Definition coretypes.h:97
#define cfun
Definition function.h:478
static sbitmap * comp
Definition gcse.cc:1639
bool is_gimple_reg(tree t)
Definition gimple-expr.cc:790
use_operand_p gimple_vuse_op(const gimple *g)
Definition gimple-ssa.h:141
tree * gimple_op_ptr(gimple *gs, unsigned i)
Definition gimple.h:2565
tree * gimple_vdef_ptr(gimple *g)
Definition gimple.h:2212
tree gimple_op(const gimple *gs, unsigned i)
Definition gimple.h:2551
tree gimple_vdef(const gimple *g)
Definition gimple.h:2188
gimple_code
Definition gimple.h:30
unsigned gimple_asm_noutputs(const gasm *asm_stmt)
Definition gimple.h:4031
tree gimple_phi_result(const gphi *gs)
Definition gimple.h:4562
struct use_optype_d * gimple_use_ops(const gimple *g)
Definition gimple.h:2152
bool is_gimple_debug(const gimple *gs)
Definition gimple.h:4913
tree * gimple_phi_result_ptr(gphi *gs)
Definition gimple.h:4577
tree gimple_vuse(const gimple *g)
Definition gimple.h:2176
unsigned gimple_phi_num_args(const gimple *gs)
Definition gimple.h:4552
#define return_false()
Definition ipa-icf-gimple.h:57
T as_a(U *p)
Definition is-a.h:253
T dyn_cast(U *p)
Definition is-a.h:280
def_operand_p op_iter_next_def(ssa_op_iter *ptr)
Definition ssa-iterators.h:507
use_operand_p first_imm_use_on_stmt(imm_use_iterator *imm)
Definition ssa-iterators.h:972
#define SSA_OP_USE
Definition ssa-iterators.h:156
#define SSA_OP_VUSE
Definition ssa-iterators.h:158
void link_imm_use_stmt(ssa_use_operand_t *linknode, tree def, gimple *stmt)
Definition ssa-iterators.h:303
void end_imm_use_stmt_traverse(imm_use_iterator *)
Definition ssa-iterators.h:851
use_operand_p first_readonly_imm_use(imm_use_iterator *imm, tree var)
Definition ssa-iterators.h:352
void delink_stmt_imm_use(gimple *stmt)
Definition ssa-iterators.h:1003
bool single_imm_use(const_tree var, use_operand_p *use_p, gimple **stmt)
Definition ssa-iterators.h:422
gimple * first_imm_use_stmt(imm_use_iterator *imm, tree var)
Definition ssa-iterators.h:929
void clear_and_done_ssa_iter(ssa_op_iter *ptr)
Definition ssa-iterators.h:586
#define SSA_OP_VIRTUAL_DEFS
Definition ssa-iterators.h:162
bool has_zero_uses(const_tree var)
Definition ssa-iterators.h:387
#define SSA_OP_VDEF
Definition ssa-iterators.h:159
use_operand_p op_iter_init_phiuse(ssa_op_iter *ptr, gphi *phi, int flags)
Definition ssa-iterators.h:782
use_operand_p next_imm_use_on_stmt(imm_use_iterator *imm)
Definition ssa-iterators.h:989
void relink_imm_use(ssa_use_operand_t *node, ssa_use_operand_t *old)
Definition ssa-iterators.h:314
#define SSA_OP_VIRTUAL_USES
Definition ssa-iterators.h:161
use_operand_p op_iter_next_use(ssa_op_iter *ptr)
Definition ssa-iterators.h:487
ssa_op_iter_type
Definition ssa-iterators.h:130
@ ssa_op_iter_none
Definition ssa-iterators.h:131
@ ssa_op_iter_use
Definition ssa-iterators.h:133
@ ssa_op_iter_tree
Definition ssa-iterators.h:132
@ ssa_op_iter_def
Definition ssa-iterators.h:134
use_operand_p single_ssa_use_operand(gimple *stmt, int flags)
Definition ssa-iterators.h:697
tree op_iter_init_tree(ssa_op_iter *ptr, gimple *stmt, int flags)
Definition ssa-iterators.h:668
use_operand_p move_use_after_head(use_operand_p use_p, use_operand_p head, use_operand_p last_p)
Definition ssa-iterators.h:863
bool end_imm_use_on_stmt_p(const imm_use_iterator *imm)
Definition ssa-iterators.h:981
#define FOR_EACH_SSA_USE_OPERAND(USEVAR, STMT, ITER, FLAGS)
Definition ssa-iterators.h:179
bool zero_ssa_operands(gimple *stmt, int flags)
Definition ssa-iterators.h:743
#define FOR_EACH_SSA_TREE_OPERAND(TREEVAR, STMT, ITER, FLAGS)
Definition ssa-iterators.h:171
gimple * next_imm_use_stmt(imm_use_iterator *imm)
Definition ssa-iterators.h:954
#define FOR_EACH_PHI_ARG(USEVAR, STMT, ITER, FLAGS)
Definition ssa-iterators.h:195
tree single_phi_def(gphi *stmt, int flags)
Definition ssa-iterators.h:769
def_operand_p op_iter_init_def(ssa_op_iter *ptr, gimple *stmt, int flags)
Definition ssa-iterators.h:656
use_operand_p next_readonly_imm_use(imm_use_iterator *imm)
Definition ssa-iterators.h:364
use_operand_p ssa_vuse_operand(gimple *stmt)
Definition ssa-iterators.h:714
void op_iter_init(ssa_op_iter *ptr, gimple *stmt, int flags)
Definition ssa-iterators.h:599
unsigned int num_imm_uses(const_tree var)
Definition ssa-iterators.h:453
void link_use_stmts_after(use_operand_p head, imm_use_iterator *imm)
Definition ssa-iterators.h:889
void relink_imm_use_stmt(ssa_use_operand_t *linknode, ssa_use_operand_t *old, gimple *stmt)
Definition ssa-iterators.h:332
void set_ssa_use_from_ptr(use_operand_p use, tree val)
Definition ssa-iterators.h:293
use_operand_p op_iter_init_use(ssa_op_iter *ptr, gimple *stmt, int flags)
Definition ssa-iterators.h:644
void link_imm_use(ssa_use_operand_t *linknode, tree def)
Definition ssa-iterators.h:276
#define SSA_OP_ALL_DEFS
Definition ssa-iterators.h:165
void link_imm_use_to_list(ssa_use_operand_t *linknode, ssa_use_operand_t *list)
Definition ssa-iterators.h:264
bool has_single_use(const_tree var)
Definition ssa-iterators.h:401
#define SSA_OP_ALL_USES
Definition ssa-iterators.h:164
bool end_readonly_imm_use_p(const imm_use_iterator *imm)
Definition ssa-iterators.h:345
def_operand_p single_ssa_def_operand(gimple *stmt, int flags)
Definition ssa-iterators.h:725
def_operand_p op_iter_init_phidef(ssa_op_iter *ptr, gphi *phi, int flags)
Definition ssa-iterators.h:812
#define SSA_OP_DEF
Definition ssa-iterators.h:157
void delink_imm_use(ssa_use_operand_t *linknode)
Definition ssa-iterators.h:250
#define FOR_EACH_PHI_OR_STMT_USE(USEVAR, STMT, ITER, FLAGS)
Definition ssa-iterators.h:203
bool end_imm_use_stmt_p(const imm_use_iterator *imm)
Definition ssa-iterators.h:842
bool single_imm_use_1(const ssa_use_operand_t *head, use_operand_p *use_p, gimple **stmt)
Definition tree-ssa-operands.cc:1390
tree op_iter_next_tree(ssa_op_iter *ptr)
Definition ssa-iterators.h:542
tree single_ssa_tree_operand(gimple *stmt, int flags)
Definition ssa-iterators.h:679
bool op_iter_done(const ssa_op_iter *ptr)
Definition ssa-iterators.h:480
int num_ssa_operands(gimple *stmt, int flags)
Definition ssa-iterators.h:754
Definition ssa-iterators.h:86
~auto_end_imm_use_stmt_traverse()
Definition ssa-iterators.h:90
auto_end_imm_use_stmt_traverse(imm_use_iterator *imm)
Definition ssa-iterators.h:88
imm_use_iterator * imm
Definition ssa-iterators.h:87
Definition loop-invariant.cc:88
Definition collect2.cc:175
Definition ssa-iterators.h:59
ssa_use_operand_t * end_p
Definition ssa-iterators.h:63
ssa_use_operand_t iter_node
Definition ssa-iterators.h:65
ssa_use_operand_t * imm_use
Definition ssa-iterators.h:61
ssa_use_operand_t * next_imm_name
Definition ssa-iterators.h:68
Definition ssa-iterators.h:143
unsigned numops
Definition ssa-iterators.h:148
unsigned i
Definition ssa-iterators.h:147
bool done
Definition ssa-iterators.h:145
int flags
Definition ssa-iterators.h:146
gimple * stmt
Definition ssa-iterators.h:150
use_optype_p uses
Definition ssa-iterators.h:149
enum ssa_op_iter_type iter_type
Definition ssa-iterators.h:144
Definition tree-core.h:1681
gimple * stmt
Definition tree-core.h:1689
tree * use
Definition tree-core.h:1690
struct ssa_use_operand_t * prev
Definition tree-core.h:1682
union ssa_use_operand_t::@67 loc
struct ssa_use_operand_t * next
Definition tree-core.h:1683
Definition tree-ssa-operands.h:38
struct use_optype_d * next
Definition tree-ssa-operands.h:39
Definition loop-invariant.cc:78
#define NULL
Definition system.h:50
#define gcc_assert(EXPR)
Definition system.h:814
#define gcc_checking_assert(EXPR)
Definition system.h:821
bool ssa_operands_active(struct function *fun)
Definition tree-ssa-operands.cc:219
tree * def_operand_p
Definition tree-ssa-operands.h:27
#define USE_FROM_PTR(PTR)
Definition tree-ssa-operands.h:65
#define USE_STMT(USE)
Definition tree-ssa-operands.h:70
#define USE_OP(OP)
Definition tree-ssa-operands.h:73
#define USE_OP_PTR(OP)
Definition tree-ssa-operands.h:72
#define PHI_ARG_DEF_PTR(PHI, I)
Definition tree-ssa-operands.h:77
#define NULL_USE_OPERAND_P
Definition tree-ssa-operands.h:33
#define NULL_DEF_OPERAND_P
Definition tree-ssa-operands.h:34
#define TREE_VALUE(NODE)
Definition tree.h:1222
#define MAY_HAVE_DEBUG_BIND_STMTS
Definition tree.h:1314
#define SSA_NAME_IMM_USE_NODE(NODE)
Definition tree.h:2182
#define TREE_CODE(NODE)
Definition tree.h:324
#define NULL_TREE
Definition tree.h:317