21 #ifndef _TREE_FLOW_INLINE_H
22 #define _TREE_FLOW_INLINE_H 1
34 return fun && fun->gimple_df && fun->gimple_df->in_ssa_p;
41 gcc_checking_assert (fun && fun->gimple_df);
42 return fun->gimple_df->vop;
51 hti->
slot = table->entries;
52 hti->
limit = hti->
slot + htab_size (table);
56 if (x != HTAB_EMPTY_ENTRY && x != HTAB_DELETED_ENTRY)
85 if (x != HTAB_EMPTY_ENTRY && x != HTAB_DELETED_ENTRY)
92 static inline unsigned int
95 return fn->last_stmt_uid;
102 fn->last_stmt_uid = maxid;
106 static inline unsigned int
109 return fn->last_stmt_uid++;
123 if (loc == UNKNOWN_LOCATION)
126 return LOCATION_LINE (loc);
134 if (linknode->
prev == NULL)
139 linknode->
prev = NULL;
140 linknode->
next = NULL;
149 linknode->
prev = list;
152 list->
next = linknode;
161 if (!def || TREE_CODE (def) != SSA_NAME)
162 linknode->
prev = NULL;
165 root = &(SSA_NAME_IMM_USE_NODE (def));
167 gcc_checking_assert (*(linknode->
use) == def);
198 gcc_checking_assert (*(old->
use) == *(node->
use));
235 imm->
end_p = &(SSA_NAME_IMM_USE_NODE (var));
237 #ifdef ENABLE_CHECKING
241 return NULL_USE_OPERAND_P;
251 #ifdef ENABLE_CHECKING
262 return NULL_USE_OPERAND_P;
278 if (ptr == ptr->
next)
283 if (!MAY_HAVE_DEBUG_STMTS)
296 if (ptr == ptr->
next)
304 if (!MAY_HAVE_DEBUG_STMTS)
319 if (ptr == ptr->
next)
322 *use_p = NULL_USE_OPERAND_P;
341 if (!MAY_HAVE_DEBUG_STMTS)
348 static inline unsigned int
353 unsigned int num = 0;
355 if (!MAY_HAVE_DEBUG_STMTS)
356 for (ptr = start->
next; ptr != start; ptr = ptr->
next)
359 for (ptr = start->
next; ptr != start; ptr = ptr->
next)
415 static inline source_location
423 static inline source_location
451 gcc_checking_assert (!(bb->
flags & BB_RTL));
458 gcc_checking_assert (!(bb->
flags & BB_RTL));
469 gcc_checking_assert (!(bb->
flags & BB_RTL));
489 phi = USE_STMT (use);
493 index = element - root;
497 gcc_checking_assert ((((
char *)element - (
char *)root)
510 return (TREE_STATIC (t) || DECL_EXTERNAL (t));
521 return (TREE_CODE (var) != CONST_DECL
522 && !((TREE_STATIC (var) || TREE_PUBLIC (var) || DECL_EXTERNAL (var))
523 && TREE_READONLY (var)
524 && !TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (var)))
525 && (TREE_PUBLIC (var)
526 || DECL_EXTERNAL (var)
527 || TREE_ADDRESSABLE (var)));
538 if (TREE_CODE (t) == SSA_NAME)
547 static inline struct loop *
578 use_p = USE_OP_PTR (ptr->
uses);
584 return PHI_ARG_DEF_PTR (ptr->
stmt, (ptr->
i)++);
587 return NULL_USE_OPERAND_P;
595 if (ptr->
flags & SSA_OP_VDEF)
598 ptr->
flags &= ~SSA_OP_VDEF;
603 if (ptr->
flags & SSA_OP_DEF)
611 if (TREE_CODE (*val) == TREE_LIST)
612 val = &TREE_VALUE (*val);
613 if (TREE_CODE (*val) == SSA_NAME
618 ptr->
flags &= ~SSA_OP_DEF;
622 return NULL_DEF_OPERAND_P;
633 val = USE_OP (ptr->
uses);
637 if (ptr->
flags & SSA_OP_VDEF)
639 ptr->
flags &= ~SSA_OP_VDEF;
643 if (ptr->
flags & SSA_OP_DEF)
651 if (TREE_CODE (val) == TREE_LIST)
652 val = TREE_VALUE (val);
653 if (TREE_CODE (val) == SSA_NAME
658 ptr->
flags &= ~SSA_OP_DEF;
689 gcc_checking_assert (
gimple_code (stmt) != GIMPLE_PHI
690 && (!(flags & SSA_OP_VDEF) || (flags & SSA_OP_DEF))
691 && (!(flags & SSA_OP_VUSE) || (flags & SSA_OP_USE)));
693 if (flags & (SSA_OP_DEF | SSA_OP_VDEF))
706 flags &= ~(SSA_OP_DEF | SSA_OP_VDEF);
711 if (!(flags & SSA_OP_VUSE)
727 gcc_checking_assert ((flags & SSA_OP_ALL_DEFS) == 0
728 && (flags & SSA_OP_USE));
739 gcc_checking_assert ((flags & SSA_OP_ALL_USES) == 0
740 && (flags & SSA_OP_DEF));
785 return NULL_USE_OPERAND_P;
789 return NULL_USE_OPERAND_P;
804 return NULL_DEF_OPERAND_P;
808 return NULL_DEF_OPERAND_P;
832 gcc_checking_assert (
gimple_code (stmt) != GIMPLE_PHI);
833 FOR_EACH_SSA_TREE_OPERAND (t, stmt, iter, flags)
849 FOR_EACH_PHI_OR_STMT_USE (use_p, stmt, iter, SSA_OP_ALL_USES)
878 gcc_checking_assert ((flags & (SSA_OP_USE | SSA_OP_VIRTUAL_USES)) != 0);
880 comp = (
is_gimple_reg (phi_def) ? SSA_OP_USE : SSA_OP_VIRTUAL_USES);
883 if ((flags & comp) == 0)
886 return NULL_USE_OPERAND_P;
902 tree phi_def = PHI_RESULT (phi);
908 gcc_checking_assert ((flags & (SSA_OP_DEF | SSA_OP_VIRTUAL_DEFS)) != 0);
910 comp = (
is_gimple_reg (phi_def) ? SSA_OP_DEF : SSA_OP_VIRTUAL_DEFS);
914 if ((flags & comp) == 0)
917 return NULL_DEF_OPERAND_P;
924 return PHI_RESULT_PTR (phi);
954 gcc_checking_assert (USE_FROM_PTR (use_p) == USE_FROM_PTR (head));
959 if (last_p->
next == use_p)
981 gimple head_stmt = USE_STMT (head);
982 tree use = USE_FROM_PTR (head);
987 flag = (
is_gimple_reg (use) ? SSA_OP_USE : SSA_OP_VIRTUAL_USES);
991 FOR_EACH_PHI_ARG (use_p, head_stmt, op_iter, flag)
992 if (USE_FROM_PTR (use_p) == use)
997 if (flag == SSA_OP_USE)
999 FOR_EACH_SSA_USE_OPERAND (use_p, head_stmt, op_iter, flag)
1000 if (USE_FROM_PTR (use_p) == use)
1003 else if ((use_p =
gimple_vuse_op (head_stmt)) != NULL_USE_OPERAND_P)
1005 if (USE_FROM_PTR (use_p) == use)
1019 imm->
end_p = &(SSA_NAME_IMM_USE_NODE (var));
1036 return USE_STMT (imm->
imm_use);
1053 return USE_STMT (imm->
imm_use);
1081 return NULL_USE_OPERAND_P;
1094 if (TREE_CODE (var) == SSA_NAME)
1095 var = SSA_NAME_VAR (var);
1097 return TREE_READONLY (var) && (TREE_STATIC (var) || DECL_EXTERNAL (var));
1109 if (TREE_CODE (ref) == ARRAY_REF)
1111 ref = TREE_OPERAND (ref, 0);
1124 if (TREE_CODE (ref) == VIEW_CONVERT_EXPR)
1126 ref = TREE_OPERAND (ref, 0);
1144 || pos1 < (pos2 + size2)))
1147 && (size1 == (
unsigned HOST_WIDE_INT)-1
1148 || pos2 < (pos1 + size1)))
1158 return &fun->gimple_df->ssa_operands;
1179 static inline source_location
1220 gcc_checking_assert (TYPE_P (type));
1222 SET_SSA_NAME_VAR_OR_IDENTIFIER (ssa_name,
get_identifier (name));
1246 switch (TREE_CODE (exp))
1250 HOST_WIDE_INT this_off = TREE_INT_CST_LOW (TREE_OPERAND (exp, 2));
1251 if (this_off % BITS_PER_UNIT)
1253 byte_offset += this_off / BITS_PER_UNIT;
1259 tree field = TREE_OPERAND (exp, 1);
1264 || TREE_CODE (this_offset) != INTEGER_CST
1265 || (TREE_INT_CST_LOW (DECL_FIELD_BIT_OFFSET (field))
1269 hthis_offset = TREE_INT_CST_LOW (this_offset);
1270 hthis_offset += (TREE_INT_CST_LOW (DECL_FIELD_BIT_OFFSET (field))
1272 byte_offset += hthis_offset;
1277 case ARRAY_RANGE_REF:
1279 tree index = TREE_OPERAND (exp, 1);
1280 tree low_bound, unit_size;
1283 && TREE_CODE (index) == SSA_NAME)
1284 index = (*valueize) (index);
1287 if (TREE_CODE (index) == INTEGER_CST
1289 TREE_CODE (low_bound) == INTEGER_CST)
1291 TREE_CODE (unit_size) == INTEGER_CST))
1295 hindex -= TREE_INT_CST_LOW (low_bound);
1296 hindex *= TREE_INT_CST_LOW (unit_size);
1297 byte_offset += hindex;
1308 byte_offset += TREE_INT_CST_LOW (TYPE_SIZE_UNIT (TREE_TYPE (exp)));
1311 case VIEW_CONVERT_EXPR:
1316 tree base = TREE_OPERAND (exp, 0);
1318 && TREE_CODE (base) == SSA_NAME)
1319 base = (*valueize) (base);
1322 if (TREE_CODE (base) == ADDR_EXPR)
1327 gcc_assert (off.
high == -1 || off.
high == 0);
1328 byte_offset += off.
to_shwi ();
1330 exp = TREE_OPERAND (base, 0);
1335 case TARGET_MEM_REF:
1337 tree base = TREE_OPERAND (exp, 0);
1339 && TREE_CODE (base) == SSA_NAME)
1340 base = (*valueize) (base);
1343 if (TREE_CODE (base) == ADDR_EXPR)
1345 if (TMR_INDEX (exp) || TMR_INDEX2 (exp))
1350 gcc_assert (off.
high == -1 || off.
high == 0);
1351 byte_offset += off.
to_shwi ();
1353 exp = TREE_OPERAND (base, 0);
1362 exp = TREE_OPERAND (exp, 0);
1366 *poffset = byte_offset;