Branch data Line data Source code
1 : : /* Gimple IR definitions.
2 : :
3 : : Copyright (C) 2007-2025 Free Software Foundation, Inc.
4 : : Contributed by Aldy Hernandez <aldyh@redhat.com>
5 : :
6 : : This file is part of GCC.
7 : :
8 : : GCC is free software; you can redistribute it and/or modify it under
9 : : the terms of the GNU General Public License as published by the Free
10 : : Software Foundation; either version 3, or (at your option) any later
11 : : version.
12 : :
13 : : GCC is distributed in the hope that it will be useful, but WITHOUT ANY
14 : : WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 : : FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 : : for more details.
17 : :
18 : : You should have received a copy of the GNU General Public License
19 : : along with GCC; see the file COPYING3. If not see
20 : : <http://www.gnu.org/licenses/>. */
21 : :
22 : : #ifndef GCC_GIMPLE_H
23 : : #define GCC_GIMPLE_H
24 : :
25 : : #include "tree-ssa-alias.h"
26 : : #include "gimple-expr.h"
27 : :
28 : : typedef gimple *gimple_seq_node;
29 : :
30 : : enum gimple_code {
31 : : #define DEFGSCODE(SYM, STRING, STRUCT) SYM,
32 : : #include "gimple.def"
33 : : #undef DEFGSCODE
34 : : LAST_AND_UNUSED_GIMPLE_CODE
35 : : };
36 : :
37 : : extern const char *const gimple_code_name[];
38 : : extern const unsigned char gimple_rhs_class_table[];
39 : :
40 : : /* Error out if a gimple tuple is addressed incorrectly. */
41 : : #if defined ENABLE_GIMPLE_CHECKING
42 : : #define gcc_gimple_checking_assert(EXPR) gcc_assert (EXPR)
43 : : extern void gimple_check_failed (const gimple *, const char *, int, \
44 : : const char *, enum gimple_code, \
45 : : enum tree_code) ATTRIBUTE_NORETURN \
46 : : ATTRIBUTE_COLD;
47 : :
48 : : #define GIMPLE_CHECK(GS, CODE) \
49 : : do { \
50 : : const gimple *__gs = (GS); \
51 : : if (gimple_code (__gs) != (CODE)) \
52 : : gimple_check_failed (__gs, __FILE__, __LINE__, __FUNCTION__, \
53 : : (CODE), ERROR_MARK); \
54 : : } while (0)
55 : : template <typename T>
56 : : inline T
57 : >11028*10^7 : GIMPLE_CHECK2(const gimple *gs,
58 : : #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)
59 : : const char *file = __builtin_FILE (),
60 : : int line = __builtin_LINE (),
61 : : const char *fun = __builtin_FUNCTION ())
62 : : #else
63 : : const char *file = __FILE__,
64 : : int line = __LINE__,
65 : : const char *fun = NULL)
66 : : #endif
67 : : {
68 : >11028*10^7 : T ret = dyn_cast <T> (gs);
69 : : if (!ret)
70 : 0 : gimple_check_failed (gs, file, line, fun,
71 : : std::remove_pointer<T>::type::code_, ERROR_MARK);
72 : >11028*10^7 : return ret;
73 : : }
74 : : template <typename T>
75 : : inline T
76 : 7138825201 : GIMPLE_CHECK2(gimple *gs,
77 : : #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)
78 : : const char *file = __builtin_FILE (),
79 : : int line = __builtin_LINE (),
80 : : const char *fun = __builtin_FUNCTION ())
81 : : #else
82 : : const char *file = __FILE__,
83 : : int line = __LINE__,
84 : : const char *fun = NULL)
85 : : #endif
86 : : {
87 : 7138825201 : T ret = dyn_cast <T> (gs);
88 : : if (!ret)
89 : 0 : gimple_check_failed (gs, file, line, fun,
90 : : std::remove_pointer<T>::type::code_, ERROR_MARK);
91 : 7138825201 : return ret;
92 : : }
93 : : #else /* not ENABLE_GIMPLE_CHECKING */
94 : : #define gcc_gimple_checking_assert(EXPR) ((void)(0 && (EXPR)))
95 : : #define GIMPLE_CHECK(GS, CODE) (void)0
96 : : template <typename T>
97 : : inline T
98 : : GIMPLE_CHECK2(gimple *gs)
99 : : {
100 : : return as_a <T> (gs);
101 : : }
102 : : template <typename T>
103 : : inline T
104 : : GIMPLE_CHECK2(const gimple *gs)
105 : : {
106 : : return as_a <T> (gs);
107 : : }
108 : : #endif
109 : :
110 : : /* Class of GIMPLE expressions suitable for the RHS of assignments. See
111 : : get_gimple_rhs_class. */
112 : : enum gimple_rhs_class
113 : : {
114 : : GIMPLE_INVALID_RHS, /* The expression cannot be used on the RHS. */
115 : : GIMPLE_TERNARY_RHS, /* The expression is a ternary operation. */
116 : : GIMPLE_BINARY_RHS, /* The expression is a binary operation. */
117 : : GIMPLE_UNARY_RHS, /* The expression is a unary operation. */
118 : : GIMPLE_SINGLE_RHS /* The expression is a single object (an SSA
119 : : name, a _DECL, a _REF, etc. */
120 : : };
121 : :
122 : : /* Specific flags for individual GIMPLE statements. These flags are
123 : : always stored in gimple.subcode and they may only be
124 : : defined for statement codes that do not use subcodes.
125 : :
126 : : Values for the masks can overlap as long as the overlapping values
127 : : are never used in the same statement class.
128 : :
129 : : The maximum mask value that can be defined is 1 << 15 (i.e., each
130 : : statement code can hold up to 16 bitflags).
131 : :
132 : : Keep this list sorted. */
133 : : enum gf_mask {
134 : : GF_ASM_BASIC = 1 << 0,
135 : : GF_ASM_VOLATILE = 1 << 1,
136 : : GF_ASM_INLINE = 1 << 2,
137 : : GF_CALL_FROM_THUNK = 1 << 0,
138 : : GF_CALL_RETURN_SLOT_OPT = 1 << 1,
139 : : GF_CALL_TAILCALL = 1 << 2,
140 : : GF_CALL_VA_ARG_PACK = 1 << 3,
141 : : GF_CALL_NOTHROW = 1 << 4,
142 : : GF_CALL_ALLOCA_FOR_VAR = 1 << 5,
143 : : GF_CALL_INTERNAL = 1 << 6,
144 : : GF_CALL_CTRL_ALTERING = 1 << 7,
145 : : GF_CALL_MUST_TAIL_CALL = 1 << 9,
146 : : GF_CALL_BY_DESCRIPTOR = 1 << 10,
147 : : GF_CALL_NOCF_CHECK = 1 << 11,
148 : : GF_CALL_FROM_NEW_OR_DELETE = 1 << 12,
149 : : GF_CALL_XTHROW = 1 << 13,
150 : : GF_OMP_PARALLEL_COMBINED = 1 << 0,
151 : : GF_OMP_TASK_TASKLOOP = 1 << 0,
152 : : GF_OMP_TASK_TASKWAIT = 1 << 1,
153 : : GF_OMP_FOR_KIND_MASK = (1 << 3) - 1,
154 : : GF_OMP_FOR_KIND_FOR = 0,
155 : : GF_OMP_FOR_KIND_DISTRIBUTE = 1,
156 : : GF_OMP_FOR_KIND_TASKLOOP = 2,
157 : : GF_OMP_FOR_KIND_OACC_LOOP = 4,
158 : : GF_OMP_FOR_KIND_SIMD = 5,
159 : : GF_OMP_FOR_COMBINED = 1 << 3,
160 : : GF_OMP_FOR_COMBINED_INTO = 1 << 4,
161 : : GF_OMP_TARGET_KIND_MASK = (1 << 5) - 1,
162 : : GF_OMP_TARGET_KIND_REGION = 0,
163 : : GF_OMP_TARGET_KIND_DATA = 1,
164 : : GF_OMP_TARGET_KIND_UPDATE = 2,
165 : : GF_OMP_TARGET_KIND_ENTER_DATA = 3,
166 : : GF_OMP_TARGET_KIND_EXIT_DATA = 4,
167 : : GF_OMP_TARGET_KIND_OACC_PARALLEL = 5,
168 : : GF_OMP_TARGET_KIND_OACC_KERNELS = 6,
169 : : GF_OMP_TARGET_KIND_OACC_SERIAL = 7,
170 : : GF_OMP_TARGET_KIND_OACC_DATA = 8,
171 : : GF_OMP_TARGET_KIND_OACC_UPDATE = 9,
172 : : GF_OMP_TARGET_KIND_OACC_ENTER_DATA = 10,
173 : : GF_OMP_TARGET_KIND_OACC_EXIT_DATA = 11,
174 : : GF_OMP_TARGET_KIND_OACC_DECLARE = 12,
175 : : GF_OMP_TARGET_KIND_OACC_HOST_DATA = 13,
176 : : /* A 'GF_OMP_TARGET_KIND_OACC_PARALLEL' representing an OpenACC 'kernels'
177 : : decomposed part, parallelized. */
178 : : GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_PARALLELIZED = 14,
179 : : /* A 'GF_OMP_TARGET_KIND_OACC_PARALLEL' representing an OpenACC 'kernels'
180 : : decomposed part, "gang-single". */
181 : : GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_GANG_SINGLE = 15,
182 : : /* A 'GF_OMP_TARGET_KIND_OACC_DATA' representing an OpenACC 'kernels'
183 : : decomposed parts' 'data' construct. */
184 : : GF_OMP_TARGET_KIND_OACC_DATA_KERNELS = 16,
185 : : GF_OMP_TEAMS_HOST = 1 << 0,
186 : :
187 : : /* True on an GIMPLE_OMP_RETURN statement if the return does not require
188 : : a thread synchronization via some sort of barrier. The exact barrier
189 : : that would otherwise be emitted is dependent on the OMP statement with
190 : : which this return is associated. */
191 : : GF_OMP_RETURN_NOWAIT = 1 << 0,
192 : :
193 : : GF_OMP_SECTION_LAST = 1 << 0,
194 : : GF_OMP_ORDERED_STANDALONE = 1 << 0,
195 : : GF_OMP_ATOMIC_MEMORY_ORDER = (1 << 6) - 1,
196 : : GF_OMP_ATOMIC_NEED_VALUE = 1 << 6,
197 : : GF_OMP_ATOMIC_WEAK = 1 << 7,
198 : : GF_PREDICT_TAKEN = 1 << 15
199 : : };
200 : :
201 : : /* This subcode tells apart different kinds of stmts that are not used
202 : : for codegen, but rather to retain debug information. */
203 : : enum gimple_debug_subcode {
204 : : GIMPLE_DEBUG_BIND = 0,
205 : : GIMPLE_DEBUG_SOURCE_BIND = 1,
206 : : GIMPLE_DEBUG_BEGIN_STMT = 2,
207 : : GIMPLE_DEBUG_INLINE_ENTRY = 3
208 : : };
209 : :
210 : : /* Masks for selecting a pass local flag (PLF) to work on. These
211 : : masks are used by gimple_set_plf and gimple_plf. */
212 : : enum plf_mask {
213 : : GF_PLF_1 = 1 << 0,
214 : : GF_PLF_2 = 1 << 1
215 : : };
216 : :
217 : : /* Data structure definitions for GIMPLE tuples. NOTE: word markers
218 : : are for 64 bit hosts. */
219 : :
220 : : struct GTY((desc ("gimple_statement_structure (&%h)"), tag ("GSS_BASE"),
221 : : chain_next ("%h.next"), variable_size))
222 : : gimple
223 : : {
224 : : /* [ WORD 1 ]
225 : : Main identifying code for a tuple. */
226 : : ENUM_BITFIELD(gimple_code) code : 8;
227 : :
228 : : /* Nonzero if a warning should not be emitted on this tuple. */
229 : : unsigned int no_warning : 1;
230 : :
231 : : /* Nonzero if this tuple has been visited. Passes are responsible
232 : : for clearing this bit before using it. */
233 : : unsigned int visited : 1;
234 : :
235 : : /* Nonzero if this tuple represents a non-temporal move; currently
236 : : only stores are supported. */
237 : : unsigned int nontemporal_move : 1;
238 : :
239 : : /* Pass local flags. These flags are free for any pass to use as
240 : : they see fit. Passes should not assume that these flags contain
241 : : any useful value when the pass starts. Any initial state that
242 : : the pass requires should be set on entry to the pass. See
243 : : gimple_set_plf and gimple_plf for usage. */
244 : : unsigned int plf : 2;
245 : :
246 : : /* Nonzero if this statement has been modified and needs to have its
247 : : operands rescanned. */
248 : : unsigned modified : 1;
249 : :
250 : : /* Nonzero if this statement contains volatile operands. */
251 : : unsigned has_volatile_ops : 1;
252 : :
253 : : /* Padding to get subcode to 16 bit alignment. */
254 : : unsigned pad : 1;
255 : :
256 : : /* The SUBCODE field can be used for tuple-specific flags for tuples
257 : : that do not require subcodes. Note that SUBCODE should be at
258 : : least as wide as tree codes, as several tuples store tree codes
259 : : in there. */
260 : : unsigned int subcode : 16;
261 : :
262 : : /* UID of this statement. This is used by passes that want to assign IDs
263 : : to statements. It must be assigned and used by each pass. By default
264 : : it should be assumed to contain garbage. */
265 : : unsigned uid;
266 : :
267 : : /* [ WORD 2 ]
268 : : Number of operands in this tuple. */
269 : : unsigned num_ops;
270 : :
271 : : /* Unused 32 bits padding on 64-bit hosts. */
272 : :
273 : : /* [ WORD 3 ]
274 : : Locus information for debug info. */
275 : : location_t location;
276 : :
277 : : /* [ WORD 4 ]
278 : : Basic block holding this statement. */
279 : : basic_block bb;
280 : :
281 : : /* [ WORD 5-6 ]
282 : : Linked lists of gimple statements. The next pointers form
283 : : a NULL terminated list, the prev pointers are a cyclic list.
284 : : A gimple statement is hence also a double-ended list of
285 : : statements, with the pointer itself being the first element,
286 : : and the prev pointer being the last. */
287 : : gimple *next;
288 : : gimple *GTY((skip)) prev;
289 : : };
290 : :
291 : :
292 : : /* Base structure for tuples with operands. */
293 : :
294 : : /* This gimple subclass has no tag value. */
295 : : struct GTY(())
296 : : gimple_statement_with_ops_base : public gimple
297 : : {
298 : : /* [ WORD 1-6 ] : base class */
299 : :
300 : : /* [ WORD 7 ]
301 : : SSA operand vectors. NOTE: It should be possible to
302 : : amalgamate these vectors with the operand vector OP. However,
303 : : the SSA operand vectors are organized differently and contain
304 : : more information (like immediate use chaining). */
305 : : struct use_optype_d GTY((skip (""))) *use_ops;
306 : : };
307 : :
308 : :
309 : : /* Statements that take register operands. */
310 : :
311 : : struct GTY((tag("GSS_WITH_OPS")))
312 : : gimple_statement_with_ops : public gimple_statement_with_ops_base
313 : : {
314 : : /* [ WORD 1-7 ] : base class */
315 : :
316 : : /* [ WORD 8 ]
317 : : Operand vector. NOTE! This must always be the last field
318 : : of this structure. In particular, this means that this
319 : : structure cannot be embedded inside another one. */
320 : : tree GTY((length ("%h.num_ops"))) op[1];
321 : : };
322 : :
323 : :
324 : : /* Base for statements that take both memory and register operands. */
325 : :
326 : : struct GTY((tag("GSS_WITH_MEM_OPS_BASE")))
327 : : gimple_statement_with_memory_ops_base : public gimple_statement_with_ops_base
328 : : {
329 : : /* [ WORD 1-7 ] : base class */
330 : :
331 : : /* [ WORD 8-9 ]
332 : : Virtual operands for this statement. The GC will pick them
333 : : up via the ssa_names array. */
334 : : tree GTY((skip (""))) vdef;
335 : : tree GTY((skip (""))) vuse;
336 : : };
337 : :
338 : :
339 : : /* Statements that take both memory and register operands. */
340 : :
341 : : struct GTY((tag("GSS_WITH_MEM_OPS")))
342 : : gimple_statement_with_memory_ops :
343 : : public gimple_statement_with_memory_ops_base
344 : : {
345 : : /* [ WORD 1-9 ] : base class */
346 : :
347 : : /* [ WORD 10 ]
348 : : Operand vector. NOTE! This must always be the last field
349 : : of this structure. In particular, this means that this
350 : : structure cannot be embedded inside another one. */
351 : : tree GTY((length ("%h.num_ops"))) op[1];
352 : : };
353 : :
354 : :
355 : : /* Call statements that take both memory and register operands. */
356 : :
357 : : struct GTY((tag("GSS_CALL")))
358 : : gcall : public gimple_statement_with_memory_ops_base
359 : : {
360 : : /* [ WORD 1-9 ] : base class */
361 : :
362 : : /* [ WORD 10-13 ] */
363 : : struct pt_solution call_used;
364 : : struct pt_solution call_clobbered;
365 : :
366 : : /* [ WORD 14 ] */
367 : : union GTY ((desc ("%1.subcode & GF_CALL_INTERNAL"))) {
368 : : tree GTY ((tag ("0"))) fntype;
369 : : enum internal_fn GTY ((tag ("GF_CALL_INTERNAL"))) internal_fn;
370 : : } u;
371 : :
372 : : /* [ WORD 15 ]
373 : : Operand vector. NOTE! This must always be the last field
374 : : of this structure. In particular, this means that this
375 : : structure cannot be embedded inside another one. */
376 : : tree GTY((length ("%h.num_ops"))) op[1];
377 : :
378 : : static const enum gimple_code code_ = GIMPLE_CALL;
379 : : };
380 : :
381 : :
382 : : /* OMP statements. */
383 : :
384 : : struct GTY((tag("GSS_OMP")))
385 : : gimple_statement_omp : public gimple
386 : : {
387 : : /* [ WORD 1-6 ] : base class */
388 : :
389 : : /* [ WORD 7 ] */
390 : : gimple_seq body;
391 : : };
392 : :
393 : :
394 : : /* GIMPLE_BIND */
395 : :
396 : : struct GTY((tag("GSS_BIND")))
397 : : gbind : public gimple
398 : : {
399 : : /* [ WORD 1-6 ] : base class */
400 : :
401 : : /* [ WORD 7 ]
402 : : Variables declared in this scope. */
403 : : tree vars;
404 : :
405 : : /* [ WORD 8 ]
406 : : This is different than the BLOCK field in gimple,
407 : : which is analogous to TREE_BLOCK (i.e., the lexical block holding
408 : : this statement). This field is the equivalent of BIND_EXPR_BLOCK
409 : : in tree land (i.e., the lexical scope defined by this bind). See
410 : : gimple-low.cc. */
411 : : tree block;
412 : :
413 : : /* [ WORD 9 ] */
414 : : gimple_seq body;
415 : : };
416 : :
417 : :
418 : : /* GIMPLE_CATCH */
419 : :
420 : : struct GTY((tag("GSS_CATCH")))
421 : : gcatch : public gimple
422 : : {
423 : : /* [ WORD 1-6 ] : base class */
424 : :
425 : : /* [ WORD 7 ] */
426 : : tree types;
427 : :
428 : : /* [ WORD 8 ] */
429 : : gimple_seq handler;
430 : : };
431 : :
432 : :
433 : : /* GIMPLE_EH_FILTER */
434 : :
435 : : struct GTY((tag("GSS_EH_FILTER")))
436 : : geh_filter : public gimple
437 : : {
438 : : /* [ WORD 1-6 ] : base class */
439 : :
440 : : /* [ WORD 7 ]
441 : : Filter types. */
442 : : tree types;
443 : :
444 : : /* [ WORD 8 ]
445 : : Failure actions. */
446 : : gimple_seq failure;
447 : : };
448 : :
449 : : /* GIMPLE_EH_ELSE */
450 : :
451 : : struct GTY((tag("GSS_EH_ELSE")))
452 : : geh_else : public gimple
453 : : {
454 : : /* [ WORD 1-6 ] : base class */
455 : :
456 : : /* [ WORD 7,8 ] */
457 : : gimple_seq n_body, e_body;
458 : : };
459 : :
460 : : /* GIMPLE_EH_MUST_NOT_THROW */
461 : :
462 : : struct GTY((tag("GSS_EH_MNT")))
463 : : geh_mnt : public gimple
464 : : {
465 : : /* [ WORD 1-6 ] : base class */
466 : :
467 : : /* [ WORD 7 ] Abort function decl. */
468 : : tree fndecl;
469 : : };
470 : :
471 : : /* GIMPLE_PHI */
472 : :
473 : : struct GTY((tag("GSS_PHI")))
474 : : gphi : public gimple
475 : : {
476 : : /* [ WORD 1-6 ] : base class */
477 : :
478 : : /* [ WORD 7 ] */
479 : : unsigned capacity;
480 : : unsigned nargs;
481 : :
482 : : /* [ WORD 8 ] */
483 : : tree result;
484 : :
485 : : /* [ WORD 9-14 ] */
486 : : struct phi_arg_d GTY ((length ("%h.nargs"))) args[1];
487 : : };
488 : :
489 : :
490 : : /* GIMPLE_RESX, GIMPLE_EH_DISPATCH */
491 : :
492 : : struct GTY((tag("GSS_EH_CTRL")))
493 : : gimple_statement_eh_ctrl : public gimple
494 : : {
495 : : /* [ WORD 1-6 ] : base class */
496 : :
497 : : /* [ WORD 7 ]
498 : : Exception region number. */
499 : : int region;
500 : : };
501 : :
502 : : struct GTY((tag("GSS_EH_CTRL")))
503 : : gresx : public gimple_statement_eh_ctrl
504 : : {
505 : : /* No extra fields; adds invariant:
506 : : stmt->code == GIMPLE_RESX. */
507 : : };
508 : :
509 : : struct GTY((tag("GSS_EH_CTRL")))
510 : : geh_dispatch : public gimple_statement_eh_ctrl
511 : : {
512 : : /* No extra fields; adds invariant:
513 : : stmt->code == GIMPLE_EH_DISPATH. */
514 : : };
515 : :
516 : :
517 : : /* GIMPLE_TRY */
518 : :
519 : : struct GTY((tag("GSS_TRY")))
520 : : gtry : public gimple
521 : : {
522 : : /* [ WORD 1-6 ] : base class */
523 : :
524 : : /* [ WORD 7 ]
525 : : Expression to evaluate. */
526 : : gimple_seq eval;
527 : :
528 : : /* [ WORD 8 ]
529 : : Cleanup expression. */
530 : : gimple_seq cleanup;
531 : : };
532 : :
533 : : /* Kind of GIMPLE_TRY statements. */
534 : : enum gimple_try_flags
535 : : {
536 : : /* A try/catch. */
537 : : GIMPLE_TRY_CATCH = 1 << 0,
538 : :
539 : : /* A try/finally. */
540 : : GIMPLE_TRY_FINALLY = 1 << 1,
541 : : GIMPLE_TRY_KIND = GIMPLE_TRY_CATCH | GIMPLE_TRY_FINALLY,
542 : :
543 : : /* Analogous to TRY_CATCH_IS_CLEANUP. */
544 : : GIMPLE_TRY_CATCH_IS_CLEANUP = 1 << 2
545 : : };
546 : :
547 : : /* GIMPLE_WITH_CLEANUP_EXPR */
548 : :
549 : : struct GTY((tag("GSS_WCE")))
550 : : gimple_statement_wce : public gimple
551 : : {
552 : : /* [ WORD 1-6 ] : base class */
553 : :
554 : : /* Subcode: CLEANUP_EH_ONLY. True if the cleanup should only be
555 : : executed if an exception is thrown, not on normal exit of its
556 : : scope. This flag is analogous to the CLEANUP_EH_ONLY flag
557 : : in TARGET_EXPRs. */
558 : :
559 : : /* [ WORD 7 ]
560 : : Cleanup expression. */
561 : : gimple_seq cleanup;
562 : : };
563 : :
564 : :
565 : : /* GIMPLE_ASM */
566 : :
567 : : struct GTY((tag("GSS_ASM")))
568 : : gasm : public gimple_statement_with_memory_ops_base
569 : : {
570 : : /* [ WORD 1-9 ] : base class */
571 : :
572 : : /* [ WORD 10 ]
573 : : __asm__ statement. */
574 : : const char *string;
575 : :
576 : : /* [ WORD 11 ]
577 : : Number of inputs, outputs, clobbers, labels. */
578 : : unsigned char ni;
579 : : unsigned char no;
580 : : unsigned char nc;
581 : : unsigned char nl;
582 : :
583 : : /* [ WORD 12 ]
584 : : Operand vector. NOTE! This must always be the last field
585 : : of this structure. In particular, this means that this
586 : : structure cannot be embedded inside another one. */
587 : : tree GTY((length ("%h.num_ops"))) op[1];
588 : : };
589 : :
590 : : /* GIMPLE_OMP_CRITICAL */
591 : :
592 : : struct GTY((tag("GSS_OMP_CRITICAL")))
593 : : gomp_critical : public gimple_statement_omp
594 : : {
595 : : /* [ WORD 1-7 ] : base class */
596 : :
597 : : /* [ WORD 8 ] */
598 : : tree clauses;
599 : :
600 : : /* [ WORD 9 ]
601 : : Critical section name. */
602 : : tree name;
603 : : };
604 : :
605 : :
606 : : struct GTY(()) gimple_omp_for_iter {
607 : : /* Condition code. */
608 : : enum tree_code cond;
609 : :
610 : : /* Index variable. */
611 : : tree index;
612 : :
613 : : /* Initial value. */
614 : : tree initial;
615 : :
616 : : /* Final value. */
617 : : tree final;
618 : :
619 : : /* Increment. */
620 : : tree incr;
621 : : };
622 : :
623 : : /* GIMPLE_OMP_FOR */
624 : :
625 : : struct GTY((tag("GSS_OMP_FOR")))
626 : : gomp_for : public gimple_statement_omp
627 : : {
628 : : /* [ WORD 1-7 ] : base class */
629 : :
630 : : /* [ WORD 8 ] */
631 : : tree clauses;
632 : :
633 : : /* [ WORD 9 ]
634 : : Number of elements in iter array. */
635 : : size_t collapse;
636 : :
637 : : /* [ WORD 10 ] */
638 : : struct gimple_omp_for_iter * GTY((length ("%h.collapse"))) iter;
639 : :
640 : : /* [ WORD 11 ]
641 : : Pre-body evaluated before the loop body begins. */
642 : : gimple_seq pre_body;
643 : : };
644 : :
645 : :
646 : : /* GIMPLE_OMP_PARALLEL, GIMPLE_OMP_TARGET, GIMPLE_OMP_TASK, GIMPLE_OMP_TEAMS */
647 : :
648 : : struct GTY((tag("GSS_OMP_PARALLEL_LAYOUT")))
649 : : gimple_statement_omp_parallel_layout : public gimple_statement_omp
650 : : {
651 : : /* [ WORD 1-7 ] : base class */
652 : :
653 : : /* [ WORD 8 ]
654 : : Clauses. */
655 : : tree clauses;
656 : :
657 : : /* [ WORD 9 ]
658 : : Child function holding the body of the parallel region. */
659 : : tree child_fn;
660 : :
661 : : /* [ WORD 10 ]
662 : : Shared data argument. */
663 : : tree data_arg;
664 : : };
665 : :
666 : : /* GIMPLE_OMP_PARALLEL or GIMPLE_TASK */
667 : : struct GTY((tag("GSS_OMP_PARALLEL_LAYOUT")))
668 : : gimple_statement_omp_taskreg : public gimple_statement_omp_parallel_layout
669 : : {
670 : : /* No extra fields; adds invariant:
671 : : stmt->code == GIMPLE_OMP_PARALLEL
672 : : || stmt->code == GIMPLE_OMP_TASK
673 : : || stmt->code == GIMPLE_OMP_TEAMS. */
674 : : };
675 : :
676 : : /* GIMPLE_OMP_PARALLEL */
677 : : struct GTY((tag("GSS_OMP_PARALLEL_LAYOUT")))
678 : : gomp_parallel : public gimple_statement_omp_taskreg
679 : : {
680 : : /* No extra fields; adds invariant:
681 : : stmt->code == GIMPLE_OMP_PARALLEL. */
682 : : };
683 : :
684 : : /* GIMPLE_OMP_TARGET */
685 : : struct GTY((tag("GSS_OMP_TARGET")))
686 : : gomp_target : public gimple_statement_omp_parallel_layout
687 : : {
688 : : /* [ WORD 1-10 ] : base class */
689 : :
690 : : /* [ WORD 11 ]
691 : : Iterator loops. */
692 : : gimple_seq iterator_loops;
693 : : };
694 : :
695 : : /* GIMPLE_OMP_TASK */
696 : :
697 : : struct GTY((tag("GSS_OMP_TASK")))
698 : : gomp_task : public gimple_statement_omp_taskreg
699 : : {
700 : : /* [ WORD 1-10 ] : base class */
701 : :
702 : : /* [ WORD 11 ]
703 : : Child function holding firstprivate initialization if needed. */
704 : : tree copy_fn;
705 : :
706 : : /* [ WORD 12-13 ]
707 : : Size and alignment in bytes of the argument data block. */
708 : : tree arg_size;
709 : : tree arg_align;
710 : : };
711 : :
712 : :
713 : : /* GIMPLE_OMP_SECTION */
714 : : /* Uses struct gimple_statement_omp. */
715 : :
716 : :
717 : : /* GIMPLE_OMP_SECTIONS */
718 : :
719 : : struct GTY((tag("GSS_OMP_SECTIONS")))
720 : : gomp_sections : public gimple_statement_omp
721 : : {
722 : : /* [ WORD 1-7 ] : base class */
723 : :
724 : : /* [ WORD 8 ] */
725 : : tree clauses;
726 : :
727 : : /* [ WORD 9 ]
728 : : The control variable used for deciding which of the sections to
729 : : execute. */
730 : : tree control;
731 : : };
732 : :
733 : : /* GIMPLE_OMP_CONTINUE.
734 : :
735 : : Note: This does not inherit from gimple_statement_omp, because we
736 : : do not need the body field. */
737 : :
738 : : struct GTY((tag("GSS_OMP_CONTINUE")))
739 : : gomp_continue : public gimple
740 : : {
741 : : /* [ WORD 1-6 ] : base class */
742 : :
743 : : /* [ WORD 7 ] */
744 : : tree control_def;
745 : :
746 : : /* [ WORD 8 ] */
747 : : tree control_use;
748 : : };
749 : :
750 : : /* GIMPLE_OMP_SINGLE, GIMPLE_OMP_ORDERED, GIMPLE_OMP_TASKGROUP,
751 : : GIMPLE_OMP_SCAN, GIMPLE_OMP_MASKED, GIMPLE_OMP_SCOPE, GIMPLE_OMP_DISPATCH,
752 : : GIMPLE_OMP_INTEROP. */
753 : :
754 : : struct GTY((tag("GSS_OMP_SINGLE_LAYOUT")))
755 : : gimple_statement_omp_single_layout : public gimple_statement_omp
756 : : {
757 : : /* [ WORD 1-7 ] : base class */
758 : :
759 : : /* [ WORD 8 ] */
760 : : tree clauses;
761 : : };
762 : :
763 : : struct GTY((tag("GSS_OMP_SINGLE_LAYOUT")))
764 : : gomp_single : public gimple_statement_omp_single_layout
765 : : {
766 : : /* No extra fields; adds invariant:
767 : : stmt->code == GIMPLE_OMP_SINGLE. */
768 : : };
769 : :
770 : : struct GTY((tag("GSS_OMP_PARALLEL_LAYOUT")))
771 : : gomp_teams : public gimple_statement_omp_taskreg
772 : : {
773 : : /* No extra fields; adds invariant:
774 : : stmt->code == GIMPLE_OMP_TEAMS. */
775 : : };
776 : :
777 : : struct GTY((tag("GSS_OMP_SINGLE_LAYOUT")))
778 : : gomp_ordered : public gimple_statement_omp_single_layout
779 : : {
780 : : /* No extra fields; adds invariant:
781 : : stmt->code == GIMPLE_OMP_ORDERED. */
782 : : };
783 : :
784 : : struct GTY((tag("GSS_OMP_SINGLE_LAYOUT")))
785 : : gomp_scan : public gimple_statement_omp_single_layout
786 : : {
787 : : /* No extra fields; adds invariant:
788 : : stmt->code == GIMPLE_OMP_SCAN. */
789 : : };
790 : :
791 : :
792 : : /* GIMPLE_OMP_ATOMIC_LOAD.
793 : : Note: This is based on gimple, not g_s_omp, because g_s_omp
794 : : contains a sequence, which we don't need here. */
795 : :
796 : : struct GTY((tag("GSS_OMP_ATOMIC_LOAD")))
797 : : gomp_atomic_load : public gimple
798 : : {
799 : : /* [ WORD 1-6 ] : base class */
800 : :
801 : : /* [ WORD 7-8 ] */
802 : : tree rhs, lhs;
803 : : };
804 : :
805 : : /* GIMPLE_OMP_ATOMIC_STORE.
806 : : See note on GIMPLE_OMP_ATOMIC_LOAD. */
807 : :
808 : : struct GTY((tag("GSS_OMP_ATOMIC_STORE_LAYOUT")))
809 : : gimple_statement_omp_atomic_store_layout : public gimple
810 : : {
811 : : /* [ WORD 1-6 ] : base class */
812 : :
813 : : /* [ WORD 7 ] */
814 : : tree val;
815 : : };
816 : :
817 : : struct GTY((tag("GSS_OMP_ATOMIC_STORE_LAYOUT")))
818 : : gomp_atomic_store :
819 : : public gimple_statement_omp_atomic_store_layout
820 : : {
821 : : /* No extra fields; adds invariant:
822 : : stmt->code == GIMPLE_OMP_ATOMIC_STORE. */
823 : : };
824 : :
825 : : struct GTY((tag("GSS_OMP_ATOMIC_STORE_LAYOUT")))
826 : : gimple_statement_omp_return :
827 : : public gimple_statement_omp_atomic_store_layout
828 : : {
829 : : /* No extra fields; adds invariant:
830 : : stmt->code == GIMPLE_OMP_RETURN. */
831 : : };
832 : :
833 : : /* Assumptions. */
834 : :
835 : : struct GTY((tag("GSS_ASSUME")))
836 : : gimple_statement_assume : public gimple
837 : : {
838 : : /* [ WORD 1-6 ] : base class */
839 : :
840 : : /* [ WORD 7 ] */
841 : : tree guard;
842 : :
843 : : /* [ WORD 8 ] */
844 : : gimple_seq body;
845 : : };
846 : :
847 : : /* GIMPLE_TRANSACTION. */
848 : :
849 : : /* Bits to be stored in the GIMPLE_TRANSACTION subcode. */
850 : :
851 : : /* The __transaction_atomic was declared [[outer]] or it is
852 : : __transaction_relaxed. */
853 : : #define GTMA_IS_OUTER (1u << 0)
854 : : #define GTMA_IS_RELAXED (1u << 1)
855 : : #define GTMA_DECLARATION_MASK (GTMA_IS_OUTER | GTMA_IS_RELAXED)
856 : :
857 : : /* The transaction is seen to not have an abort. */
858 : : #define GTMA_HAVE_ABORT (1u << 2)
859 : : /* The transaction is seen to have loads or stores. */
860 : : #define GTMA_HAVE_LOAD (1u << 3)
861 : : #define GTMA_HAVE_STORE (1u << 4)
862 : : /* The transaction MAY enter serial irrevocable mode in its dynamic scope. */
863 : : #define GTMA_MAY_ENTER_IRREVOCABLE (1u << 5)
864 : : /* The transaction WILL enter serial irrevocable mode.
865 : : An irrevocable block post-dominates the entire transaction, such
866 : : that all invocations of the transaction will go serial-irrevocable.
867 : : In such case, we don't bother instrumenting the transaction, and
868 : : tell the runtime that it should begin the transaction in
869 : : serial-irrevocable mode. */
870 : : #define GTMA_DOES_GO_IRREVOCABLE (1u << 6)
871 : : /* The transaction contains no instrumentation code whatsoever, most
872 : : likely because it is guaranteed to go irrevocable upon entry. */
873 : : #define GTMA_HAS_NO_INSTRUMENTATION (1u << 7)
874 : :
875 : : struct GTY((tag("GSS_TRANSACTION")))
876 : : gtransaction : public gimple_statement_with_memory_ops_base
877 : : {
878 : : /* [ WORD 1-9 ] : base class */
879 : :
880 : : /* [ WORD 10 ] */
881 : : gimple_seq body;
882 : :
883 : : /* [ WORD 11-13 ] */
884 : : tree label_norm;
885 : : tree label_uninst;
886 : : tree label_over;
887 : : };
888 : :
889 : : #define DEFGSSTRUCT(SYM, STRUCT, HAS_TREE_OP) SYM,
890 : : enum gimple_statement_structure_enum {
891 : : #include "gsstruct.def"
892 : : LAST_GSS_ENUM
893 : : };
894 : : #undef DEFGSSTRUCT
895 : :
896 : : /* A statement with the invariant that
897 : : stmt->code == GIMPLE_COND
898 : : i.e. a conditional jump statement. */
899 : :
900 : : struct GTY((tag("GSS_WITH_OPS")))
901 : : gcond : public gimple_statement_with_ops
902 : : {
903 : : /* no additional fields; this uses the layout for GSS_WITH_OPS. */
904 : : static const enum gimple_code code_ = GIMPLE_COND;
905 : : };
906 : :
907 : : /* A statement with the invariant that
908 : : stmt->code == GIMPLE_DEBUG
909 : : i.e. a debug statement. */
910 : :
911 : : struct GTY((tag("GSS_WITH_OPS")))
912 : : gdebug : public gimple_statement_with_ops
913 : : {
914 : : /* no additional fields; this uses the layout for GSS_WITH_OPS. */
915 : : };
916 : :
917 : : /* A statement with the invariant that
918 : : stmt->code == GIMPLE_GOTO
919 : : i.e. a goto statement. */
920 : :
921 : : struct GTY((tag("GSS_WITH_OPS")))
922 : : ggoto : public gimple_statement_with_ops
923 : : {
924 : : /* no additional fields; this uses the layout for GSS_WITH_OPS. */
925 : : };
926 : :
927 : : /* A statement with the invariant that
928 : : stmt->code == GIMPLE_LABEL
929 : : i.e. a label statement. */
930 : :
931 : : struct GTY((tag("GSS_WITH_OPS")))
932 : : glabel : public gimple_statement_with_ops
933 : : {
934 : : /* no additional fields; this uses the layout for GSS_WITH_OPS. */
935 : : };
936 : :
937 : : /* A statement with the invariant that
938 : : stmt->code == GIMPLE_SWITCH
939 : : i.e. a switch statement. */
940 : :
941 : : struct GTY((tag("GSS_WITH_OPS")))
942 : : gswitch : public gimple_statement_with_ops
943 : : {
944 : : /* no additional fields; this uses the layout for GSS_WITH_OPS. */
945 : : };
946 : :
947 : : /* A statement with the invariant that
948 : : stmt->code == GIMPLE_ASSIGN
949 : : i.e. an assignment statement. */
950 : :
951 : : struct GTY((tag("GSS_WITH_MEM_OPS")))
952 : : gassign : public gimple_statement_with_memory_ops
953 : : {
954 : : static const enum gimple_code code_ = GIMPLE_ASSIGN;
955 : : /* no additional fields; this uses the layout for GSS_WITH_MEM_OPS. */
956 : : };
957 : :
958 : : /* A statement with the invariant that
959 : : stmt->code == GIMPLE_RETURN
960 : : i.e. a return statement. */
961 : :
962 : : struct GTY((tag("GSS_WITH_MEM_OPS")))
963 : : greturn : public gimple_statement_with_memory_ops
964 : : {
965 : : /* no additional fields; this uses the layout for GSS_WITH_MEM_OPS. */
966 : : };
967 : :
968 : : template <>
969 : : template <>
970 : : inline bool
971 : 91044561 : is_a_helper <gasm *>::test (gimple *gs)
972 : : {
973 : 91044561 : return gs->code == GIMPLE_ASM;
974 : : }
975 : :
976 : : template <>
977 : : template <>
978 : : inline bool
979 : 12958703087 : is_a_helper <gassign *>::test (gimple *gs)
980 : : {
981 : 12958599926 : return gs->code == GIMPLE_ASSIGN;
982 : : }
983 : :
984 : : template <>
985 : : template <>
986 : : inline bool
987 : 75597126738 : is_a_helper <const gassign *>::test (const gimple *gs)
988 : : {
989 : 75597126738 : return gs->code == GIMPLE_ASSIGN;
990 : : }
991 : :
992 : : template <>
993 : : template <>
994 : : inline bool
995 : 43217599 : is_a_helper <gbind *>::test (gimple *gs)
996 : : {
997 : 43217599 : return gs->code == GIMPLE_BIND;
998 : : }
999 : :
1000 : : template <>
1001 : : template <>
1002 : : inline bool
1003 : 17069633996 : is_a_helper <gcall *>::test (gimple *gs)
1004 : : {
1005 : 17069633996 : return gs->code == GIMPLE_CALL;
1006 : : }
1007 : :
1008 : : template <>
1009 : : template <>
1010 : : inline bool
1011 : 515086 : is_a_helper <gcatch *>::test (gimple *gs)
1012 : : {
1013 : 515086 : return gs->code == GIMPLE_CATCH;
1014 : : }
1015 : :
1016 : : template <>
1017 : : template <>
1018 : : inline bool
1019 : 2712785424 : is_a_helper <gcond *>::test (gimple *gs)
1020 : : {
1021 : 2712785424 : return gs->code == GIMPLE_COND;
1022 : : }
1023 : :
1024 : : template <>
1025 : : template <>
1026 : : inline bool
1027 : 2007884829 : is_a_helper <const gcond *>::test (const gimple *gs)
1028 : : {
1029 : 2007884829 : return gs->code == GIMPLE_COND;
1030 : : }
1031 : :
1032 : : template <>
1033 : : template <>
1034 : : inline bool
1035 : 78365112 : is_a_helper <gdebug *>::test (gimple *gs)
1036 : : {
1037 : 78365112 : return gs->code == GIMPLE_DEBUG;
1038 : : }
1039 : :
1040 : : template <>
1041 : : template <>
1042 : : inline bool
1043 : 34271 : is_a_helper <const gdebug *>::test (const gimple *gs)
1044 : : {
1045 : 34271 : return gs->code == GIMPLE_DEBUG;
1046 : : }
1047 : :
1048 : : template <>
1049 : : template <>
1050 : : inline bool
1051 : 37324268 : is_a_helper <ggoto *>::test (gimple *gs)
1052 : : {
1053 : 37324268 : return gs->code == GIMPLE_GOTO;
1054 : : }
1055 : :
1056 : : template <>
1057 : : template <>
1058 : : inline bool
1059 : 3755 : is_a_helper <const ggoto *>::test (const gimple *gs)
1060 : : {
1061 : 3755 : return gs->code == GIMPLE_GOTO;
1062 : : }
1063 : :
1064 : : template <>
1065 : : template <>
1066 : : inline bool
1067 : 14516363041 : is_a_helper <glabel *>::test (gimple *gs)
1068 : : {
1069 : 14516363041 : return gs->code == GIMPLE_LABEL;
1070 : : }
1071 : :
1072 : : template <>
1073 : : template <>
1074 : : inline bool
1075 : 35020 : is_a_helper <const glabel *>::test (const gimple *gs)
1076 : : {
1077 : 35020 : return gs->code == GIMPLE_LABEL;
1078 : : }
1079 : :
1080 : : template <>
1081 : : template <>
1082 : : inline bool
1083 : 9597284 : is_a_helper <gresx *>::test (gimple *gs)
1084 : : {
1085 : 9597284 : return gs->code == GIMPLE_RESX;
1086 : : }
1087 : :
1088 : : template <>
1089 : : template <>
1090 : : inline bool
1091 : 2087518 : is_a_helper <geh_dispatch *>::test (gimple *gs)
1092 : : {
1093 : 2087518 : return gs->code == GIMPLE_EH_DISPATCH;
1094 : : }
1095 : :
1096 : : template <>
1097 : : template <>
1098 : : inline bool
1099 : 8153 : is_a_helper <geh_else *>::test (gimple *gs)
1100 : : {
1101 : 8153 : return gs->code == GIMPLE_EH_ELSE;
1102 : : }
1103 : :
1104 : : template <>
1105 : : template <>
1106 : : inline bool
1107 : 0 : is_a_helper <const geh_else *>::test (const gimple *gs)
1108 : : {
1109 : 0 : return gs->code == GIMPLE_EH_ELSE;
1110 : : }
1111 : :
1112 : : template <>
1113 : : template <>
1114 : : inline bool
1115 : 47585 : is_a_helper <geh_filter *>::test (gimple *gs)
1116 : : {
1117 : 47585 : return gs->code == GIMPLE_EH_FILTER;
1118 : : }
1119 : :
1120 : : template <>
1121 : : template <>
1122 : : inline bool
1123 : 2606670 : is_a_helper <geh_mnt *>::test (gimple *gs)
1124 : : {
1125 : 2606670 : return gs->code == GIMPLE_EH_MUST_NOT_THROW;
1126 : : }
1127 : :
1128 : : template <>
1129 : : template <>
1130 : : inline bool
1131 : 730 : is_a_helper <const geh_mnt *>::test (const gimple *gs)
1132 : : {
1133 : 730 : return gs->code == GIMPLE_EH_MUST_NOT_THROW;
1134 : : }
1135 : :
1136 : : template <>
1137 : : template <>
1138 : : inline bool
1139 : 72043 : is_a_helper <gomp_atomic_load *>::test (gimple *gs)
1140 : : {
1141 : 72043 : return gs->code == GIMPLE_OMP_ATOMIC_LOAD;
1142 : : }
1143 : :
1144 : : template <>
1145 : : template <>
1146 : : inline bool
1147 : 69193 : is_a_helper <gomp_atomic_store *>::test (gimple *gs)
1148 : : {
1149 : 69193 : return gs->code == GIMPLE_OMP_ATOMIC_STORE;
1150 : : }
1151 : :
1152 : : template <>
1153 : : template <>
1154 : : inline bool
1155 : 399764 : is_a_helper <gimple_statement_omp_return *>::test (gimple *gs)
1156 : : {
1157 : 399764 : return gs->code == GIMPLE_OMP_RETURN;
1158 : : }
1159 : :
1160 : : template <>
1161 : : template <>
1162 : : inline bool
1163 : 284147 : is_a_helper <gomp_continue *>::test (gimple *gs)
1164 : : {
1165 : 284147 : return gs->code == GIMPLE_OMP_CONTINUE;
1166 : : }
1167 : :
1168 : : template <>
1169 : : template <>
1170 : : inline bool
1171 : 3103 : is_a_helper <gomp_critical *>::test (gimple *gs)
1172 : : {
1173 : 3103 : return gs->code == GIMPLE_OMP_CRITICAL;
1174 : : }
1175 : :
1176 : : template <>
1177 : : template <>
1178 : : inline bool
1179 : 12856 : is_a_helper <gomp_ordered *>::test (gimple *gs)
1180 : : {
1181 : 12856 : return gs->code == GIMPLE_OMP_ORDERED;
1182 : : }
1183 : :
1184 : : template <>
1185 : : template <>
1186 : : inline bool
1187 : 5279 : is_a_helper <gomp_scan *>::test (gimple *gs)
1188 : : {
1189 : 5279 : return gs->code == GIMPLE_OMP_SCAN;
1190 : : }
1191 : :
1192 : : template <>
1193 : : template <>
1194 : : inline bool
1195 : 2942256 : is_a_helper <gomp_for *>::test (gimple *gs)
1196 : : {
1197 : 2942256 : return gs->code == GIMPLE_OMP_FOR;
1198 : : }
1199 : :
1200 : : template <>
1201 : : template <>
1202 : : inline bool
1203 : 40594 : is_a_helper <gimple_statement_omp_taskreg *>::test (gimple *gs)
1204 : : {
1205 : 40594 : return (gs->code == GIMPLE_OMP_PARALLEL
1206 : : || gs->code == GIMPLE_OMP_TASK
1207 : 40594 : || gs->code == GIMPLE_OMP_TEAMS);
1208 : : }
1209 : :
1210 : : template <>
1211 : : template <>
1212 : : inline bool
1213 : 62307981 : is_a_helper <gomp_parallel *>::test (gimple *gs)
1214 : : {
1215 : 62307981 : return gs->code == GIMPLE_OMP_PARALLEL;
1216 : : }
1217 : :
1218 : : template <>
1219 : : template <>
1220 : : inline bool
1221 : 470535 : is_a_helper <gomp_target *>::test (gimple *gs)
1222 : : {
1223 : 470535 : return gs->code == GIMPLE_OMP_TARGET;
1224 : : }
1225 : :
1226 : : template <>
1227 : : template <>
1228 : : inline bool
1229 : 6545 : is_a_helper <gomp_sections *>::test (gimple *gs)
1230 : : {
1231 : 6545 : return gs->code == GIMPLE_OMP_SECTIONS;
1232 : : }
1233 : :
1234 : : template <>
1235 : : template <>
1236 : : inline bool
1237 : 8651 : is_a_helper <gomp_single *>::test (gimple *gs)
1238 : : {
1239 : 8651 : return gs->code == GIMPLE_OMP_SINGLE;
1240 : : }
1241 : :
1242 : : template <>
1243 : : template <>
1244 : : inline bool
1245 : 154163 : is_a_helper <gomp_teams *>::test (gimple *gs)
1246 : : {
1247 : 154163 : return gs->code == GIMPLE_OMP_TEAMS;
1248 : : }
1249 : :
1250 : : template <>
1251 : : template <>
1252 : : inline bool
1253 : 161552 : is_a_helper <gomp_task *>::test (gimple *gs)
1254 : : {
1255 : 161552 : return gs->code == GIMPLE_OMP_TASK;
1256 : : }
1257 : :
1258 : : template <>
1259 : : template <>
1260 : : inline bool
1261 : 10582262316 : is_a_helper <gphi *>::test (gimple *gs)
1262 : : {
1263 : 10582262316 : return gs->code == GIMPLE_PHI;
1264 : : }
1265 : :
1266 : : template <>
1267 : : template <>
1268 : : inline bool
1269 : 484525536 : is_a_helper <greturn *>::test (gimple *gs)
1270 : : {
1271 : 484525536 : return gs->code == GIMPLE_RETURN;
1272 : : }
1273 : :
1274 : : template <>
1275 : : template <>
1276 : : inline bool
1277 : 269242651 : is_a_helper <gswitch *>::test (gimple *gs)
1278 : : {
1279 : 269242651 : return gs->code == GIMPLE_SWITCH;
1280 : : }
1281 : :
1282 : : template <>
1283 : : template <>
1284 : : inline bool
1285 : 271116 : is_a_helper <const gswitch *>::test (const gimple *gs)
1286 : : {
1287 : 271116 : return gs->code == GIMPLE_SWITCH;
1288 : : }
1289 : :
1290 : : template <>
1291 : : template <>
1292 : : inline bool
1293 : 535 : is_a_helper <gimple_statement_assume *>::test (gimple *gs)
1294 : : {
1295 : 535 : return gs->code == GIMPLE_ASSUME;
1296 : : }
1297 : :
1298 : : template <>
1299 : : template <>
1300 : : inline bool
1301 : 115251 : is_a_helper <gtransaction *>::test (gimple *gs)
1302 : : {
1303 : 115251 : return gs->code == GIMPLE_TRANSACTION;
1304 : : }
1305 : :
1306 : : template <>
1307 : : template <>
1308 : : inline bool
1309 : 111482111 : is_a_helper <gtry *>::test (gimple *gs)
1310 : : {
1311 : 110040800 : return gs->code == GIMPLE_TRY;
1312 : : }
1313 : :
1314 : : template <>
1315 : : template <>
1316 : : inline bool
1317 : 3461 : is_a_helper <const gtry *>::test (const gimple *gs)
1318 : : {
1319 : 3461 : return gs->code == GIMPLE_TRY;
1320 : : }
1321 : :
1322 : : template <>
1323 : : template <>
1324 : : inline bool
1325 : 1212080 : is_a_helper <gimple_statement_wce *>::test (gimple *gs)
1326 : : {
1327 : 1212080 : return gs->code == GIMPLE_WITH_CLEANUP_EXPR;
1328 : : }
1329 : :
1330 : : template <>
1331 : : template <>
1332 : : inline bool
1333 : 645810 : is_a_helper <const gasm *>::test (const gimple *gs)
1334 : : {
1335 : 645810 : return gs->code == GIMPLE_ASM;
1336 : : }
1337 : :
1338 : : template <>
1339 : : template <>
1340 : : inline bool
1341 : 16887 : is_a_helper <const gbind *>::test (const gimple *gs)
1342 : : {
1343 : 16887 : return gs->code == GIMPLE_BIND;
1344 : : }
1345 : :
1346 : : template <>
1347 : : template <>
1348 : : inline bool
1349 : 34477102239 : is_a_helper <const gcall *>::test (const gimple *gs)
1350 : : {
1351 : 34477102239 : return gs->code == GIMPLE_CALL;
1352 : : }
1353 : :
1354 : : template <>
1355 : : template <>
1356 : : inline bool
1357 : 0 : is_a_helper <const gcatch *>::test (const gimple *gs)
1358 : : {
1359 : 0 : return gs->code == GIMPLE_CATCH;
1360 : : }
1361 : :
1362 : : template <>
1363 : : template <>
1364 : : inline bool
1365 : 1665 : is_a_helper <const gresx *>::test (const gimple *gs)
1366 : : {
1367 : 1665 : return gs->code == GIMPLE_RESX;
1368 : : }
1369 : :
1370 : : template <>
1371 : : template <>
1372 : : inline bool
1373 : 30 : is_a_helper <const geh_dispatch *>::test (const gimple *gs)
1374 : : {
1375 : 30 : return gs->code == GIMPLE_EH_DISPATCH;
1376 : : }
1377 : :
1378 : : template <>
1379 : : template <>
1380 : : inline bool
1381 : 4693 : is_a_helper <const geh_filter *>::test (const gimple *gs)
1382 : : {
1383 : 4693 : return gs->code == GIMPLE_EH_FILTER;
1384 : : }
1385 : :
1386 : : template <>
1387 : : template <>
1388 : : inline bool
1389 : 526 : is_a_helper <const gomp_atomic_load *>::test (const gimple *gs)
1390 : : {
1391 : 526 : return gs->code == GIMPLE_OMP_ATOMIC_LOAD;
1392 : : }
1393 : :
1394 : : template <>
1395 : : template <>
1396 : : inline bool
1397 : 526 : is_a_helper <const gomp_atomic_store *>::test (const gimple *gs)
1398 : : {
1399 : 526 : return gs->code == GIMPLE_OMP_ATOMIC_STORE;
1400 : : }
1401 : :
1402 : : template <>
1403 : : template <>
1404 : : inline bool
1405 : 9978 : is_a_helper <const gimple_statement_omp_return *>::test (const gimple *gs)
1406 : : {
1407 : 9978 : return gs->code == GIMPLE_OMP_RETURN;
1408 : : }
1409 : :
1410 : : template <>
1411 : : template <>
1412 : : inline bool
1413 : 292 : is_a_helper <const gomp_continue *>::test (const gimple *gs)
1414 : : {
1415 : 292 : return gs->code == GIMPLE_OMP_CONTINUE;
1416 : : }
1417 : :
1418 : : template <>
1419 : : template <>
1420 : : inline bool
1421 : 16 : is_a_helper <const gomp_critical *>::test (const gimple *gs)
1422 : : {
1423 : 16 : return gs->code == GIMPLE_OMP_CRITICAL;
1424 : : }
1425 : :
1426 : : template <>
1427 : : template <>
1428 : : inline bool
1429 : 37 : is_a_helper <const gomp_ordered *>::test (const gimple *gs)
1430 : : {
1431 : 37 : return gs->code == GIMPLE_OMP_ORDERED;
1432 : : }
1433 : :
1434 : : template <>
1435 : : template <>
1436 : : inline bool
1437 : 0 : is_a_helper <const gomp_scan *>::test (const gimple *gs)
1438 : : {
1439 : 0 : return gs->code == GIMPLE_OMP_SCAN;
1440 : : }
1441 : :
1442 : : template <>
1443 : : template <>
1444 : : inline bool
1445 : 2609337 : is_a_helper <const gomp_for *>::test (const gimple *gs)
1446 : : {
1447 : 2609337 : return gs->code == GIMPLE_OMP_FOR;
1448 : : }
1449 : :
1450 : : template <>
1451 : : template <>
1452 : : inline bool
1453 : 106576 : is_a_helper <const gimple_statement_omp_taskreg *>::test (const gimple *gs)
1454 : : {
1455 : 106576 : return (gs->code == GIMPLE_OMP_PARALLEL
1456 : : || gs->code == GIMPLE_OMP_TASK
1457 : 106576 : || gs->code == GIMPLE_OMP_TEAMS);
1458 : : }
1459 : :
1460 : : template <>
1461 : : template <>
1462 : : inline bool
1463 : 117379 : is_a_helper <const gomp_parallel *>::test (const gimple *gs)
1464 : : {
1465 : 117379 : return gs->code == GIMPLE_OMP_PARALLEL;
1466 : : }
1467 : :
1468 : : template <>
1469 : : template <>
1470 : : inline bool
1471 : 182256 : is_a_helper <const gomp_target *>::test (const gimple *gs)
1472 : : {
1473 : 182256 : return gs->code == GIMPLE_OMP_TARGET;
1474 : : }
1475 : :
1476 : : template <>
1477 : : template <>
1478 : : inline bool
1479 : 3374 : is_a_helper <const gomp_sections *>::test (const gimple *gs)
1480 : : {
1481 : 3374 : return gs->code == GIMPLE_OMP_SECTIONS;
1482 : : }
1483 : :
1484 : : template <>
1485 : : template <>
1486 : : inline bool
1487 : 3636 : is_a_helper <const gomp_single *>::test (const gimple *gs)
1488 : : {
1489 : 3636 : return gs->code == GIMPLE_OMP_SINGLE;
1490 : : }
1491 : :
1492 : : template <>
1493 : : template <>
1494 : : inline bool
1495 : 35983 : is_a_helper <const gomp_teams *>::test (const gimple *gs)
1496 : : {
1497 : 35983 : return gs->code == GIMPLE_OMP_TEAMS;
1498 : : }
1499 : :
1500 : : template <>
1501 : : template <>
1502 : : inline bool
1503 : 44798 : is_a_helper <const gomp_task *>::test (const gimple *gs)
1504 : : {
1505 : 44798 : return gs->code == GIMPLE_OMP_TASK;
1506 : : }
1507 : :
1508 : : template <>
1509 : : template <>
1510 : : inline bool
1511 : 9720272349 : is_a_helper <const gphi *>::test (const gimple *gs)
1512 : : {
1513 : 9720272349 : return gs->code == GIMPLE_PHI;
1514 : : }
1515 : :
1516 : : template <>
1517 : : template <>
1518 : : inline bool
1519 : 69678 : is_a_helper <const greturn *>::test (const gimple *gs)
1520 : : {
1521 : 69678 : return gs->code == GIMPLE_RETURN;
1522 : : }
1523 : :
1524 : : template <>
1525 : : template <>
1526 : : inline bool
1527 : 626 : is_a_helper <const gimple_statement_assume *>::test (const gimple *gs)
1528 : : {
1529 : 626 : return gs->code == GIMPLE_ASSUME;
1530 : : }
1531 : :
1532 : : template <>
1533 : : template <>
1534 : : inline bool
1535 : 77 : is_a_helper <const gtransaction *>::test (const gimple *gs)
1536 : : {
1537 : 77 : return gs->code == GIMPLE_TRANSACTION;
1538 : : }
1539 : :
1540 : : /* Offset in bytes to the location of the operand vector.
1541 : : Zero if there is no operand vector for this tuple structure. */
1542 : : extern size_t const gimple_ops_offset_[];
1543 : :
1544 : : /* Map GIMPLE codes to GSS codes. */
1545 : : extern enum gimple_statement_structure_enum const gss_for_code_[];
1546 : :
1547 : : /* This variable holds the currently expanded gimple statement for purposes
1548 : : of comminucating the profile info to the builtin expanders. */
1549 : : extern gimple *currently_expanding_gimple_stmt;
1550 : :
1551 : : size_t gimple_size (enum gimple_code code, unsigned num_ops = 0);
1552 : : void gimple_init (gimple *g, enum gimple_code code, unsigned num_ops);
1553 : : gimple *gimple_alloc (enum gimple_code, unsigned CXX_MEM_STAT_INFO);
1554 : : greturn *gimple_build_return (tree);
1555 : : void gimple_call_reset_alias_info (gcall *);
1556 : : gcall *gimple_build_call_vec (tree, const vec<tree> &);
1557 : : gcall *gimple_build_call (tree, unsigned, ...);
1558 : : gcall *gimple_build_call_valist (tree, unsigned, va_list);
1559 : : gcall *gimple_build_call_internal (enum internal_fn, unsigned, ...);
1560 : : gcall *gimple_build_call_internal_vec (enum internal_fn, const vec<tree> &);
1561 : : gcall *gimple_build_call_from_tree (tree, tree);
1562 : : gassign *gimple_build_assign (tree, tree CXX_MEM_STAT_INFO);
1563 : : gassign *gimple_build_assign (tree, enum tree_code,
1564 : : tree, tree, tree CXX_MEM_STAT_INFO);
1565 : : gassign *gimple_build_assign (tree, enum tree_code,
1566 : : tree, tree CXX_MEM_STAT_INFO);
1567 : : gassign *gimple_build_assign (tree, enum tree_code, tree CXX_MEM_STAT_INFO);
1568 : : gcond *gimple_build_cond (enum tree_code, tree, tree, tree, tree);
1569 : : gcond *gimple_build_cond_from_tree (tree, tree, tree);
1570 : : void gimple_cond_set_condition_from_tree (gcond *, tree);
1571 : : glabel *gimple_build_label (tree label);
1572 : : ggoto *gimple_build_goto (tree dest);
1573 : : gimple *gimple_build_nop (void);
1574 : : gbind *gimple_build_bind (tree, gimple_seq, tree);
1575 : : gasm *gimple_build_asm_vec (const char *, vec<tree, va_gc> *,
1576 : : vec<tree, va_gc> *, vec<tree, va_gc> *,
1577 : : vec<tree, va_gc> *);
1578 : : gcatch *gimple_build_catch (tree, gimple_seq);
1579 : : geh_filter *gimple_build_eh_filter (tree, gimple_seq);
1580 : : geh_mnt *gimple_build_eh_must_not_throw (tree);
1581 : : geh_else *gimple_build_eh_else (gimple_seq, gimple_seq);
1582 : : gtry *gimple_build_try (gimple_seq, gimple_seq,
1583 : : enum gimple_try_flags);
1584 : : gimple *gimple_build_wce (gimple_seq);
1585 : : gresx *gimple_build_resx (int);
1586 : : gswitch *gimple_build_switch_nlabels (unsigned, tree, tree);
1587 : : gswitch *gimple_build_switch (tree, tree, const vec<tree> &);
1588 : : geh_dispatch *gimple_build_eh_dispatch (int);
1589 : : gdebug *gimple_build_debug_bind (tree, tree, gimple * CXX_MEM_STAT_INFO);
1590 : : gdebug *gimple_build_debug_source_bind (tree, tree, gimple * CXX_MEM_STAT_INFO);
1591 : : gdebug *gimple_build_debug_begin_stmt (tree, location_t CXX_MEM_STAT_INFO);
1592 : : gdebug *gimple_build_debug_inline_entry (tree, location_t CXX_MEM_STAT_INFO);
1593 : : gomp_critical *gimple_build_omp_critical (gimple_seq, tree, tree);
1594 : : gomp_for *gimple_build_omp_for (gimple_seq, int, tree, size_t, gimple_seq);
1595 : : gomp_parallel *gimple_build_omp_parallel (gimple_seq, tree, tree, tree);
1596 : : gomp_task *gimple_build_omp_task (gimple_seq, tree, tree, tree, tree,
1597 : : tree, tree);
1598 : : gimple *gimple_build_omp_section (gimple_seq);
1599 : : gimple *gimple_build_omp_structured_block (gimple_seq);
1600 : : gimple *gimple_build_omp_scope (gimple_seq, tree);
1601 : : gimple *gimple_build_omp_dispatch (gimple_seq, tree);
1602 : : gimple *gimple_build_omp_interop (tree);
1603 : : gimple *gimple_build_omp_master (gimple_seq);
1604 : : gimple *gimple_build_omp_masked (gimple_seq, tree);
1605 : : gimple *gimple_build_omp_taskgroup (gimple_seq, tree);
1606 : : gomp_continue *gimple_build_omp_continue (tree, tree);
1607 : : gomp_ordered *gimple_build_omp_ordered (gimple_seq, tree);
1608 : : gimple *gimple_build_omp_return (bool);
1609 : : gomp_scan *gimple_build_omp_scan (gimple_seq, tree);
1610 : : gomp_sections *gimple_build_omp_sections (gimple_seq, tree);
1611 : : gimple *gimple_build_omp_sections_switch (void);
1612 : : gomp_single *gimple_build_omp_single (gimple_seq, tree);
1613 : : gomp_target *gimple_build_omp_target (gimple_seq, int, tree, gimple_seq = NULL);
1614 : : gomp_teams *gimple_build_omp_teams (gimple_seq, tree);
1615 : : gomp_atomic_load *gimple_build_omp_atomic_load (tree, tree,
1616 : : enum omp_memory_order);
1617 : : gomp_atomic_store *gimple_build_omp_atomic_store (tree, enum omp_memory_order);
1618 : : gimple *gimple_build_assume (tree, gimple_seq);
1619 : : gtransaction *gimple_build_transaction (gimple_seq);
1620 : : extern void gimple_seq_add_stmt (gimple_seq *, gimple *);
1621 : : extern void gimple_seq_add_stmt_without_update (gimple_seq *, gimple *);
1622 : : void gimple_seq_add_seq (gimple_seq *, gimple_seq);
1623 : : void gimple_seq_add_seq_without_update (gimple_seq *, gimple_seq);
1624 : : extern void annotate_all_with_location_after (gimple_seq, gimple_stmt_iterator,
1625 : : location_t);
1626 : : extern void annotate_all_with_location (gimple_seq, location_t);
1627 : : bool empty_body_p (gimple_seq);
1628 : : gimple_seq gimple_seq_copy (gimple_seq);
1629 : : bool gimple_call_same_target_p (const gimple *, const gimple *);
1630 : : int gimple_call_flags (const gimple *);
1631 : : int gimple_call_arg_flags (const gcall *, unsigned);
1632 : : int gimple_call_retslot_flags (const gcall *);
1633 : : int gimple_call_static_chain_flags (const gcall *);
1634 : : int gimple_call_return_flags (const gcall *);
1635 : : bool gimple_call_nonnull_result_p (gcall *);
1636 : : tree gimple_call_nonnull_arg (gcall *);
1637 : : bool gimple_assign_copy_p (gimple *);
1638 : : bool gimple_assign_ssa_name_copy_p (gimple *);
1639 : : bool gimple_assign_unary_nop_p (gimple *);
1640 : : bool gimple_assign_load_p (const gimple *);
1641 : : void gimple_set_bb (gimple *, basic_block);
1642 : : void gimple_assign_set_rhs_from_tree (gimple_stmt_iterator *, tree);
1643 : : void gimple_assign_set_rhs_with_ops (gimple_stmt_iterator *, enum tree_code,
1644 : : tree, tree, tree);
1645 : : tree gimple_get_lhs (const gimple *);
1646 : : void gimple_set_lhs (gimple *, tree);
1647 : : gimple *gimple_copy (gimple *);
1648 : : void gimple_move_vops (gimple *, gimple *);
1649 : : bool gimple_has_side_effects (const gimple *);
1650 : : bool gimple_could_trap_p_1 (const gimple *, bool, bool);
1651 : : bool gimple_could_trap_p (const gimple *);
1652 : : bool gimple_assign_rhs_could_trap_p (gimple *);
1653 : : extern void dump_gimple_statistics (void);
1654 : : unsigned get_gimple_rhs_num_ops (enum tree_code);
1655 : : gcall *gimple_call_copy_skip_args (gcall *, bitmap);
1656 : : extern bool gimple_compare_field_offset (tree, tree);
1657 : : extern tree gimple_unsigned_type (tree);
1658 : : extern tree gimple_signed_type (tree);
1659 : : extern alias_set_type gimple_get_alias_set (tree);
1660 : : extern bool gimple_ior_addresses_taken (bitmap, gimple *);
1661 : : extern bool gimple_builtin_call_types_compatible_p (const gimple *, tree);
1662 : : extern combined_fn gimple_call_combined_fn (const gimple *);
1663 : : extern bool gimple_call_operator_delete_p (const gcall *);
1664 : : extern bool gimple_call_builtin_p (const gimple *);
1665 : : extern bool gimple_call_builtin_p (const gimple *, enum built_in_class);
1666 : : extern bool gimple_call_builtin_p (const gimple *, enum built_in_function);
1667 : : extern bool gimple_asm_clobbers_memory_p (const gasm *);
1668 : : extern void dump_decl_set (FILE *, bitmap);
1669 : : extern bool nonfreeing_call_p (gimple *);
1670 : : extern bool nonbarrier_call_p (gimple *);
1671 : : extern bool infer_nonnull_range (gimple *, tree);
1672 : : extern bool infer_nonnull_range_by_dereference (gimple *, tree);
1673 : : extern bool infer_nonnull_range_by_attribute (gimple *, tree, tree * = NULL,
1674 : : tree * = NULL);
1675 : : extern void sort_case_labels (vec<tree> &);
1676 : : extern void preprocess_case_label_vec_for_gimple (vec<tree> &, tree, tree *);
1677 : : extern void gimple_seq_set_location (gimple_seq, location_t);
1678 : : extern void gimple_seq_discard (gimple_seq);
1679 : : extern void maybe_remove_unused_call_args (struct function *, gimple *);
1680 : : extern bool gimple_inexpensive_call_p (gcall *);
1681 : : extern bool stmt_can_terminate_bb_p (gimple *);
1682 : : extern location_t gimple_or_expr_nonartificial_location (gimple *, tree);
1683 : : gcall *gimple_build_builtin_unreachable (location_t);
1684 : :
1685 : : /* Return the disposition for a warning (or all warnings by default)
1686 : : for a statement. */
1687 : : extern bool warning_suppressed_p (const gimple *, opt_code = all_warnings)
1688 : : ATTRIBUTE_NONNULL (1);
1689 : : /* Set the disposition for a warning (or all warnings by default)
1690 : : at a location to enabled by default. */
1691 : : extern void suppress_warning (gimple *, opt_code = all_warnings,
1692 : : bool = true) ATTRIBUTE_NONNULL (1);
1693 : :
1694 : : /* Copy the warning disposition mapping from one statement to another. */
1695 : : extern void copy_warning (gimple *, const gimple *)
1696 : : ATTRIBUTE_NONNULL (1) ATTRIBUTE_NONNULL (2);
1697 : : /* Copy the warning disposition mapping from an expression to a statement. */
1698 : : extern void copy_warning (gimple *, const_tree)
1699 : : ATTRIBUTE_NONNULL (1) ATTRIBUTE_NONNULL (2);
1700 : : /* Copy the warning disposition mapping from a statement to an expression. */
1701 : : extern void copy_warning (tree, const gimple *)
1702 : : ATTRIBUTE_NONNULL (1) ATTRIBUTE_NONNULL (2);
1703 : :
1704 : : /* Formal (expression) temporary table handling: multiple occurrences of
1705 : : the same scalar expression are evaluated into the same temporary. */
1706 : :
1707 : : typedef struct gimple_temp_hash_elt
1708 : : {
1709 : : tree val; /* Key */
1710 : : tree temp; /* Value */
1711 : : } elt_t;
1712 : :
1713 : : /* Get the number of the next statement uid to be allocated. */
1714 : : inline unsigned int
1715 : 8532935 : gimple_stmt_max_uid (struct function *fn)
1716 : : {
1717 : 8532935 : return fn->last_stmt_uid;
1718 : : }
1719 : :
1720 : : /* Set the number of the next statement uid to be allocated. */
1721 : : inline void
1722 : 20572153 : set_gimple_stmt_max_uid (struct function *fn, unsigned int maxid)
1723 : : {
1724 : 20572153 : fn->last_stmt_uid = maxid;
1725 : : }
1726 : :
1727 : : /* Set the number of the next statement uid to be allocated. */
1728 : : inline unsigned int
1729 : 1088131159 : inc_gimple_stmt_max_uid (struct function *fn)
1730 : : {
1731 : 1088131159 : return fn->last_stmt_uid++;
1732 : : }
1733 : :
1734 : : /* Return the first node in GIMPLE sequence S. */
1735 : :
1736 : : inline gimple_seq_node
1737 : : gimple_seq_first (gimple_seq s)
1738 : : {
1739 : : return s;
1740 : : }
1741 : :
1742 : :
1743 : : /* Return the first statement in GIMPLE sequence S. */
1744 : :
1745 : : inline gimple *
1746 : : gimple_seq_first_stmt (gimple_seq s)
1747 : : {
1748 : 9820593 : gimple_seq_node n = gimple_seq_first (s);
1749 : : return n;
1750 : : }
1751 : :
1752 : : /* Return the first statement in GIMPLE sequence S as a gbind *,
1753 : : verifying that it has code GIMPLE_BIND in a checked build. */
1754 : :
1755 : : inline gbind *
1756 : 24252 : gimple_seq_first_stmt_as_a_bind (gimple_seq s)
1757 : : {
1758 : 24252 : gimple_seq_node n = gimple_seq_first (s);
1759 : 24252 : return as_a <gbind *> (n);
1760 : : }
1761 : :
1762 : :
1763 : : /* Return the last node in GIMPLE sequence S. */
1764 : :
1765 : : inline gimple_seq_node
1766 : 7175025456 : gimple_seq_last (gimple_seq s)
1767 : : {
1768 : 7172848838 : return s ? s->prev : NULL;
1769 : : }
1770 : :
1771 : :
1772 : : /* Return the last statement in GIMPLE sequence S. */
1773 : :
1774 : : inline gimple *
1775 : 2231847 : gimple_seq_last_stmt (gimple_seq s)
1776 : : {
1777 : 916758 : gimple_seq_node n = gimple_seq_last (s);
1778 : 1495323 : return n;
1779 : : }
1780 : :
1781 : :
1782 : : /* Set the last node in GIMPLE sequence *PS to LAST. */
1783 : :
1784 : : inline void
1785 : 446006895 : gimple_seq_set_last (gimple_seq *ps, gimple_seq_node last)
1786 : : {
1787 : 24043944 : (*ps)->prev = last;
1788 : 421360088 : }
1789 : :
1790 : :
1791 : : /* Set the first node in GIMPLE sequence *PS to FIRST. */
1792 : :
1793 : : inline void
1794 : 206995308 : gimple_seq_set_first (gimple_seq *ps, gimple_seq_node first)
1795 : : {
1796 : 186310879 : *ps = first;
1797 : 21287292 : }
1798 : :
1799 : :
1800 : : /* Return true if GIMPLE sequence S is empty. */
1801 : :
1802 : : inline bool
1803 : 202005859 : gimple_seq_empty_p (gimple_seq s)
1804 : : {
1805 : 202005859 : return s == NULL;
1806 : : }
1807 : :
1808 : : /* Allocate a new sequence and initialize its first element with STMT. */
1809 : :
1810 : : inline gimple_seq
1811 : 13382045 : gimple_seq_alloc_with_stmt (gimple *stmt)
1812 : : {
1813 : 13382045 : gimple_seq seq = NULL;
1814 : 13382045 : gimple_seq_add_stmt (&seq, stmt);
1815 : 13382045 : return seq;
1816 : : }
1817 : :
1818 : :
1819 : : /* Returns the sequence of statements in BB. */
1820 : :
1821 : : inline gimple_seq
1822 : 97531453 : bb_seq (const_basic_block bb)
1823 : : {
1824 : 97531453 : return (!(bb->flags & BB_RTL)) ? bb->il.gimple.seq : NULL;
1825 : : }
1826 : :
1827 : : inline gimple_seq *
1828 : 19290377614 : bb_seq_addr (basic_block bb)
1829 : : {
1830 : 19258222221 : return (!(bb->flags & BB_RTL)) ? &bb->il.gimple.seq : NULL;
1831 : : }
1832 : :
1833 : : /* Sets the sequence of statements in BB to SEQ. */
1834 : :
1835 : : inline void
1836 : 91013319 : set_bb_seq (basic_block bb, gimple_seq seq)
1837 : : {
1838 : 91013319 : gcc_checking_assert (!(bb->flags & BB_RTL));
1839 : 91013319 : bb->il.gimple.seq = seq;
1840 : 91013319 : }
1841 : :
1842 : :
1843 : : /* Return the code for GIMPLE statement G. */
1844 : :
1845 : : inline enum gimple_code
1846 : >59049*10^7 : gimple_code (const gimple *g)
1847 : : {
1848 : >18799*10^7 : return g->code;
1849 : : }
1850 : :
1851 : :
1852 : : /* Return the GSS code used by a GIMPLE code. */
1853 : :
1854 : : inline enum gimple_statement_structure_enum
1855 : >10170*10^7 : gss_for_code (enum gimple_code code)
1856 : : {
1857 : >10170*10^7 : gcc_gimple_checking_assert ((unsigned int)code < LAST_AND_UNUSED_GIMPLE_CODE);
1858 : >10170*10^7 : return gss_for_code_[code];
1859 : : }
1860 : :
1861 : :
1862 : : /* Return which GSS code is used by GS. */
1863 : :
1864 : : inline enum gimple_statement_structure_enum
1865 : >10133*10^7 : gimple_statement_structure (gimple *gs)
1866 : : {
1867 : 55366822224 : return gss_for_code (gimple_code (gs));
1868 : : }
1869 : :
1870 : :
1871 : : /* Return true if statement G has sub-statements. This is only true for
1872 : : High GIMPLE statements. */
1873 : :
1874 : : inline bool
1875 : 365896703 : gimple_has_substatements (gimple *g)
1876 : : {
1877 : 365896703 : switch (gimple_code (g))
1878 : : {
1879 : : case GIMPLE_ASSUME:
1880 : : case GIMPLE_BIND:
1881 : : case GIMPLE_CATCH:
1882 : : case GIMPLE_EH_FILTER:
1883 : : case GIMPLE_EH_ELSE:
1884 : : case GIMPLE_TRY:
1885 : : case GIMPLE_OMP_FOR:
1886 : : case GIMPLE_OMP_MASTER:
1887 : : case GIMPLE_OMP_MASKED:
1888 : : case GIMPLE_OMP_TASKGROUP:
1889 : : case GIMPLE_OMP_ORDERED:
1890 : : case GIMPLE_OMP_SECTION:
1891 : : case GIMPLE_OMP_STRUCTURED_BLOCK:
1892 : : case GIMPLE_OMP_PARALLEL:
1893 : : case GIMPLE_OMP_TASK:
1894 : : case GIMPLE_OMP_SCOPE:
1895 : : case GIMPLE_OMP_DISPATCH:
1896 : : case GIMPLE_OMP_SECTIONS:
1897 : : case GIMPLE_OMP_SINGLE:
1898 : : case GIMPLE_OMP_TARGET:
1899 : : case GIMPLE_OMP_TEAMS:
1900 : : case GIMPLE_OMP_CRITICAL:
1901 : : case GIMPLE_WITH_CLEANUP_EXPR:
1902 : : case GIMPLE_TRANSACTION:
1903 : : return true;
1904 : :
1905 : 365845429 : default:
1906 : 365845429 : return false;
1907 : : }
1908 : : }
1909 : :
1910 : :
1911 : : /* Return the basic block holding statement G. */
1912 : :
1913 : : inline basic_block
1914 : 35104951837 : gimple_bb (const gimple *g)
1915 : : {
1916 : 33253070754 : return g->bb;
1917 : : }
1918 : :
1919 : :
1920 : : /* Return the lexical scope block holding statement G. */
1921 : :
1922 : : inline tree
1923 : 1502932040 : gimple_block (const gimple *g)
1924 : : {
1925 : 1502932040 : return LOCATION_BLOCK (g->location);
1926 : : }
1927 : :
1928 : : /* Forward declare. */
1929 : : inline void gimple_set_location (gimple *, location_t);
1930 : :
1931 : : /* Set BLOCK to be the lexical scope block holding statement G. */
1932 : :
1933 : : inline void
1934 : 177798677 : gimple_set_block (gimple *g, tree block)
1935 : : {
1936 : 177798677 : gimple_set_location (g, set_block (g->location, block));
1937 : 177798677 : }
1938 : :
1939 : : /* Return location information for statement G. */
1940 : :
1941 : : inline location_t
1942 : 16198288024 : gimple_location (const gimple *g)
1943 : : {
1944 : 16108000077 : return g->location;
1945 : : }
1946 : :
1947 : : /* Return location information for statement G if g is not NULL.
1948 : : Otherwise, UNKNOWN_LOCATION is returned. */
1949 : :
1950 : : inline location_t
1951 : : gimple_location_safe (const gimple *g)
1952 : : {
1953 : : return g ? gimple_location (g) : UNKNOWN_LOCATION;
1954 : : }
1955 : :
1956 : : /* Set location information for statement G. */
1957 : :
1958 : : inline void
1959 : 437953586 : gimple_set_location (gimple *g, location_t location)
1960 : : {
1961 : : /* Copy the no-warning data to the statement location. */
1962 : 415129169 : if (g->location != UNKNOWN_LOCATION)
1963 : 231836404 : copy_warning (location, g->location);
1964 : 265386473 : g->location = location;
1965 : 164711657 : }
1966 : :
1967 : : /* Return address of the location information for statement G. */
1968 : :
1969 : : inline location_t *
1970 : 1396044 : gimple_location_ptr (gimple *g)
1971 : : {
1972 : 1396044 : return &g->location;
1973 : : }
1974 : :
1975 : :
1976 : : /* Return true if G contains location information. */
1977 : :
1978 : : inline bool
1979 : 752526598 : gimple_has_location (const gimple *g)
1980 : : {
1981 : 752526598 : return LOCATION_LOCUS (gimple_location (g)) != UNKNOWN_LOCATION;
1982 : : }
1983 : :
1984 : :
1985 : : /* Return non-artificial location information for statement G. */
1986 : :
1987 : : inline location_t
1988 : 171406 : gimple_nonartificial_location (const gimple *g)
1989 : : {
1990 : 171406 : location_t *ploc = NULL;
1991 : :
1992 : 171406 : if (tree block = gimple_block (g))
1993 : 169671 : ploc = block_nonartificial_location (block);
1994 : :
1995 : 171406 : return ploc ? *ploc : gimple_location (g);
1996 : : }
1997 : :
1998 : :
1999 : : /* Return the file name of the location of STMT. */
2000 : :
2001 : : inline const char *
2002 : 10608 : gimple_filename (const gimple *stmt)
2003 : : {
2004 : 10608 : return LOCATION_FILE (gimple_location (stmt));
2005 : : }
2006 : :
2007 : :
2008 : : /* Return the line number of the location of STMT. */
2009 : :
2010 : : inline int
2011 : 20800 : gimple_lineno (const gimple *stmt)
2012 : : {
2013 : 10617 : return LOCATION_LINE (gimple_location (stmt));
2014 : : }
2015 : :
2016 : :
2017 : : /* Determine whether SEQ is a singleton. */
2018 : :
2019 : : inline bool
2020 : 428683 : gimple_seq_singleton_p (gimple_seq seq)
2021 : : {
2022 : 428683 : return ((gimple_seq_first (seq) != NULL)
2023 : 428683 : && (gimple_seq_first (seq) == gimple_seq_last (seq)));
2024 : : }
2025 : :
2026 : : /* Return true if no warnings should be emitted for statement STMT. */
2027 : :
2028 : : inline bool
2029 : 1669266 : gimple_no_warning_p (const gimple *stmt)
2030 : : {
2031 : 1669266 : return stmt->no_warning;
2032 : : }
2033 : :
2034 : : /* Set the no_warning flag of STMT to NO_WARNING. */
2035 : :
2036 : : inline void
2037 : : gimple_set_no_warning (gimple *stmt, bool no_warning)
2038 : : {
2039 : : stmt->no_warning = (unsigned) no_warning;
2040 : : }
2041 : :
2042 : : /* Set the visited status on statement STMT to VISITED_P.
2043 : :
2044 : : Please note that this 'visited' property of the gimple statement is
2045 : : supposed to be undefined at pass boundaries. This means that a
2046 : : given pass should not assume it contains any useful value when the
2047 : : pass starts and thus can set it to any value it sees fit.
2048 : :
2049 : : You can learn more about the visited property of the gimple
2050 : : statement by reading the comments of the 'visited' data member of
2051 : : struct gimple.
2052 : : */
2053 : :
2054 : : inline void
2055 : 2289161665 : gimple_set_visited (gimple *stmt, bool visited_p)
2056 : : {
2057 : 2114723123 : stmt->visited = (unsigned) visited_p;
2058 : 174438542 : }
2059 : :
2060 : :
2061 : : /* Return the visited status for statement STMT.
2062 : :
2063 : : Please note that this 'visited' property of the gimple statement is
2064 : : supposed to be undefined at pass boundaries. This means that a
2065 : : given pass should not assume it contains any useful value when the
2066 : : pass starts and thus can set it to any value it sees fit.
2067 : :
2068 : : You can learn more about the visited property of the gimple
2069 : : statement by reading the comments of the 'visited' data member of
2070 : : struct gimple. */
2071 : :
2072 : : inline bool
2073 : 6298868845 : gimple_visited_p (gimple *stmt)
2074 : : {
2075 : 6298868845 : return stmt->visited;
2076 : : }
2077 : :
2078 : :
2079 : : /* Set pass local flag PLF on statement STMT to VAL_P.
2080 : :
2081 : : Please note that this PLF property of the gimple statement is
2082 : : supposed to be undefined at pass boundaries. This means that a
2083 : : given pass should not assume it contains any useful value when the
2084 : : pass starts and thus can set it to any value it sees fit.
2085 : :
2086 : : You can learn more about the PLF property by reading the comment of
2087 : : the 'plf' data member of struct gimple_statement_structure. */
2088 : :
2089 : : inline void
2090 : 3008484830 : gimple_set_plf (gimple *stmt, enum plf_mask plf, bool val_p)
2091 : : {
2092 : 3008484830 : if (val_p)
2093 : 1220001338 : stmt->plf |= (unsigned int) plf;
2094 : : else
2095 : 1773564058 : stmt->plf &= ~((unsigned int) plf);
2096 : 42402876 : }
2097 : :
2098 : :
2099 : : /* Return the value of pass local flag PLF on statement STMT.
2100 : :
2101 : : Please note that this 'plf' property of the gimple statement is
2102 : : supposed to be undefined at pass boundaries. This means that a
2103 : : given pass should not assume it contains any useful value when the
2104 : : pass starts and thus can set it to any value it sees fit.
2105 : :
2106 : : You can learn more about the plf property by reading the comment of
2107 : : the 'plf' data member of struct gimple_statement_structure. */
2108 : :
2109 : : inline unsigned int
2110 : 4278384314 : gimple_plf (gimple *stmt, enum plf_mask plf)
2111 : : {
2112 : 4241912893 : return stmt->plf & ((unsigned int) plf);
2113 : : }
2114 : :
2115 : :
2116 : : /* Set the UID of statement.
2117 : :
2118 : : Please note that this UID property is supposed to be undefined at
2119 : : pass boundaries. This means that a given pass should not assume it
2120 : : contains any useful value when the pass starts and thus can set it
2121 : : to any value it sees fit. */
2122 : :
2123 : : inline void
2124 : 2108446523 : gimple_set_uid (gimple *g, unsigned uid)
2125 : : {
2126 : 2107028641 : g->uid = uid;
2127 : 35239522 : }
2128 : :
2129 : :
2130 : : /* Return the UID of statement.
2131 : :
2132 : : Please note that this UID property is supposed to be undefined at
2133 : : pass boundaries. This means that a given pass should not assume it
2134 : : contains any useful value when the pass starts and thus can set it
2135 : : to any value it sees fit. */
2136 : :
2137 : : inline unsigned
2138 : 2052087109 : gimple_uid (const gimple *g)
2139 : : {
2140 : 2043318900 : return g->uid;
2141 : : }
2142 : :
2143 : :
2144 : : /* Make statement G a singleton sequence. */
2145 : :
2146 : : inline void
2147 : 397680490 : gimple_init_singleton (gimple *g)
2148 : : {
2149 : 397680490 : g->next = NULL;
2150 : 88440194 : g->prev = g;
2151 : : }
2152 : :
2153 : :
2154 : : /* Return true if GIMPLE statement G has register or memory operands. */
2155 : :
2156 : : inline bool
2157 : >12929*10^7 : gimple_has_ops (const gimple *g)
2158 : : {
2159 : >12929*10^7 : return gimple_code (g) >= GIMPLE_COND && gimple_code (g) <= GIMPLE_RETURN;
2160 : : }
2161 : :
2162 : : template <>
2163 : : template <>
2164 : : inline bool
2165 : 26770048952 : is_a_helper <const gimple_statement_with_ops *>::test (const gimple *gs)
2166 : : {
2167 : 66990988030 : return gimple_has_ops (gs);
2168 : : }
2169 : :
2170 : : template <>
2171 : : template <>
2172 : : inline bool
2173 : 432307134 : is_a_helper <gimple_statement_with_ops *>::test (gimple *gs)
2174 : : {
2175 : 864614268 : return gimple_has_ops (gs);
2176 : : }
2177 : :
2178 : : /* Return true if GIMPLE statement G has memory operands. */
2179 : :
2180 : : inline bool
2181 : >11081*10^7 : gimple_has_mem_ops (const gimple *g)
2182 : : {
2183 : 59948564635 : return gimple_code (g) >= GIMPLE_ASSIGN && gimple_code (g) <= GIMPLE_RETURN;
2184 : : }
2185 : :
2186 : : template <>
2187 : : template <>
2188 : : inline bool
2189 : 40243290071 : is_a_helper <const gimple_statement_with_memory_ops *>::test (const gimple *gs)
2190 : : {
2191 : >13772*10^7 : return gimple_has_mem_ops (gs);
2192 : : }
2193 : :
2194 : : template <>
2195 : : template <>
2196 : : inline bool
2197 : 569645178 : is_a_helper <gimple_statement_with_memory_ops *>::test (gimple *gs)
2198 : : {
2199 : 2635735171 : return gimple_has_mem_ops (gs);
2200 : : }
2201 : :
2202 : : /* Return the set of USE operands for statement G. */
2203 : :
2204 : : inline struct use_optype_d *
2205 : 26770062642 : gimple_use_ops (const gimple *g)
2206 : : {
2207 : 26770048952 : const gimple_statement_with_ops *ops_stmt =
2208 : 40220090059 : dyn_cast <const gimple_statement_with_ops *> (g);
2209 : 26632914500 : if (!ops_stmt)
2210 : : return NULL;
2211 : 26632914500 : return ops_stmt->use_ops;
2212 : : }
2213 : :
2214 : :
2215 : : /* Set USE to be the set of USE operands for statement G. */
2216 : :
2217 : : inline void
2218 : 432307134 : gimple_set_use_ops (gimple *g, struct use_optype_d *use)
2219 : : {
2220 : 432307134 : gimple_statement_with_ops *ops_stmt =
2221 : 432307134 : as_a <gimple_statement_with_ops *> (g);
2222 : 64753693 : ops_stmt->use_ops = use;
2223 : 5248 : }
2224 : :
2225 : :
2226 : : /* Return the single VUSE operand of the statement G. */
2227 : :
2228 : : inline tree
2229 : 47029408245 : gimple_vuse (const gimple *g)
2230 : : {
2231 : 50052358743 : const gimple_statement_with_memory_ops *mem_ops_stmt =
2232 : 54636538414 : dyn_cast <const gimple_statement_with_memory_ops *> (g);
2233 : 23997887572 : if (!mem_ops_stmt)
2234 : : return NULL_TREE;
2235 : 23888643118 : return mem_ops_stmt->vuse;
2236 : : }
2237 : :
2238 : : /* Return the single VDEF operand of the statement G. */
2239 : :
2240 : : inline tree
2241 : 23759413277 : gimple_vdef (const gimple *g)
2242 : : {
2243 : 34701728197 : const gimple_statement_with_memory_ops *mem_ops_stmt =
2244 : 43851268875 : dyn_cast <const gimple_statement_with_memory_ops *> (g);
2245 : 15823008303 : if (!mem_ops_stmt)
2246 : : return NULL_TREE;
2247 : 15791158236 : return mem_ops_stmt->vdef;
2248 : : }
2249 : :
2250 : : /* Return the single VUSE operand of the statement G. */
2251 : :
2252 : : inline tree *
2253 : 93623086 : gimple_vuse_ptr (gimple *g)
2254 : : {
2255 : 93623086 : gimple_statement_with_memory_ops *mem_ops_stmt =
2256 : 93623086 : dyn_cast <gimple_statement_with_memory_ops *> (g);
2257 : 93623086 : if (!mem_ops_stmt)
2258 : : return NULL;
2259 : 93623086 : return &mem_ops_stmt->vuse;
2260 : : }
2261 : :
2262 : : /* Return the single VDEF operand of the statement G. */
2263 : :
2264 : : inline tree *
2265 : 162803771 : gimple_vdef_ptr (gimple *g)
2266 : : {
2267 : 162803771 : gimple_statement_with_memory_ops *mem_ops_stmt =
2268 : 1552618825 : dyn_cast <gimple_statement_with_memory_ops *> (g);
2269 : 162803771 : if (!mem_ops_stmt)
2270 : : return NULL;
2271 : 162803771 : return &mem_ops_stmt->vdef;
2272 : : }
2273 : :
2274 : : /* Set the single VUSE operand of the statement G. */
2275 : :
2276 : : inline void
2277 : 210024007 : gimple_set_vuse (gimple *g, tree vuse)
2278 : : {
2279 : 210024007 : gimple_statement_with_memory_ops *mem_ops_stmt =
2280 : 210100536 : as_a <gimple_statement_with_memory_ops *> (g);
2281 : 210024007 : mem_ops_stmt->vuse = vuse;
2282 : 123609054 : }
2283 : :
2284 : : /* Set the single VDEF operand of the statement G. */
2285 : :
2286 : : inline void
2287 : 103194314 : gimple_set_vdef (gimple *g, tree vdef)
2288 : : {
2289 : 103194314 : gimple_statement_with_memory_ops *mem_ops_stmt =
2290 : 103270843 : as_a <gimple_statement_with_memory_ops *> (g);
2291 : 103194314 : mem_ops_stmt->vdef = vdef;
2292 : 42164128 : }
2293 : :
2294 : :
2295 : : /* Return true if statement G has operands and the modified field has
2296 : : been set. */
2297 : :
2298 : : inline bool
2299 : 14845583807 : gimple_modified_p (const gimple *g)
2300 : : {
2301 : 29674326820 : return (gimple_has_ops (g)) ? (bool) g->modified : false;
2302 : : }
2303 : :
2304 : :
2305 : : /* Set the MODIFIED flag to MODIFIEDP, iff the gimple statement G has
2306 : : a MODIFIED field. */
2307 : :
2308 : : inline void
2309 : 767506013 : gimple_set_modified (gimple *s, bool modifiedp)
2310 : : {
2311 : 2947109976 : if (gimple_has_ops (s))
2312 : 762710789 : s->modified = (unsigned) modifiedp;
2313 : 103 : }
2314 : :
2315 : :
2316 : : /* Return true if statement STMT contains volatile operands. */
2317 : :
2318 : : inline bool
2319 : 24686758314 : gimple_has_volatile_ops (const gimple *stmt)
2320 : : {
2321 : 35855872270 : if (gimple_has_mem_ops (stmt))
2322 : 11180945743 : return stmt->has_volatile_ops;
2323 : : else
2324 : : return false;
2325 : : }
2326 : :
2327 : :
2328 : : /* Set the HAS_VOLATILE_OPS flag to VOLATILEP. */
2329 : :
2330 : : inline void
2331 : 11711969664 : gimple_set_has_volatile_ops (gimple *stmt, bool volatilep)
2332 : : {
2333 : 22080920455 : if (gimple_has_mem_ops (stmt))
2334 : 5006738747 : stmt->has_volatile_ops = (unsigned) volatilep;
2335 : : }
2336 : :
2337 : : /* Return true if STMT is in a transaction. */
2338 : :
2339 : : inline bool
2340 : 428 : gimple_in_transaction (const gimple *stmt)
2341 : : {
2342 : 428 : return bb_in_transaction (gimple_bb (stmt));
2343 : : }
2344 : :
2345 : : /* Return true if statement STMT may access memory. */
2346 : :
2347 : : inline bool
2348 : 103105116 : gimple_references_memory_p (gimple *stmt)
2349 : : {
2350 : 182029649 : return gimple_has_mem_ops (stmt) && gimple_vuse (stmt);
2351 : : }
2352 : :
2353 : :
2354 : : /* Return the subcode for OMP statement S. */
2355 : :
2356 : : inline unsigned
2357 : 3362246 : gimple_omp_subcode (const gimple *s)
2358 : : {
2359 : 3362246 : gcc_gimple_checking_assert (gimple_code (s) >= GIMPLE_OMP_ATOMIC_LOAD
2360 : : && gimple_code (s) <= GIMPLE_OMP_ORDERED);
2361 : 3362246 : return s->subcode;
2362 : : }
2363 : :
2364 : : /* Set the subcode for OMP statement S to SUBCODE. */
2365 : :
2366 : : inline void
2367 : 12554 : gimple_omp_set_subcode (gimple *s, unsigned int subcode)
2368 : : {
2369 : : /* We only have 16 bits for the subcode. Assert that we are not
2370 : : overflowing it. */
2371 : 12554 : gcc_gimple_checking_assert (subcode < (1 << 16));
2372 : 12554 : s->subcode = subcode;
2373 : 12554 : }
2374 : :
2375 : : /* Set the nowait flag on OMP_RETURN statement S. */
2376 : :
2377 : : inline void
2378 : 38212 : gimple_omp_return_set_nowait (gimple *s)
2379 : : {
2380 : 38212 : GIMPLE_CHECK (s, GIMPLE_OMP_RETURN);
2381 : 38212 : s->subcode |= GF_OMP_RETURN_NOWAIT;
2382 : 38212 : }
2383 : :
2384 : :
2385 : : /* Return true if OMP return statement G has the GF_OMP_RETURN_NOWAIT
2386 : : flag set. */
2387 : :
2388 : : inline bool
2389 : 84079 : gimple_omp_return_nowait_p (const gimple *g)
2390 : : {
2391 : 84079 : GIMPLE_CHECK (g, GIMPLE_OMP_RETURN);
2392 : 84079 : return (gimple_omp_subcode (g) & GF_OMP_RETURN_NOWAIT) != 0;
2393 : : }
2394 : :
2395 : :
2396 : : /* Set the LHS of OMP return. */
2397 : :
2398 : : inline void
2399 : 64 : gimple_omp_return_set_lhs (gimple *g, tree lhs)
2400 : : {
2401 : 64 : gimple_statement_omp_return *omp_return_stmt =
2402 : 64 : as_a <gimple_statement_omp_return *> (g);
2403 : 64 : omp_return_stmt->val = lhs;
2404 : : }
2405 : :
2406 : :
2407 : : /* Get the LHS of OMP return. */
2408 : :
2409 : : inline tree
2410 : 9978 : gimple_omp_return_lhs (const gimple *g)
2411 : : {
2412 : 9978 : const gimple_statement_omp_return *omp_return_stmt =
2413 : 9978 : as_a <const gimple_statement_omp_return *> (g);
2414 : 9978 : return omp_return_stmt->val;
2415 : : }
2416 : :
2417 : :
2418 : : /* Return a pointer to the LHS of OMP return. */
2419 : :
2420 : : inline tree *
2421 : 399700 : gimple_omp_return_lhs_ptr (gimple *g)
2422 : : {
2423 : 399700 : gimple_statement_omp_return *omp_return_stmt =
2424 : 399700 : as_a <gimple_statement_omp_return *> (g);
2425 : 399700 : return &omp_return_stmt->val;
2426 : : }
2427 : :
2428 : :
2429 : : /* Return true if OMP section statement G has the GF_OMP_SECTION_LAST
2430 : : flag set. */
2431 : :
2432 : : inline bool
2433 : 0 : gimple_omp_section_last_p (const gimple *g)
2434 : : {
2435 : 0 : GIMPLE_CHECK (g, GIMPLE_OMP_SECTION);
2436 : 0 : return (gimple_omp_subcode (g) & GF_OMP_SECTION_LAST) != 0;
2437 : : }
2438 : :
2439 : :
2440 : : /* Set the GF_OMP_SECTION_LAST flag on G. */
2441 : :
2442 : : inline void
2443 : 378 : gimple_omp_section_set_last (gimple *g)
2444 : : {
2445 : 378 : GIMPLE_CHECK (g, GIMPLE_OMP_SECTION);
2446 : 378 : g->subcode |= GF_OMP_SECTION_LAST;
2447 : 378 : }
2448 : :
2449 : :
2450 : : /* Return true if OMP ordered construct is stand-alone
2451 : : (G has the GF_OMP_ORDERED_STANDALONE flag set). */
2452 : :
2453 : : inline bool
2454 : 5830 : gimple_omp_ordered_standalone_p (const gimple *g)
2455 : : {
2456 : 5830 : GIMPLE_CHECK (g, GIMPLE_OMP_ORDERED);
2457 : 5830 : return (gimple_omp_subcode (g) & GF_OMP_ORDERED_STANDALONE) != 0;
2458 : : }
2459 : :
2460 : :
2461 : : /* Set the GF_OMP_ORDERED_STANDALONE flag on G. */
2462 : :
2463 : : inline void
2464 : 1015 : gimple_omp_ordered_standalone (gimple *g)
2465 : : {
2466 : 1015 : GIMPLE_CHECK (g, GIMPLE_OMP_ORDERED);
2467 : 1015 : g->subcode |= GF_OMP_ORDERED_STANDALONE;
2468 : 1015 : }
2469 : :
2470 : :
2471 : : /* Return true if OMP parallel statement G has the
2472 : : GF_OMP_PARALLEL_COMBINED flag set. */
2473 : :
2474 : : inline bool
2475 : 35462 : gimple_omp_parallel_combined_p (const gimple *g)
2476 : : {
2477 : 35462 : GIMPLE_CHECK (g, GIMPLE_OMP_PARALLEL);
2478 : 35462 : return (gimple_omp_subcode (g) & GF_OMP_PARALLEL_COMBINED) != 0;
2479 : : }
2480 : :
2481 : :
2482 : : /* Set the GF_OMP_PARALLEL_COMBINED field in G depending on the boolean
2483 : : value of COMBINED_P. */
2484 : :
2485 : : inline void
2486 : 377 : gimple_omp_parallel_set_combined_p (gimple *g, bool combined_p)
2487 : : {
2488 : 377 : GIMPLE_CHECK (g, GIMPLE_OMP_PARALLEL);
2489 : 377 : if (combined_p)
2490 : 377 : g->subcode |= GF_OMP_PARALLEL_COMBINED;
2491 : : else
2492 : 0 : g->subcode &= ~GF_OMP_PARALLEL_COMBINED;
2493 : 377 : }
2494 : :
2495 : :
2496 : : /* Return true if OMP atomic load/store statement G has the
2497 : : GF_OMP_ATOMIC_NEED_VALUE flag set. */
2498 : :
2499 : : inline bool
2500 : 12731 : gimple_omp_atomic_need_value_p (const gimple *g)
2501 : : {
2502 : 12731 : if (gimple_code (g) != GIMPLE_OMP_ATOMIC_LOAD)
2503 : 5935 : GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_STORE);
2504 : 12731 : return (gimple_omp_subcode (g) & GF_OMP_ATOMIC_NEED_VALUE) != 0;
2505 : : }
2506 : :
2507 : :
2508 : : /* Set the GF_OMP_ATOMIC_NEED_VALUE flag on G. */
2509 : :
2510 : : inline void
2511 : 2933 : gimple_omp_atomic_set_need_value (gimple *g)
2512 : : {
2513 : 2933 : if (gimple_code (g) != GIMPLE_OMP_ATOMIC_LOAD)
2514 : 868 : GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_STORE);
2515 : 2933 : g->subcode |= GF_OMP_ATOMIC_NEED_VALUE;
2516 : 2933 : }
2517 : :
2518 : :
2519 : : /* Return true if OMP atomic load/store statement G has the
2520 : : GF_OMP_ATOMIC_WEAK flag set. */
2521 : :
2522 : : inline bool
2523 : 1343 : gimple_omp_atomic_weak_p (const gimple *g)
2524 : : {
2525 : 1343 : if (gimple_code (g) != GIMPLE_OMP_ATOMIC_LOAD)
2526 : 526 : GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_STORE);
2527 : 1343 : return (gimple_omp_subcode (g) & GF_OMP_ATOMIC_WEAK) != 0;
2528 : : }
2529 : :
2530 : :
2531 : : /* Set the GF_OMP_ATOMIC_WEAK flag on G. */
2532 : :
2533 : : inline void
2534 : 74 : gimple_omp_atomic_set_weak (gimple *g)
2535 : : {
2536 : 74 : if (gimple_code (g) != GIMPLE_OMP_ATOMIC_LOAD)
2537 : 37 : GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_STORE);
2538 : 74 : g->subcode |= GF_OMP_ATOMIC_WEAK;
2539 : 74 : }
2540 : :
2541 : :
2542 : : /* Return the memory order of the OMP atomic load/store statement G. */
2543 : :
2544 : : inline enum omp_memory_order
2545 : 10908 : gimple_omp_atomic_memory_order (const gimple *g)
2546 : : {
2547 : 10908 : if (gimple_code (g) != GIMPLE_OMP_ATOMIC_LOAD)
2548 : 1387 : GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_STORE);
2549 : 10908 : return (enum omp_memory_order)
2550 : 10908 : (gimple_omp_subcode (g) & GF_OMP_ATOMIC_MEMORY_ORDER);
2551 : : }
2552 : :
2553 : :
2554 : : /* Set the memory order on G. */
2555 : :
2556 : : inline void
2557 : 20634 : gimple_omp_atomic_set_memory_order (gimple *g, enum omp_memory_order mo)
2558 : : {
2559 : 20634 : if (gimple_code (g) != GIMPLE_OMP_ATOMIC_LOAD)
2560 : 10317 : GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_STORE);
2561 : 20634 : g->subcode = ((g->subcode & ~GF_OMP_ATOMIC_MEMORY_ORDER)
2562 : 20634 : | (mo & GF_OMP_ATOMIC_MEMORY_ORDER));
2563 : 20634 : }
2564 : :
2565 : :
2566 : : /* Return the number of operands for statement GS. */
2567 : :
2568 : : inline unsigned
2569 : >18755*10^7 : gimple_num_ops (const gimple *gs)
2570 : : {
2571 : 81280795500 : return gs->num_ops;
2572 : : }
2573 : :
2574 : :
2575 : : /* Set the number of operands for statement GS. */
2576 : :
2577 : : inline void
2578 : 316486865 : gimple_set_num_ops (gimple *gs, unsigned num_ops)
2579 : : {
2580 : 7246569 : gs->num_ops = num_ops;
2581 : : }
2582 : :
2583 : :
2584 : : /* Return the array of operands for statement GS. */
2585 : :
2586 : : inline tree *
2587 : 86412372256 : gimple_ops (gimple *gs)
2588 : : {
2589 : 86412372256 : size_t off;
2590 : :
2591 : : /* All the tuples have their operand vector at the very bottom
2592 : : of the structure. Note that those structures that do not
2593 : : have an operand vector have a zero offset. */
2594 : 86412372256 : off = gimple_ops_offset_[gimple_statement_structure (gs)];
2595 : 86412372256 : gcc_gimple_checking_assert (off != 0);
2596 : :
2597 : 86412372256 : return (tree *) ((char *) gs + off);
2598 : : }
2599 : :
2600 : :
2601 : : /* Return operand I for statement GS. */
2602 : :
2603 : : inline tree
2604 : 21223952583 : gimple_op (const gimple *gs, unsigned i)
2605 : : {
2606 : 21223952583 : if (gimple_has_ops (gs))
2607 : : {
2608 : 21223952583 : gcc_gimple_checking_assert (i < gimple_num_ops (gs));
2609 : 21223952583 : return gimple_ops (CONST_CAST_GIMPLE (gs))[i];
2610 : : }
2611 : : else
2612 : : return NULL_TREE;
2613 : : }
2614 : :
2615 : : /* Return a pointer to operand I for statement GS. */
2616 : :
2617 : : inline tree *
2618 : 64869892654 : gimple_op_ptr (gimple *gs, unsigned i)
2619 : : {
2620 : 64869892654 : if (gimple_has_ops (gs))
2621 : : {
2622 : 64869892654 : gcc_gimple_checking_assert (i < gimple_num_ops (gs));
2623 : 64869892654 : return gimple_ops (gs) + i;
2624 : : }
2625 : : else
2626 : : return NULL;
2627 : : }
2628 : :
2629 : : /* Set operand I of statement GS to OP. */
2630 : :
2631 : : inline void
2632 : 318527019 : gimple_set_op (gimple *gs, unsigned i, tree op)
2633 : : {
2634 : 637054038 : gcc_gimple_checking_assert (gimple_has_ops (gs) && i < gimple_num_ops (gs));
2635 : :
2636 : : /* Note. It may be tempting to assert that OP matches
2637 : : is_gimple_operand, but that would be wrong. Different tuples
2638 : : accept slightly different sets of tree operands. Each caller
2639 : : should perform its own validation. */
2640 : 318527019 : gimple_ops (gs)[i] = op;
2641 : 318527019 : }
2642 : :
2643 : : /* Return true if GS is a GIMPLE_ASSIGN. */
2644 : :
2645 : : inline bool
2646 : 22630082191 : is_gimple_assign (const gimple *gs)
2647 : : {
2648 : 14493988580 : return gimple_code (gs) == GIMPLE_ASSIGN;
2649 : : }
2650 : :
2651 : : /* Determine if expression CODE is one of the valid expressions that can
2652 : : be used on the RHS of GIMPLE assignments. */
2653 : :
2654 : : inline enum gimple_rhs_class
2655 : 76625747678 : get_gimple_rhs_class (enum tree_code code)
2656 : : {
2657 : 69734235198 : return (enum gimple_rhs_class) gimple_rhs_class_table[(int) code];
2658 : : }
2659 : :
2660 : : /* Return the LHS of assignment statement GS. */
2661 : :
2662 : : inline tree
2663 : 25446601020 : gimple_assign_lhs (const gassign *gs)
2664 : : {
2665 : 20438889987 : return gs->op[0];
2666 : : }
2667 : :
2668 : : inline tree
2669 : 18577322011 : gimple_assign_lhs (const gimple *gs)
2670 : : {
2671 : 18577322011 : const gassign *ass = GIMPLE_CHECK2<const gassign *> (gs);
2672 : 18577322011 : return gimple_assign_lhs (ass);
2673 : : }
2674 : :
2675 : :
2676 : : /* Return a pointer to the LHS of assignment statement GS. */
2677 : :
2678 : : inline tree *
2679 : 190107838 : gimple_assign_lhs_ptr (gassign *gs)
2680 : : {
2681 : 190107838 : return &gs->op[0];
2682 : : }
2683 : :
2684 : : inline tree *
2685 : 190107838 : gimple_assign_lhs_ptr (gimple *gs)
2686 : : {
2687 : 190107838 : gassign *ass = GIMPLE_CHECK2<gassign *> (gs);
2688 : 190107838 : return gimple_assign_lhs_ptr (ass);
2689 : : }
2690 : :
2691 : :
2692 : : /* Set LHS to be the LHS operand of assignment statement GS. */
2693 : :
2694 : : inline void
2695 : 97916691 : gimple_assign_set_lhs (gassign *gs, tree lhs)
2696 : : {
2697 : 97916691 : gs->op[0] = lhs;
2698 : :
2699 : 97916691 : if (lhs && TREE_CODE (lhs) == SSA_NAME)
2700 : 45359346 : SSA_NAME_DEF_STMT (lhs) = gs;
2701 : : }
2702 : :
2703 : : inline void
2704 : 4010156 : gimple_assign_set_lhs (gimple *gs, tree lhs)
2705 : : {
2706 : 4010156 : gassign *ass = GIMPLE_CHECK2<gassign *> (gs);
2707 : 4010156 : gimple_assign_set_lhs (ass, lhs);
2708 : 4010156 : }
2709 : :
2710 : :
2711 : : /* Return the first operand on the RHS of assignment statement GS. */
2712 : :
2713 : : inline tree
2714 : 25657019730 : gimple_assign_rhs1 (const gassign *gs)
2715 : : {
2716 : 23193167700 : return gs->op[1];
2717 : : }
2718 : :
2719 : : inline tree
2720 : 20283761303 : gimple_assign_rhs1 (const gimple *gs)
2721 : : {
2722 : 20283761303 : const gassign *ass = GIMPLE_CHECK2<const gassign *> (gs);
2723 : 20283761303 : return gimple_assign_rhs1 (ass);
2724 : : }
2725 : :
2726 : :
2727 : : /* Return a pointer to the first operand on the RHS of assignment
2728 : : statement GS. */
2729 : :
2730 : : inline tree *
2731 : 204097750 : gimple_assign_rhs1_ptr (gassign *gs)
2732 : : {
2733 : 204097750 : return &gs->op[1];
2734 : : }
2735 : :
2736 : : inline tree *
2737 : 203902851 : gimple_assign_rhs1_ptr (gimple *gs)
2738 : : {
2739 : 203902851 : gassign *ass = GIMPLE_CHECK2<gassign *> (gs);
2740 : 203902851 : return gimple_assign_rhs1_ptr (ass);
2741 : : }
2742 : :
2743 : : /* Set RHS to be the first operand on the RHS of assignment statement GS. */
2744 : :
2745 : : inline void
2746 : 105319465 : gimple_assign_set_rhs1 (gassign *gs, tree rhs)
2747 : : {
2748 : 94125544 : gs->op[1] = rhs;
2749 : 130 : }
2750 : :
2751 : : inline void
2752 : 11449240 : gimple_assign_set_rhs1 (gimple *gs, tree rhs)
2753 : : {
2754 : 11449240 : gassign *ass = GIMPLE_CHECK2<gassign *> (gs);
2755 : 11449240 : gimple_assign_set_rhs1 (ass, rhs);
2756 : 11449240 : }
2757 : :
2758 : :
2759 : : /* Return the second operand on the RHS of assignment statement GS.
2760 : : If GS does not have two operands, NULL is returned instead. */
2761 : :
2762 : : inline tree
2763 : 4023113849 : gimple_assign_rhs2 (const gassign *gs)
2764 : : {
2765 : 3641335796 : if (gimple_num_ops (gs) >= 3)
2766 : 2490569821 : return gs->op[2];
2767 : : else
2768 : : return NULL_TREE;
2769 : : }
2770 : :
2771 : : inline tree
2772 : 1162778269 : gimple_assign_rhs2 (const gimple *gs)
2773 : : {
2774 : 1162778269 : const gassign *ass = GIMPLE_CHECK2<const gassign *> (gs);
2775 : 1162778269 : return gimple_assign_rhs2 (ass);
2776 : : }
2777 : :
2778 : :
2779 : : /* Return a pointer to the second operand on the RHS of assignment
2780 : : statement GS. */
2781 : :
2782 : : inline tree *
2783 : 741259 : gimple_assign_rhs2_ptr (gassign *gs)
2784 : : {
2785 : 741259 : gcc_gimple_checking_assert (gimple_num_ops (gs) >= 3);
2786 : 741259 : return &gs->op[2];
2787 : : }
2788 : :
2789 : : inline tree *
2790 : 740882 : gimple_assign_rhs2_ptr (gimple *gs)
2791 : : {
2792 : 740882 : gassign *ass = GIMPLE_CHECK2<gassign *> (gs);
2793 : 740882 : return gimple_assign_rhs2_ptr (ass);
2794 : : }
2795 : :
2796 : :
2797 : : /* Set RHS to be the second operand on the RHS of assignment statement GS. */
2798 : :
2799 : : inline void
2800 : 21233158 : gimple_assign_set_rhs2 (gassign *gs, tree rhs)
2801 : : {
2802 : 21233158 : gcc_gimple_checking_assert (gimple_num_ops (gs) >= 3);
2803 : 21233158 : gs->op[2] = rhs;
2804 : 21233158 : }
2805 : :
2806 : : inline void
2807 : 5169150 : gimple_assign_set_rhs2 (gimple *gs, tree rhs)
2808 : : {
2809 : 5169150 : gassign *ass = GIMPLE_CHECK2<gassign *> (gs);
2810 : 5169150 : return gimple_assign_set_rhs2 (ass, rhs);
2811 : : }
2812 : :
2813 : : /* Return the third operand on the RHS of assignment statement GS.
2814 : : If GS does not have two operands, NULL is returned instead. */
2815 : :
2816 : : inline tree
2817 : 18989509 : gimple_assign_rhs3 (const gassign *gs)
2818 : : {
2819 : 13773599 : if (gimple_num_ops (gs) >= 4)
2820 : 13988705 : return gs->op[3];
2821 : : else
2822 : : return NULL_TREE;
2823 : : }
2824 : :
2825 : : inline tree
2826 : 7754599 : gimple_assign_rhs3 (const gimple *gs)
2827 : : {
2828 : 7754599 : const gassign *ass = GIMPLE_CHECK2<const gassign *> (gs);
2829 : 7754599 : return gimple_assign_rhs3 (ass);
2830 : : }
2831 : :
2832 : : /* Return a pointer to the third operand on the RHS of assignment
2833 : : statement GS. */
2834 : :
2835 : : inline tree *
2836 : 374 : gimple_assign_rhs3_ptr (gimple *gs)
2837 : : {
2838 : 374 : gassign *ass = GIMPLE_CHECK2<gassign *> (gs);
2839 : 374 : gcc_gimple_checking_assert (gimple_num_ops (gs) >= 4);
2840 : 374 : return &ass->op[3];
2841 : : }
2842 : :
2843 : :
2844 : : /* Set RHS to be the third operand on the RHS of assignment statement GS. */
2845 : :
2846 : : inline void
2847 : 467581 : gimple_assign_set_rhs3 (gassign *gs, tree rhs)
2848 : : {
2849 : 467581 : gcc_gimple_checking_assert (gimple_num_ops (gs) >= 4);
2850 : 467581 : gs->op[3] = rhs;
2851 : 467581 : }
2852 : :
2853 : : inline void
2854 : 33235 : gimple_assign_set_rhs3 (gimple *gs, tree rhs)
2855 : : {
2856 : 33235 : gassign *ass = GIMPLE_CHECK2<gassign *> (gs);
2857 : 33235 : gimple_assign_set_rhs3 (ass, rhs);
2858 : 33235 : }
2859 : :
2860 : :
2861 : : /* A wrapper around 3 operand gimple_assign_set_rhs_with_ops, for callers
2862 : : which expect to see only two operands. */
2863 : :
2864 : : inline void
2865 : 316531 : gimple_assign_set_rhs_with_ops (gimple_stmt_iterator *gsi, enum tree_code code,
2866 : : tree op1, tree op2)
2867 : : {
2868 : 316531 : gimple_assign_set_rhs_with_ops (gsi, code, op1, op2, NULL);
2869 : 1489 : }
2870 : :
2871 : : /* A wrapper around 3 operand gimple_assign_set_rhs_with_ops, for callers
2872 : : which expect to see only one operands. */
2873 : :
2874 : : inline void
2875 : 66688 : gimple_assign_set_rhs_with_ops (gimple_stmt_iterator *gsi, enum tree_code code,
2876 : : tree op1)
2877 : : {
2878 : 66688 : gimple_assign_set_rhs_with_ops (gsi, code, op1, NULL, NULL);
2879 : 54173 : }
2880 : :
2881 : : /* Returns true if GS is a nontemporal move. */
2882 : :
2883 : : inline bool
2884 : 4562709401 : gimple_assign_nontemporal_move_p (const gassign *gs)
2885 : : {
2886 : 4562709401 : return gs->nontemporal_move;
2887 : : }
2888 : :
2889 : : /* Sets nontemporal move flag of GS to NONTEMPORAL. */
2890 : :
2891 : : inline void
2892 : 2 : gimple_assign_set_nontemporal_move (gimple *gs, bool nontemporal)
2893 : : {
2894 : 2 : GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
2895 : 2 : gs->nontemporal_move = nontemporal;
2896 : 2 : }
2897 : :
2898 : :
2899 : : /* Return the code of the expression computed on the rhs of assignment
2900 : : statement GS. In case that the RHS is a single object, returns the
2901 : : tree code of the object. */
2902 : :
2903 : : inline enum tree_code
2904 : 45269073682 : gimple_assign_rhs_code (const gassign *gs)
2905 : : {
2906 : 45346949955 : enum tree_code code = (enum tree_code) gs->subcode;
2907 : : /* While we initially set subcode to the TREE_CODE of the rhs for
2908 : : GIMPLE_SINGLE_RHS assigns we do not update that subcode to stay
2909 : : in sync when we rewrite stmts into SSA form or do SSA propagations. */
2910 : 35719781792 : if (get_gimple_rhs_class (code) == GIMPLE_SINGLE_RHS)
2911 : 28833336809 : code = TREE_CODE (gs->op[1]);
2912 : :
2913 : 35608162334 : return code;
2914 : : }
2915 : :
2916 : : inline enum tree_code
2917 : 33954247502 : gimple_assign_rhs_code (const gimple *gs)
2918 : : {
2919 : 33954247502 : const gassign *ass = GIMPLE_CHECK2<const gassign *> (gs);
2920 : 33954247502 : return gimple_assign_rhs_code (ass);
2921 : : }
2922 : :
2923 : :
2924 : : /* Set CODE to be the code for the expression computed on the RHS of
2925 : : assignment S. */
2926 : :
2927 : : inline void
2928 : 2240504 : gimple_assign_set_rhs_code (gimple *s, enum tree_code code)
2929 : : {
2930 : 2240504 : GIMPLE_CHECK (s, GIMPLE_ASSIGN);
2931 : 2240504 : s->subcode = code;
2932 : 2240504 : }
2933 : :
2934 : :
2935 : : /* Return the gimple rhs class of the code of the expression computed on
2936 : : the rhs of assignment statement GS.
2937 : : This will never return GIMPLE_INVALID_RHS. */
2938 : :
2939 : : inline enum gimple_rhs_class
2940 : 28950178665 : gimple_assign_rhs_class (const gimple *gs)
2941 : : {
2942 : 28942391438 : return get_gimple_rhs_class (gimple_assign_rhs_code (gs));
2943 : : }
2944 : :
2945 : : /* Return true if GS is an assignment with a singleton RHS, i.e.,
2946 : : there is no operator associated with the assignment itself.
2947 : : Unlike gimple_assign_copy_p, this predicate returns true for
2948 : : any RHS operand, including those that perform an operation
2949 : : and do not have the semantics of a copy, such as COND_EXPR. */
2950 : :
2951 : : inline bool
2952 : 16312617501 : gimple_assign_single_p (const gimple *gs)
2953 : : {
2954 : 16312617501 : return (is_gimple_assign (gs)
2955 : 28327686865 : && gimple_assign_rhs_class (gs) == GIMPLE_SINGLE_RHS);
2956 : : }
2957 : :
2958 : : /* Return true if GS performs a store to its lhs. */
2959 : :
2960 : : inline bool
2961 : 1307311527 : gimple_store_p (const gimple *gs)
2962 : : {
2963 : 1307311527 : tree lhs = gimple_get_lhs (gs);
2964 : 1307311527 : return lhs && !is_gimple_reg (lhs);
2965 : : }
2966 : :
2967 : : /* Return true if S is a type-cast assignment. */
2968 : :
2969 : : inline bool
2970 : 25761726 : gimple_assign_cast_p (const gimple *s)
2971 : : {
2972 : 25761726 : if (is_gimple_assign (s))
2973 : : {
2974 : 13851585 : enum tree_code sc = gimple_assign_rhs_code (s);
2975 : 13851585 : return CONVERT_EXPR_CODE_P (sc)
2976 : 11738064 : || sc == VIEW_CONVERT_EXPR
2977 : 13851585 : || sc == FIX_TRUNC_EXPR;
2978 : : }
2979 : :
2980 : : return false;
2981 : : }
2982 : :
2983 : : /* Return true if S is a clobber statement. */
2984 : :
2985 : : inline bool
2986 : 8083720343 : gimple_clobber_p (const gimple *s)
2987 : : {
2988 : 8083720343 : return gimple_assign_single_p (s)
2989 : 8083720343 : && TREE_CLOBBER_P (gimple_assign_rhs1 (s));
2990 : : }
2991 : :
2992 : : /* Return true if S is a clobber statement. */
2993 : :
2994 : : inline bool
2995 : 89926722 : gimple_clobber_p (const gimple *s, enum clobber_kind kind)
2996 : : {
2997 : 89926722 : return gimple_clobber_p (s)
2998 : 89926722 : && CLOBBER_KIND (gimple_assign_rhs1 (s)) == kind;
2999 : : }
3000 : :
3001 : : /* Return true if GS is a GIMPLE_CALL. */
3002 : :
3003 : : inline bool
3004 : 18600040654 : is_gimple_call (const gimple *gs)
3005 : : {
3006 : 21073469898 : return gimple_code (gs) == GIMPLE_CALL;
3007 : : }
3008 : :
3009 : : /* Return the LHS of call statement GS. */
3010 : :
3011 : : inline tree
3012 : 5652779180 : gimple_call_lhs (const gcall *gs)
3013 : : {
3014 : 1667438594 : return gs->op[0];
3015 : : }
3016 : :
3017 : : inline tree
3018 : 4140860877 : gimple_call_lhs (const gimple *gs)
3019 : : {
3020 : 4140860877 : const gcall *gc = GIMPLE_CHECK2<const gcall *> (gs);
3021 : 4140860877 : return gimple_call_lhs (gc);
3022 : : }
3023 : :
3024 : :
3025 : : /* Return a pointer to the LHS of call statement GS. */
3026 : :
3027 : : inline tree *
3028 : 830778524 : gimple_call_lhs_ptr (gcall *gs)
3029 : : {
3030 : 830778524 : return &gs->op[0];
3031 : : }
3032 : :
3033 : : inline tree *
3034 : 773127620 : gimple_call_lhs_ptr (gimple *gs)
3035 : : {
3036 : 773127620 : gcall *gc = GIMPLE_CHECK2<gcall *> (gs);
3037 : 773127620 : return gimple_call_lhs_ptr (gc);
3038 : : }
3039 : :
3040 : :
3041 : : /* Set LHS to be the LHS operand of call statement GS. */
3042 : :
3043 : : inline void
3044 : 6478890 : gimple_call_set_lhs (gcall *gs, tree lhs)
3045 : : {
3046 : 6478890 : gs->op[0] = lhs;
3047 : 6401810 : if (lhs && TREE_CODE (lhs) == SSA_NAME)
3048 : 2799153 : SSA_NAME_DEF_STMT (lhs) = gs;
3049 : 3 : }
3050 : :
3051 : : inline void
3052 : 1330295 : gimple_call_set_lhs (gimple *gs, tree lhs)
3053 : : {
3054 : 1330295 : gcall *gc = GIMPLE_CHECK2<gcall *> (gs);
3055 : 1330295 : gimple_call_set_lhs (gc, lhs);
3056 : 1330295 : }
3057 : :
3058 : :
3059 : : /* Return true if call GS calls an internal-only function, as enumerated
3060 : : by internal_fn. */
3061 : :
3062 : : inline bool
3063 : 13434837925 : gimple_call_internal_p (const gcall *gs)
3064 : : {
3065 : 3847206342 : return (gs->subcode & GF_CALL_INTERNAL) != 0;
3066 : : }
3067 : :
3068 : : inline bool
3069 : 5884090683 : gimple_call_internal_p (const gimple *gs)
3070 : : {
3071 : 5884090683 : const gcall *gc = GIMPLE_CHECK2<const gcall *> (gs);
3072 : 5884090683 : return gimple_call_internal_p (gc);
3073 : : }
3074 : :
3075 : : /* Return true if call GS is marked as nocf_check. */
3076 : :
3077 : : inline bool
3078 : 8312579 : gimple_call_nocf_check_p (const gcall *gs)
3079 : : {
3080 : 8312579 : return (gs->subcode & GF_CALL_NOCF_CHECK) != 0;
3081 : : }
3082 : :
3083 : : /* Mark statement GS as nocf_check call. */
3084 : :
3085 : : inline void
3086 : 21 : gimple_call_set_nocf_check (gcall *gs, bool nocf_check)
3087 : : {
3088 : 21 : if (nocf_check)
3089 : 21 : gs->subcode |= GF_CALL_NOCF_CHECK;
3090 : : else
3091 : : gs->subcode &= ~GF_CALL_NOCF_CHECK;
3092 : 21 : }
3093 : :
3094 : : /* Return the target of internal call GS. */
3095 : :
3096 : : inline enum internal_fn
3097 : 153159085 : gimple_call_internal_fn (const gcall *gs)
3098 : : {
3099 : 153159085 : gcc_gimple_checking_assert (gimple_call_internal_p (gs));
3100 : 153159085 : return gs->u.internal_fn;
3101 : : }
3102 : :
3103 : : inline enum internal_fn
3104 : 131765896 : gimple_call_internal_fn (const gimple *gs)
3105 : : {
3106 : 131765896 : const gcall *gc = GIMPLE_CHECK2<const gcall *> (gs);
3107 : 131765896 : return gimple_call_internal_fn (gc);
3108 : : }
3109 : :
3110 : : /* Return true, if this internal gimple call is unique. */
3111 : :
3112 : : inline bool
3113 : 855571 : gimple_call_internal_unique_p (const gcall *gs)
3114 : : {
3115 : 1710658 : return gimple_call_internal_fn (gs) == IFN_UNIQUE;
3116 : : }
3117 : :
3118 : : inline bool
3119 : 855087 : gimple_call_internal_unique_p (const gimple *gs)
3120 : : {
3121 : 855087 : const gcall *gc = GIMPLE_CHECK2<const gcall *> (gs);
3122 : 855087 : return gimple_call_internal_unique_p (gc);
3123 : : }
3124 : :
3125 : : /* Return true if GS is an internal function FN. */
3126 : :
3127 : : inline bool
3128 : 3232034517 : gimple_call_internal_p (const gimple *gs, internal_fn fn)
3129 : : {
3130 : 3232034517 : return (is_gimple_call (gs)
3131 : 1389306908 : && gimple_call_internal_p (gs)
3132 : 3274338820 : && gimple_call_internal_fn (gs) == fn);
3133 : : }
3134 : :
3135 : : /* If CTRL_ALTERING_P is true, mark GIMPLE_CALL S to be a stmt
3136 : : that could alter control flow. */
3137 : :
3138 : : inline void
3139 : 33525096 : gimple_call_set_ctrl_altering (gcall *s, bool ctrl_altering_p)
3140 : : {
3141 : 33525096 : if (ctrl_altering_p)
3142 : 24332204 : s->subcode |= GF_CALL_CTRL_ALTERING;
3143 : : else
3144 : 9192892 : s->subcode &= ~GF_CALL_CTRL_ALTERING;
3145 : : }
3146 : :
3147 : : inline void
3148 : 33278202 : gimple_call_set_ctrl_altering (gimple *s, bool ctrl_altering_p)
3149 : : {
3150 : 33278202 : gcall *gc = GIMPLE_CHECK2<gcall *> (s);
3151 : 33278202 : gimple_call_set_ctrl_altering (gc, ctrl_altering_p);
3152 : 33278202 : }
3153 : :
3154 : : /* Return true if call GS calls an func whose GF_CALL_CTRL_ALTERING
3155 : : flag is set. Such call could not be a stmt in the middle of a bb. */
3156 : :
3157 : : inline bool
3158 : 2226884906 : gimple_call_ctrl_altering_p (const gcall *gs)
3159 : : {
3160 : 1153356985 : return (gs->subcode & GF_CALL_CTRL_ALTERING) != 0;
3161 : : }
3162 : :
3163 : : inline bool
3164 : 1147948772 : gimple_call_ctrl_altering_p (const gimple *gs)
3165 : : {
3166 : 1147948772 : const gcall *gc = GIMPLE_CHECK2<const gcall *> (gs);
3167 : 1147948772 : return gimple_call_ctrl_altering_p (gc);
3168 : : }
3169 : :
3170 : :
3171 : : /* Return the function type of the function called by GS. */
3172 : :
3173 : : inline tree
3174 : 5661959183 : gimple_call_fntype (const gcall *gs)
3175 : : {
3176 : 1173138678 : if (gimple_call_internal_p (gs))
3177 : : return NULL_TREE;
3178 : 5615411273 : return gs->u.fntype;
3179 : : }
3180 : :
3181 : : inline tree
3182 : 4140861689 : gimple_call_fntype (const gimple *gs)
3183 : : {
3184 : 4140861689 : const gcall *call_stmt = GIMPLE_CHECK2<const gcall *> (gs);
3185 : 4140861689 : return gimple_call_fntype (call_stmt);
3186 : : }
3187 : :
3188 : : /* Set the type of the function called by CALL_STMT to FNTYPE. */
3189 : :
3190 : : inline void
3191 : 23262299 : gimple_call_set_fntype (gcall *call_stmt, tree fntype)
3192 : : {
3193 : 23262299 : gcc_gimple_checking_assert (!gimple_call_internal_p (call_stmt));
3194 : 23262299 : call_stmt->u.fntype = fntype;
3195 : 23262299 : }
3196 : :
3197 : :
3198 : : /* Return the tree node representing the function called by call
3199 : : statement GS. */
3200 : :
3201 : : inline tree
3202 : 9959491336 : gimple_call_fn (const gcall *gs)
3203 : : {
3204 : 2174748061 : return gs->op[1];
3205 : : }
3206 : :
3207 : : inline tree
3208 : 86431467 : gimple_call_fn (const gimple *gs)
3209 : : {
3210 : 86431467 : const gcall *gc = GIMPLE_CHECK2<const gcall *> (gs);
3211 : 86431467 : return gimple_call_fn (gc);
3212 : : }
3213 : :
3214 : : /* Return a pointer to the tree node representing the function called by call
3215 : : statement GS. */
3216 : :
3217 : : inline tree *
3218 : 1973591289 : gimple_call_fn_ptr (gcall *gs)
3219 : : {
3220 : 1973591289 : return &gs->op[1];
3221 : : }
3222 : :
3223 : : inline tree *
3224 : 1973591289 : gimple_call_fn_ptr (gimple *gs)
3225 : : {
3226 : 1973591289 : gcall *gc = GIMPLE_CHECK2<gcall *> (gs);
3227 : 1973591289 : return gimple_call_fn_ptr (gc);
3228 : : }
3229 : :
3230 : :
3231 : : /* Set FN to be the function called by call statement GS. */
3232 : :
3233 : : inline void
3234 : 3663 : gimple_call_set_fn (gcall *gs, tree fn)
3235 : : {
3236 : 3663 : gcc_gimple_checking_assert (!gimple_call_internal_p (gs));
3237 : 3663 : gs->op[1] = fn;
3238 : 3663 : }
3239 : :
3240 : :
3241 : : /* Set FNDECL to be the function called by call statement GS. */
3242 : :
3243 : : inline void
3244 : 601500 : gimple_call_set_fndecl (gcall *gs, tree decl)
3245 : : {
3246 : 601500 : gcc_gimple_checking_assert (!gimple_call_internal_p (gs));
3247 : 601500 : gs->op[1] = build1_loc (gimple_location (gs), ADDR_EXPR,
3248 : 601500 : build_pointer_type (TREE_TYPE (decl)), decl);
3249 : 601500 : }
3250 : :
3251 : : inline void
3252 : 34079 : gimple_call_set_fndecl (gimple *gs, tree decl)
3253 : : {
3254 : 34079 : gcall *gc = GIMPLE_CHECK2<gcall *> (gs);
3255 : 34079 : gimple_call_set_fndecl (gc, decl);
3256 : 34079 : }
3257 : :
3258 : :
3259 : : /* Set internal function FN to be the function called by call statement CALL_STMT. */
3260 : :
3261 : : inline void
3262 : 652031 : gimple_call_set_internal_fn (gcall *call_stmt, enum internal_fn fn)
3263 : : {
3264 : 652031 : gcc_gimple_checking_assert (gimple_call_internal_p (call_stmt));
3265 : 652031 : call_stmt->u.internal_fn = fn;
3266 : 652031 : }
3267 : :
3268 : :
3269 : : /* If a given GIMPLE_CALL's callee is a FUNCTION_DECL, return it.
3270 : : Otherwise return NULL. This function is analogous to
3271 : : get_callee_fndecl in tree land. */
3272 : :
3273 : : inline tree
3274 : 8708425788 : gimple_call_fndecl (const gcall *gs)
3275 : : {
3276 : 2582738161 : return gimple_call_addr_fndecl (gimple_call_fn (gs));
3277 : : }
3278 : :
3279 : : inline tree
3280 : 6406917315 : gimple_call_fndecl (const gimple *gs)
3281 : : {
3282 : 6406917315 : const gcall *gc = GIMPLE_CHECK2<const gcall *> (gs);
3283 : 6406917315 : return gimple_call_fndecl (gc);
3284 : : }
3285 : :
3286 : :
3287 : : /* Return the type returned by call statement GS. */
3288 : :
3289 : : inline tree
3290 : 12455681 : gimple_call_return_type (const gcall *gs)
3291 : : {
3292 : 12455681 : tree type = gimple_call_fntype (gs);
3293 : :
3294 : 12454016 : if (type == NULL_TREE)
3295 : 1665 : return TREE_TYPE (gimple_call_lhs (gs));
3296 : :
3297 : : /* The type returned by a function is the type of its
3298 : : function type. */
3299 : 12454016 : return TREE_TYPE (type);
3300 : : }
3301 : :
3302 : :
3303 : : /* Return the static chain for call statement GS. */
3304 : :
3305 : : inline tree
3306 : 2326087760 : gimple_call_chain (const gcall *gs)
3307 : : {
3308 : 1285502013 : return gs->op[2];
3309 : : }
3310 : :
3311 : : inline tree
3312 : 16894012 : gimple_call_chain (const gimple *gs)
3313 : : {
3314 : 16894012 : const gcall *gc = GIMPLE_CHECK2<const gcall *> (gs);
3315 : 16894012 : return gimple_call_chain (gc);
3316 : : }
3317 : :
3318 : :
3319 : : /* Return a pointer to the static chain for call statement CALL_STMT. */
3320 : :
3321 : : inline tree *
3322 : 1973620650 : gimple_call_chain_ptr (gcall *call_stmt)
3323 : : {
3324 : 1973620650 : return &call_stmt->op[2];
3325 : : }
3326 : :
3327 : : /* Set CHAIN to be the static chain for call statement CALL_STMT. */
3328 : :
3329 : : inline void
3330 : 11046324 : gimple_call_set_chain (gcall *call_stmt, tree chain)
3331 : : {
3332 : 11046324 : call_stmt->op[2] = chain;
3333 : 0 : }
3334 : :
3335 : :
3336 : : /* Return the number of arguments used by call statement GS. */
3337 : :
3338 : : inline unsigned
3339 : 11468612013 : gimple_call_num_args (const gcall *gs)
3340 : : {
3341 : 4788738343 : return gimple_num_ops (gs) - 3;
3342 : : }
3343 : :
3344 : : inline unsigned
3345 : 6997063187 : gimple_call_num_args (const gimple *gs)
3346 : : {
3347 : 6997063187 : const gcall *gc = GIMPLE_CHECK2<const gcall *> (gs);
3348 : 6997063187 : return gimple_call_num_args (gc);
3349 : : }
3350 : :
3351 : :
3352 : : /* Return the argument at position INDEX for call statement GS. */
3353 : :
3354 : : inline tree
3355 : 8082647528 : gimple_call_arg (const gcall *gs, unsigned index)
3356 : : {
3357 : 8077840903 : gcc_gimple_checking_assert (gimple_num_ops (gs) > index + 3);
3358 : 5569657770 : return gs->op[index + 3];
3359 : : }
3360 : :
3361 : : inline tree
3362 : 5141578063 : gimple_call_arg (const gimple *gs, unsigned index)
3363 : : {
3364 : 5141578063 : const gcall *gc = GIMPLE_CHECK2<const gcall *> (gs);
3365 : 5141578063 : return gimple_call_arg (gc, index);
3366 : : }
3367 : :
3368 : :
3369 : : /* Return a pointer to the argument at position INDEX for call
3370 : : statement GS. */
3371 : :
3372 : : inline tree *
3373 : 4071029699 : gimple_call_arg_ptr (gcall *gs, unsigned index)
3374 : : {
3375 : 4071029699 : gcc_gimple_checking_assert (gimple_num_ops (gs) > index + 3);
3376 : 4071023227 : return &gs->op[index + 3];
3377 : : }
3378 : :
3379 : : inline tree *
3380 : 3941203150 : gimple_call_arg_ptr (gimple *gs, unsigned index)
3381 : : {
3382 : 3941203150 : gcall *gc = GIMPLE_CHECK2<gcall *> (gs);
3383 : 3941203150 : return gimple_call_arg_ptr (gc, index);
3384 : : }
3385 : :
3386 : :
3387 : : /* Set ARG to be the argument at position INDEX for call statement GS. */
3388 : :
3389 : : inline void
3390 : 23457848 : gimple_call_set_arg (gcall *gs, unsigned index, tree arg)
3391 : : {
3392 : 23388891 : gcc_gimple_checking_assert (gimple_num_ops (gs) > index + 3);
3393 : 23296628 : gs->op[index + 3] = arg;
3394 : 23422226 : }
3395 : :
3396 : : inline void
3397 : 535720 : gimple_call_set_arg (gimple *gs, unsigned index, tree arg)
3398 : : {
3399 : 535720 : gcall *gc = GIMPLE_CHECK2<gcall *> (gs);
3400 : 535720 : gimple_call_set_arg (gc, index, arg);
3401 : 535720 : }
3402 : :
3403 : :
3404 : : /* If TAIL_P is true, mark call statement S as being a tail call
3405 : : (i.e., a call just before the exit of a function). These calls are
3406 : : candidate for tail call optimization. */
3407 : :
3408 : : inline void
3409 : 10755410 : gimple_call_set_tail (gcall *s, bool tail_p)
3410 : : {
3411 : 10755410 : if (tail_p)
3412 : 193204 : s->subcode |= GF_CALL_TAILCALL;
3413 : : else
3414 : 10562206 : s->subcode &= ~GF_CALL_TAILCALL;
3415 : 82 : }
3416 : :
3417 : :
3418 : : /* Return true if GIMPLE_CALL S is marked as a tail call. */
3419 : :
3420 : : inline bool
3421 : 23687913 : gimple_call_tail_p (const gcall *s)
3422 : : {
3423 : 23687913 : return (s->subcode & GF_CALL_TAILCALL) != 0;
3424 : : }
3425 : :
3426 : : /* Mark (or clear) call statement S as requiring tail call optimization. */
3427 : :
3428 : : inline void
3429 : 10561452 : gimple_call_set_must_tail (gcall *s, bool must_tail_p)
3430 : : {
3431 : 10561452 : if (must_tail_p)
3432 : 860 : s->subcode |= GF_CALL_MUST_TAIL_CALL;
3433 : : else
3434 : 10560592 : s->subcode &= ~GF_CALL_MUST_TAIL_CALL;
3435 : 18 : }
3436 : :
3437 : : /* Return true if call statement has been marked as requiring
3438 : : tail call optimization. */
3439 : :
3440 : : inline bool
3441 : 70021657 : gimple_call_must_tail_p (const gcall *s)
3442 : : {
3443 : 70021614 : return (s->subcode & GF_CALL_MUST_TAIL_CALL) != 0;
3444 : : }
3445 : :
3446 : : /* If RETURN_SLOT_OPT_P is true mark GIMPLE_CALL S as valid for return
3447 : : slot optimization. This transformation uses the target of the call
3448 : : expansion as the return slot for calls that return in memory. */
3449 : :
3450 : : inline void
3451 : 10569064 : gimple_call_set_return_slot_opt (gcall *s, bool return_slot_opt_p)
3452 : : {
3453 : 10569064 : if (return_slot_opt_p)
3454 : 326166 : s->subcode |= GF_CALL_RETURN_SLOT_OPT;
3455 : : else
3456 : 10242898 : s->subcode &= ~GF_CALL_RETURN_SLOT_OPT;
3457 : 383 : }
3458 : :
3459 : :
3460 : : /* Return true if S is marked for return slot optimization. */
3461 : :
3462 : : inline bool
3463 : 146450116 : gimple_call_return_slot_opt_p (const gcall *s)
3464 : : {
3465 : 146450116 : return (s->subcode & GF_CALL_RETURN_SLOT_OPT) != 0;
3466 : : }
3467 : :
3468 : :
3469 : : /* If FROM_THUNK_P is true, mark GIMPLE_CALL S as being the jump from a
3470 : : thunk to the thunked-to function. */
3471 : :
3472 : : inline void
3473 : 10415174 : gimple_call_set_from_thunk (gcall *s, bool from_thunk_p)
3474 : : {
3475 : 10415174 : if (from_thunk_p)
3476 : 20606 : s->subcode |= GF_CALL_FROM_THUNK;
3477 : : else
3478 : 10394568 : s->subcode &= ~GF_CALL_FROM_THUNK;
3479 : 122 : }
3480 : :
3481 : :
3482 : : /* Return true if GIMPLE_CALL S is a jump from a thunk. */
3483 : :
3484 : : inline bool
3485 : 34057914 : gimple_call_from_thunk_p (gcall *s)
3486 : : {
3487 : 34057914 : return (s->subcode & GF_CALL_FROM_THUNK) != 0;
3488 : : }
3489 : :
3490 : :
3491 : : /* If FROM_NEW_OR_DELETE_P is true, mark GIMPLE_CALL S as being a call
3492 : : to operator new or delete created from a new or delete expression. */
3493 : :
3494 : : inline void
3495 : 127790 : gimple_call_set_from_new_or_delete (gcall *s, bool from_new_or_delete_p)
3496 : : {
3497 : 127790 : if (from_new_or_delete_p)
3498 : 121355 : s->subcode |= GF_CALL_FROM_NEW_OR_DELETE;
3499 : : else
3500 : 6435 : s->subcode &= ~GF_CALL_FROM_NEW_OR_DELETE;
3501 : : }
3502 : :
3503 : :
3504 : : /* Return true if GIMPLE_CALL S is a call to operator new or delete from
3505 : : from a new or delete expression. */
3506 : :
3507 : : inline bool
3508 : 115861473 : gimple_call_from_new_or_delete (const gcall *s)
3509 : : {
3510 : 115861473 : return (s->subcode & GF_CALL_FROM_NEW_OR_DELETE) != 0;
3511 : : }
3512 : :
3513 : :
3514 : : /* If PASS_ARG_PACK_P is true, GIMPLE_CALL S is a stdarg call that needs the
3515 : : argument pack in its argument list. */
3516 : :
3517 : : inline void
3518 : 10561695 : gimple_call_set_va_arg_pack (gcall *s, bool pass_arg_pack_p)
3519 : : {
3520 : 10561695 : if (pass_arg_pack_p)
3521 : 130 : s->subcode |= GF_CALL_VA_ARG_PACK;
3522 : : else
3523 : 10561565 : s->subcode &= ~GF_CALL_VA_ARG_PACK;
3524 : : }
3525 : :
3526 : :
3527 : : /* Return true if GIMPLE_CALL S is a stdarg call that needs the
3528 : : argument pack in its argument list. */
3529 : :
3530 : : inline bool
3531 : 21726846 : gimple_call_va_arg_pack_p (const gcall *s)
3532 : : {
3533 : 21726846 : return (s->subcode & GF_CALL_VA_ARG_PACK) != 0;
3534 : : }
3535 : :
3536 : :
3537 : : /* Return true if S is a noreturn call. */
3538 : :
3539 : : inline bool
3540 : 349148490 : gimple_call_noreturn_p (const gcall *s)
3541 : : {
3542 : 482903979 : return (gimple_call_flags (s) & ECF_NORETURN) != 0;
3543 : : }
3544 : :
3545 : : inline bool
3546 : 197166183 : gimple_call_noreturn_p (const gimple *s)
3547 : : {
3548 : 197166183 : const gcall *gc = GIMPLE_CHECK2<const gcall *> (s);
3549 : 197166183 : return gimple_call_noreturn_p (gc);
3550 : : }
3551 : :
3552 : :
3553 : : /* If NOTHROW_P is true, GIMPLE_CALL S is a call that is known to not throw
3554 : : even if the called function can throw in other cases. */
3555 : :
3556 : : inline void
3557 : 10811126 : gimple_call_set_nothrow (gcall *s, bool nothrow_p)
3558 : : {
3559 : 10797682 : if (nothrow_p)
3560 : 2983966 : s->subcode |= GF_CALL_NOTHROW;
3561 : : else
3562 : 7825059 : s->subcode &= ~GF_CALL_NOTHROW;
3563 : 268 : }
3564 : :
3565 : : /* Return true if S is a nothrow call. */
3566 : :
3567 : : inline bool
3568 : 1044703708 : gimple_call_nothrow_p (const gcall *s)
3569 : : {
3570 : 1044703708 : return (gimple_call_flags (s) & ECF_NOTHROW) != 0;
3571 : : }
3572 : :
3573 : : /* If EXPECTED_THROW_P is true, GIMPLE_CALL S is a call that is known
3574 : : to be more likely to throw than to run forever, terminate the
3575 : : program or return by other means. */
3576 : :
3577 : : static inline void
3578 : 10400154 : gimple_call_set_expected_throw (gcall *s, bool expected_throw_p)
3579 : : {
3580 : 10400154 : if (expected_throw_p)
3581 : 23266 : s->subcode |= GF_CALL_XTHROW;
3582 : : else
3583 : 10376888 : s->subcode &= ~GF_CALL_XTHROW;
3584 : : }
3585 : :
3586 : : /* Return true if S is a call that is more likely to end by
3587 : : propagating an exception than by other means. */
3588 : :
3589 : : static inline bool
3590 : 323 : gimple_call_expected_throw_p (gcall *s)
3591 : : {
3592 : 323 : return (gimple_call_flags (s) & ECF_XTHROW) != 0;
3593 : : }
3594 : :
3595 : : /* If FOR_VAR is true, GIMPLE_CALL S is a call to builtin_alloca that
3596 : : is known to be emitted for VLA objects. Those are wrapped by
3597 : : stack_save/stack_restore calls and hence can't lead to unbounded
3598 : : stack growth even when they occur in loops. */
3599 : :
3600 : : inline void
3601 : 38712 : gimple_call_set_alloca_for_var (gcall *s, bool for_var)
3602 : : {
3603 : 38712 : if (for_var)
3604 : 9930 : s->subcode |= GF_CALL_ALLOCA_FOR_VAR;
3605 : : else
3606 : 28782 : s->subcode &= ~GF_CALL_ALLOCA_FOR_VAR;
3607 : : }
3608 : :
3609 : : /* Return true of S is a call to builtin_alloca emitted for VLA objects. */
3610 : :
3611 : : inline bool
3612 : 323804 : gimple_call_alloca_for_var_p (gcall *s)
3613 : : {
3614 : 323804 : return (s->subcode & GF_CALL_ALLOCA_FOR_VAR) != 0;
3615 : : }
3616 : :
3617 : : inline bool
3618 : 311120 : gimple_call_alloca_for_var_p (gimple *s)
3619 : : {
3620 : 311120 : const gcall *gc = GIMPLE_CHECK2<gcall *> (s);
3621 : 311120 : return (gc->subcode & GF_CALL_ALLOCA_FOR_VAR) != 0;
3622 : : }
3623 : :
3624 : : /* If BY_DESCRIPTOR_P is true, GIMPLE_CALL S is an indirect call for which
3625 : : pointers to nested function are descriptors instead of trampolines. */
3626 : :
3627 : : inline void
3628 : 10561390 : gimple_call_set_by_descriptor (gcall *s, bool by_descriptor_p)
3629 : : {
3630 : 10561390 : if (by_descriptor_p)
3631 : 0 : s->subcode |= GF_CALL_BY_DESCRIPTOR;
3632 : : else
3633 : 10561390 : s->subcode &= ~GF_CALL_BY_DESCRIPTOR;
3634 : : }
3635 : :
3636 : : /* Return true if S is a by-descriptor call. */
3637 : :
3638 : : inline bool
3639 : 6572504 : gimple_call_by_descriptor_p (gcall *s)
3640 : : {
3641 : 6572504 : return (s->subcode & GF_CALL_BY_DESCRIPTOR) != 0;
3642 : : }
3643 : :
3644 : : /* Copy all the GF_CALL_* flags from ORIG_CALL to DEST_CALL. */
3645 : :
3646 : : inline void
3647 : 466889 : gimple_call_copy_flags (gcall *dest_call, gcall *orig_call)
3648 : : {
3649 : 466889 : dest_call->subcode = orig_call->subcode;
3650 : : }
3651 : :
3652 : :
3653 : : /* Return a pointer to the points-to solution for the set of call-used
3654 : : variables of the call CALL_STMT. */
3655 : :
3656 : : inline struct pt_solution *
3657 : 53491538 : gimple_call_use_set (gcall *call_stmt)
3658 : : {
3659 : 53491538 : return &call_stmt->call_used;
3660 : : }
3661 : :
3662 : : /* As above, but const. */
3663 : :
3664 : : inline const pt_solution *
3665 : 494 : gimple_call_use_set (const gcall *call_stmt)
3666 : : {
3667 : 494 : return &call_stmt->call_used;
3668 : : }
3669 : :
3670 : : /* Return a pointer to the points-to solution for the set of call-used
3671 : : variables of the call CALL_STMT. */
3672 : :
3673 : : inline struct pt_solution *
3674 : 127844965 : gimple_call_clobber_set (gcall *call_stmt)
3675 : : {
3676 : 127844965 : return &call_stmt->call_clobbered;
3677 : : }
3678 : :
3679 : : /* As above, but const. */
3680 : :
3681 : : inline const pt_solution *
3682 : 494 : gimple_call_clobber_set (const gcall *call_stmt)
3683 : : {
3684 : 494 : return &call_stmt->call_clobbered;
3685 : : }
3686 : :
3687 : :
3688 : : /* Returns true if this is a GIMPLE_ASSIGN or a GIMPLE_CALL with a
3689 : : non-NULL lhs. */
3690 : :
3691 : : inline bool
3692 : 604590621 : gimple_has_lhs (const gimple *stmt)
3693 : : {
3694 : 604167171 : if (is_gimple_assign (stmt))
3695 : : return true;
3696 : 1037224008 : if (const gcall *call = dyn_cast <const gcall *> (stmt))
3697 : 49753657 : return gimple_call_lhs (call) != NULL_TREE;
3698 : : return false;
3699 : : }
3700 : :
3701 : :
3702 : : /* Return the code of the predicate computed by conditional statement GS. */
3703 : :
3704 : : inline enum tree_code
3705 : 3470163696 : gimple_cond_code (const gcond *gs)
3706 : : {
3707 : 2266236490 : return (enum tree_code) gs->subcode;
3708 : : }
3709 : :
3710 : : inline enum tree_code
3711 : 567547712 : gimple_cond_code (const gimple *gs)
3712 : : {
3713 : 567547712 : const gcond *gc = GIMPLE_CHECK2<const gcond *> (gs);
3714 : 567547712 : return gimple_cond_code (gc);
3715 : : }
3716 : :
3717 : :
3718 : : /* Set CODE to be the predicate code for the conditional statement GS. */
3719 : :
3720 : : inline void
3721 : 15704186 : gimple_cond_set_code (gcond *gs, enum tree_code code)
3722 : : {
3723 : 15704186 : gcc_gimple_checking_assert (TREE_CODE_CLASS (code) == tcc_comparison);
3724 : 15704186 : gs->subcode = code;
3725 : 15704186 : }
3726 : :
3727 : :
3728 : : /* Return the LHS of the predicate computed by conditional statement GS. */
3729 : :
3730 : : inline tree
3731 : 3134365832 : gimple_cond_lhs (const gcond *gs)
3732 : : {
3733 : 1859883774 : return gs->op[0];
3734 : : }
3735 : :
3736 : : inline tree
3737 : 734385634 : gimple_cond_lhs (const gimple *gs)
3738 : : {
3739 : 734385634 : const gcond *gc = GIMPLE_CHECK2<const gcond *> (gs);
3740 : 734385634 : return gimple_cond_lhs (gc);
3741 : : }
3742 : :
3743 : : /* Return the pointer to the LHS of the predicate computed by conditional
3744 : : statement GS. */
3745 : :
3746 : : inline tree *
3747 : 7166998 : gimple_cond_lhs_ptr (gcond *gs)
3748 : : {
3749 : 7166998 : return &gs->op[0];
3750 : : }
3751 : :
3752 : : /* Set LHS to be the LHS operand of the predicate computed by
3753 : : conditional statement GS. */
3754 : :
3755 : : inline void
3756 : 28990346 : gimple_cond_set_lhs (gcond *gs, tree lhs)
3757 : : {
3758 : 25380404 : gs->op[0] = lhs;
3759 : : }
3760 : :
3761 : :
3762 : : /* Return the RHS operand of the predicate computed by conditional GS. */
3763 : :
3764 : : inline tree
3765 : 2269349263 : gimple_cond_rhs (const gcond *gs)
3766 : : {
3767 : 1749664659 : return gs->op[1];
3768 : : }
3769 : :
3770 : : inline tree
3771 : 705094401 : gimple_cond_rhs (const gimple *gs)
3772 : : {
3773 : 705094401 : const gcond *gc = GIMPLE_CHECK2<const gcond *> (gs);
3774 : 705094401 : return gimple_cond_rhs (gc);
3775 : : }
3776 : :
3777 : : /* Return the pointer to the RHS operand of the predicate computed by
3778 : : conditional GS. */
3779 : :
3780 : : inline tree *
3781 : 7165090 : gimple_cond_rhs_ptr (gcond *gs)
3782 : : {
3783 : 7165090 : return &gs->op[1];
3784 : : }
3785 : :
3786 : :
3787 : : /* Set RHS to be the RHS operand of the predicate computed by
3788 : : conditional statement GS. */
3789 : :
3790 : : inline void
3791 : 29121991 : gimple_cond_set_rhs (gcond *gs, tree rhs)
3792 : : {
3793 : 25923856 : gs->op[1] = rhs;
3794 : 36080 : }
3795 : :
3796 : :
3797 : : /* Return the label used by conditional statement GS when its
3798 : : predicate evaluates to true. */
3799 : :
3800 : : inline tree
3801 : 770238681 : gimple_cond_true_label (const gcond *gs)
3802 : : {
3803 : 770238538 : return gs->op[2];
3804 : : }
3805 : :
3806 : :
3807 : : /* Set LABEL to be the label used by conditional statement GS when its
3808 : : predicate evaluates to true. */
3809 : :
3810 : : inline void
3811 : 15892371 : gimple_cond_set_true_label (gcond *gs, tree label)
3812 : : {
3813 : 15892371 : gs->op[2] = label;
3814 : 8569 : }
3815 : :
3816 : :
3817 : : /* Set LABEL to be the label used by conditional statement GS when its
3818 : : predicate evaluates to false. */
3819 : :
3820 : : inline void
3821 : 15989132 : gimple_cond_set_false_label (gcond *gs, tree label)
3822 : : {
3823 : 15989132 : gs->op[3] = label;
3824 : 105330 : }
3825 : :
3826 : :
3827 : : /* Return the label used by conditional statement GS when its
3828 : : predicate evaluates to false. */
3829 : :
3830 : : inline tree
3831 : 770245630 : gimple_cond_false_label (const gcond *gs)
3832 : : {
3833 : 770245630 : return gs->op[3];
3834 : : }
3835 : :
3836 : :
3837 : : /* Set the conditional COND_STMT to be of the form 'if (0 != 0)'. */
3838 : :
3839 : : inline void
3840 : 1888949 : gimple_cond_make_false (gcond *gs)
3841 : : {
3842 : 1888949 : gimple_cond_set_lhs (gs, boolean_false_node);
3843 : 1888949 : gimple_cond_set_rhs (gs, boolean_false_node);
3844 : 1888394 : gs->subcode = NE_EXPR;
3845 : 1730247 : }
3846 : :
3847 : :
3848 : : /* Set the conditional COND_STMT to be of the form 'if (1 != 0)'. */
3849 : :
3850 : : inline void
3851 : 1068688 : gimple_cond_make_true (gcond *gs)
3852 : : {
3853 : 1068688 : gimple_cond_set_lhs (gs, boolean_true_node);
3854 : 1068688 : gimple_cond_set_rhs (gs, boolean_false_node);
3855 : 1068444 : gs->subcode = NE_EXPR;
3856 : 976385 : }
3857 : :
3858 : : /* Check if conditional statement GS is of the form 'if (1 == 1)',
3859 : : 'if (0 == 0)', 'if (1 != 0)' or 'if (0 != 1)' */
3860 : :
3861 : : inline bool
3862 : 182909785 : gimple_cond_true_p (const gcond *gs)
3863 : : {
3864 : 182909785 : tree lhs = gimple_cond_lhs (gs);
3865 : 182909785 : tree rhs = gimple_cond_rhs (gs);
3866 : 182909785 : enum tree_code code = gimple_cond_code (gs);
3867 : :
3868 : 182909785 : if (lhs != boolean_true_node && lhs != boolean_false_node)
3869 : : return false;
3870 : :
3871 : 394344 : if (rhs != boolean_true_node && rhs != boolean_false_node)
3872 : : return false;
3873 : :
3874 : 394344 : if (code == NE_EXPR && lhs != rhs)
3875 : : return true;
3876 : :
3877 : 283587 : if (code == EQ_EXPR && lhs == rhs)
3878 : : return true;
3879 : :
3880 : : return false;
3881 : : }
3882 : :
3883 : : /* Check if conditional statement GS is in the caonical form of 'if (1 != 0)'. */
3884 : :
3885 : : inline bool
3886 : 335545 : gimple_cond_true_canonical_p (const gcond *gs)
3887 : : {
3888 : 335545 : tree lhs = gimple_cond_lhs (gs);
3889 : 335545 : tree rhs = gimple_cond_rhs (gs);
3890 : 335545 : tree_code code = gimple_cond_code (gs);
3891 : 335545 : if (code == NE_EXPR
3892 : 237783 : && lhs == boolean_true_node
3893 : 160935 : && rhs == boolean_false_node)
3894 : 160821 : return true;
3895 : : return false;
3896 : : }
3897 : :
3898 : : /* Check if conditional statement GS is of the form 'if (1 != 1)',
3899 : : 'if (0 != 0)', 'if (1 == 0)' or 'if (0 == 1)' */
3900 : :
3901 : : inline bool
3902 : 182799028 : gimple_cond_false_p (const gcond *gs)
3903 : : {
3904 : 182799028 : tree lhs = gimple_cond_lhs (gs);
3905 : 182799028 : tree rhs = gimple_cond_rhs (gs);
3906 : 182799028 : enum tree_code code = gimple_cond_code (gs);
3907 : :
3908 : 182799028 : if (lhs != boolean_true_node && lhs != boolean_false_node)
3909 : : return false;
3910 : :
3911 : 283587 : if (rhs != boolean_true_node && rhs != boolean_false_node)
3912 : : return false;
3913 : :
3914 : 283587 : if (code == NE_EXPR && lhs == rhs)
3915 : : return true;
3916 : :
3917 : 0 : if (code == EQ_EXPR && lhs != rhs)
3918 : : return true;
3919 : :
3920 : : return false;
3921 : : }
3922 : :
3923 : : /* Check if conditional statement GS is in the caonical form of 'if (0 != 0)'. */
3924 : :
3925 : : inline bool
3926 : 774426 : gimple_cond_false_canonical_p (const gcond *gs)
3927 : : {
3928 : 774426 : tree lhs = gimple_cond_lhs (gs);
3929 : 774426 : tree rhs = gimple_cond_rhs (gs);
3930 : 774426 : tree_code code = gimple_cond_code (gs);
3931 : 774426 : if (code == NE_EXPR
3932 : 517038 : && lhs == boolean_false_node
3933 : 310502 : && rhs == boolean_false_node)
3934 : : return true;
3935 : : return false;
3936 : : }
3937 : :
3938 : : /* Set the code, LHS and RHS of GIMPLE_COND STMT from CODE, LHS and RHS. */
3939 : :
3940 : : inline void
3941 : 2029314 : gimple_cond_set_condition (gcond *stmt, enum tree_code code, tree lhs,
3942 : : tree rhs)
3943 : : {
3944 : 2029314 : gimple_cond_set_code (stmt, code);
3945 : 2029314 : gimple_cond_set_lhs (stmt, lhs);
3946 : 2029314 : gimple_cond_set_rhs (stmt, rhs);
3947 : 1615204 : }
3948 : :
3949 : :
3950 : : /* Return the tree code for the expression computed by STMT. This is
3951 : : only valid for GIMPLE_COND, GIMPLE_CALL and GIMPLE_ASSIGN. For
3952 : : GIMPLE_CALL, return CALL_EXPR as the expression code for
3953 : : consistency. This is useful when the caller needs to deal with the
3954 : : three kinds of computation that GIMPLE supports. */
3955 : :
3956 : : inline enum tree_code
3957 : 323280965 : gimple_expr_code (const gimple *stmt)
3958 : : {
3959 : 323280965 : if (const gassign *ass = dyn_cast<const gassign *> (stmt))
3960 : 220905861 : return gimple_assign_rhs_code (ass);
3961 : 102375104 : if (const gcond *cond = dyn_cast<const gcond *> (stmt))
3962 : 101209259 : return gimple_cond_code (cond);
3963 : : else
3964 : : {
3965 : 1165845 : gcc_gimple_checking_assert (gimple_code (stmt) == GIMPLE_CALL);
3966 : : return CALL_EXPR;
3967 : : }
3968 : : }
3969 : :
3970 : :
3971 : : /* Return the LABEL_DECL node used by GIMPLE_LABEL statement GS. */
3972 : :
3973 : : inline tree
3974 : 518709223 : gimple_label_label (const glabel *gs)
3975 : : {
3976 : 518709223 : return gs->op[0];
3977 : : }
3978 : :
3979 : :
3980 : : /* Set LABEL to be the LABEL_DECL node used by GIMPLE_LABEL statement
3981 : : GS. */
3982 : :
3983 : : inline void
3984 : 19260049 : gimple_label_set_label (glabel *gs, tree label)
3985 : : {
3986 : 19260049 : gs->op[0] = label;
3987 : : }
3988 : :
3989 : :
3990 : : /* Return the destination of the unconditional jump GS. */
3991 : :
3992 : : inline tree
3993 : 52074224 : gimple_goto_dest (const gimple *gs)
3994 : : {
3995 : 52074224 : GIMPLE_CHECK (gs, GIMPLE_GOTO);
3996 : 52074224 : return gimple_op (gs, 0);
3997 : : }
3998 : :
3999 : :
4000 : : /* Set DEST to be the destination of the unconditonal jump GS. */
4001 : :
4002 : : inline void
4003 : 8078106 : gimple_goto_set_dest (ggoto *gs, tree dest)
4004 : : {
4005 : 8078106 : gs->op[0] = dest;
4006 : 1093675 : }
4007 : :
4008 : :
4009 : : /* Return the variables declared in the GIMPLE_BIND statement GS. */
4010 : :
4011 : : inline tree
4012 : 17721493 : gimple_bind_vars (const gbind *bind_stmt)
4013 : : {
4014 : 17721493 : return bind_stmt->vars;
4015 : : }
4016 : :
4017 : :
4018 : : /* Set VARS to be the set of variables declared in the GIMPLE_BIND
4019 : : statement GS. */
4020 : :
4021 : : inline void
4022 : 9454064 : gimple_bind_set_vars (gbind *bind_stmt, tree vars)
4023 : : {
4024 : 7553535 : bind_stmt->vars = vars;
4025 : 1900529 : }
4026 : :
4027 : :
4028 : : /* Append VARS to the set of variables declared in the GIMPLE_BIND
4029 : : statement GS. */
4030 : :
4031 : : inline void
4032 : 77224 : gimple_bind_append_vars (gbind *bind_stmt, tree vars)
4033 : : {
4034 : 77224 : bind_stmt->vars = chainon (bind_stmt->vars, vars);
4035 : : }
4036 : :
4037 : :
4038 : : inline gimple_seq *
4039 : 10394918 : gimple_bind_body_ptr (gbind *bind_stmt)
4040 : : {
4041 : 10394918 : return &bind_stmt->body;
4042 : : }
4043 : :
4044 : : /* Return the GIMPLE sequence contained in the GIMPLE_BIND statement GS. */
4045 : :
4046 : : inline gimple_seq
4047 : 30567650 : gimple_bind_body (const gbind *gs)
4048 : : {
4049 : 30567650 : return *gimple_bind_body_ptr (const_cast <gbind *> (gs));
4050 : : }
4051 : :
4052 : :
4053 : : /* Set SEQ to be the GIMPLE sequence contained in the GIMPLE_BIND
4054 : : statement GS. */
4055 : :
4056 : : inline void
4057 : 8218679 : gimple_bind_set_body (gbind *bind_stmt, gimple_seq seq)
4058 : : {
4059 : 6762113 : bind_stmt->body = seq;
4060 : 1456188 : }
4061 : :
4062 : :
4063 : : /* Append a statement to the end of a GIMPLE_BIND's body. */
4064 : :
4065 : : inline void
4066 : 67267 : gimple_bind_add_stmt (gbind *bind_stmt, gimple *stmt)
4067 : : {
4068 : 67267 : gimple_seq_add_stmt (&bind_stmt->body, stmt);
4069 : 0 : }
4070 : :
4071 : :
4072 : : /* Append a sequence of statements to the end of a GIMPLE_BIND's body. */
4073 : :
4074 : : inline void
4075 : 128642 : gimple_bind_add_seq (gbind *bind_stmt, gimple_seq seq)
4076 : : {
4077 : 124800 : gimple_seq_add_seq (&bind_stmt->body, seq);
4078 : : }
4079 : :
4080 : :
4081 : : /* Return the TREE_BLOCK node associated with GIMPLE_BIND statement
4082 : : GS. This is analogous to the BIND_EXPR_BLOCK field in trees. */
4083 : :
4084 : : inline tree
4085 : 24374837 : gimple_bind_block (const gbind *bind_stmt)
4086 : : {
4087 : 24373677 : return bind_stmt->block;
4088 : : }
4089 : :
4090 : :
4091 : : /* Set BLOCK to be the TREE_BLOCK node associated with GIMPLE_BIND
4092 : : statement GS. */
4093 : :
4094 : : inline void
4095 : 5932649 : gimple_bind_set_block (gbind *bind_stmt, tree block)
4096 : : {
4097 : 5932649 : gcc_gimple_checking_assert (block == NULL_TREE
4098 : : || TREE_CODE (block) == BLOCK);
4099 : 5932649 : bind_stmt->block = block;
4100 : 5932649 : }
4101 : :
4102 : :
4103 : : /* Return the number of input operands for GIMPLE_ASM ASM_STMT. */
4104 : :
4105 : : inline unsigned
4106 : 49063974 : gimple_asm_ninputs (const gasm *asm_stmt)
4107 : : {
4108 : 49063974 : return asm_stmt->ni;
4109 : : }
4110 : :
4111 : :
4112 : : /* Return the number of output operands for GIMPLE_ASM ASM_STMT. */
4113 : :
4114 : : inline unsigned
4115 : 80616725 : gimple_asm_noutputs (const gasm *asm_stmt)
4116 : : {
4117 : 67945212 : return asm_stmt->no;
4118 : : }
4119 : :
4120 : :
4121 : : /* Return the number of clobber operands for GIMPLE_ASM ASM_STMT. */
4122 : :
4123 : : inline unsigned
4124 : 16773253 : gimple_asm_nclobbers (const gasm *asm_stmt)
4125 : : {
4126 : 16773253 : return asm_stmt->nc;
4127 : : }
4128 : :
4129 : : /* Return the number of label operands for GIMPLE_ASM ASM_STMT. */
4130 : :
4131 : : inline unsigned
4132 : 40042993 : gimple_asm_nlabels (const gasm *asm_stmt)
4133 : : {
4134 : 40037609 : return asm_stmt->nl;
4135 : : }
4136 : :
4137 : : /* Return input operand INDEX of GIMPLE_ASM ASM_STMT. */
4138 : :
4139 : : inline tree
4140 : 22152138 : gimple_asm_input_op (const gasm *asm_stmt, unsigned index)
4141 : : {
4142 : 22152138 : gcc_gimple_checking_assert (index < asm_stmt->ni);
4143 : 22152138 : return asm_stmt->op[index + asm_stmt->no];
4144 : : }
4145 : :
4146 : : /* Set IN_OP to be input operand INDEX in GIMPLE_ASM ASM_STMT. */
4147 : :
4148 : : inline void
4149 : 44398 : gimple_asm_set_input_op (gasm *asm_stmt, unsigned index, tree in_op)
4150 : : {
4151 : 44398 : gcc_gimple_checking_assert (index < asm_stmt->ni
4152 : : && TREE_CODE (in_op) == TREE_LIST);
4153 : 44398 : asm_stmt->op[index + asm_stmt->no] = in_op;
4154 : 44398 : }
4155 : :
4156 : :
4157 : : /* Return output operand INDEX of GIMPLE_ASM ASM_STMT. */
4158 : :
4159 : : inline tree
4160 : 33239258 : gimple_asm_output_op (const gasm *asm_stmt, unsigned index)
4161 : : {
4162 : 33239258 : gcc_gimple_checking_assert (index < asm_stmt->no);
4163 : 33239258 : return asm_stmt->op[index];
4164 : : }
4165 : :
4166 : : /* Set OUT_OP to be output operand INDEX in GIMPLE_ASM ASM_STMT. */
4167 : :
4168 : : inline void
4169 : 62662 : gimple_asm_set_output_op (gasm *asm_stmt, unsigned index, tree out_op)
4170 : : {
4171 : 62662 : gcc_gimple_checking_assert (index < asm_stmt->no
4172 : : && TREE_CODE (out_op) == TREE_LIST);
4173 : 62662 : asm_stmt->op[index] = out_op;
4174 : 62662 : }
4175 : :
4176 : :
4177 : : /* Return clobber operand INDEX of GIMPLE_ASM ASM_STMT. */
4178 : :
4179 : : inline tree
4180 : 9661578 : gimple_asm_clobber_op (const gasm *asm_stmt, unsigned index)
4181 : : {
4182 : 9661578 : gcc_gimple_checking_assert (index < asm_stmt->nc);
4183 : 9661578 : return asm_stmt->op[index + asm_stmt->ni + asm_stmt->no];
4184 : : }
4185 : :
4186 : :
4187 : : /* Set CLOBBER_OP to be clobber operand INDEX in GIMPLE_ASM ASM_STMT. */
4188 : :
4189 : : inline void
4190 : 94468 : gimple_asm_set_clobber_op (gasm *asm_stmt, unsigned index, tree clobber_op)
4191 : : {
4192 : 94468 : gcc_gimple_checking_assert (index < asm_stmt->nc
4193 : : && TREE_CODE (clobber_op) == TREE_LIST);
4194 : 94468 : asm_stmt->op[index + asm_stmt->ni + asm_stmt->no] = clobber_op;
4195 : 94468 : }
4196 : :
4197 : : /* Return label operand INDEX of GIMPLE_ASM ASM_STMT. */
4198 : :
4199 : : inline tree
4200 : 189352 : gimple_asm_label_op (const gasm *asm_stmt, unsigned index)
4201 : : {
4202 : 189352 : gcc_gimple_checking_assert (index < asm_stmt->nl);
4203 : 189352 : return asm_stmt->op[index + asm_stmt->no + asm_stmt->ni + asm_stmt->nc];
4204 : : }
4205 : :
4206 : : /* Set LABEL_OP to be label operand INDEX in GIMPLE_ASM ASM_STMT. */
4207 : :
4208 : : inline void
4209 : 773 : gimple_asm_set_label_op (gasm *asm_stmt, unsigned index, tree label_op)
4210 : : {
4211 : 773 : gcc_gimple_checking_assert (index < asm_stmt->nl
4212 : : && TREE_CODE (label_op) == TREE_LIST);
4213 : 773 : asm_stmt->op[index + asm_stmt->no + asm_stmt->ni + asm_stmt->nc] = label_op;
4214 : 773 : }
4215 : :
4216 : : /* Return the string representing the assembly instruction in
4217 : : GIMPLE_ASM ASM_STMT. */
4218 : :
4219 : : inline const char *
4220 : 1160613 : gimple_asm_string (const gasm *asm_stmt)
4221 : : {
4222 : 1160613 : return asm_stmt->string;
4223 : : }
4224 : :
4225 : :
4226 : : /* Return true if ASM_STMT is marked volatile. */
4227 : :
4228 : : inline bool
4229 : 1550512 : gimple_asm_volatile_p (const gasm *asm_stmt)
4230 : : {
4231 : 1550512 : return (asm_stmt->subcode & GF_ASM_VOLATILE) != 0;
4232 : : }
4233 : :
4234 : :
4235 : : /* If VOLATILE_P is true, mark asm statement ASM_STMT as volatile. */
4236 : :
4237 : : inline void
4238 : 7243 : gimple_asm_set_volatile (gasm *asm_stmt, bool volatile_p)
4239 : : {
4240 : 7243 : if (volatile_p)
4241 : 87972 : asm_stmt->subcode |= GF_ASM_VOLATILE;
4242 : : else
4243 : 7243 : asm_stmt->subcode &= ~GF_ASM_VOLATILE;
4244 : : }
4245 : :
4246 : :
4247 : : /* Return true if ASM_STMT is marked inline. */
4248 : :
4249 : : inline bool
4250 : 750349 : gimple_asm_inline_p (const gasm *asm_stmt)
4251 : : {
4252 : 750349 : return (asm_stmt->subcode & GF_ASM_INLINE) != 0;
4253 : : }
4254 : :
4255 : :
4256 : : /* If INLINE_P is true, mark asm statement ASM_STMT as inline. */
4257 : :
4258 : : inline void
4259 : 95215 : gimple_asm_set_inline (gasm *asm_stmt, bool inline_p)
4260 : : {
4261 : 95215 : if (inline_p)
4262 : 90 : asm_stmt->subcode |= GF_ASM_INLINE;
4263 : : else
4264 : 95125 : asm_stmt->subcode &= ~GF_ASM_INLINE;
4265 : : }
4266 : :
4267 : :
4268 : : /* Mark whether asm ASM_STMT is a basic asm or an extended asm, based on
4269 : : BASIC_P. */
4270 : :
4271 : : inline void
4272 : 95215 : gimple_asm_set_basic (gasm *asm_stmt, bool basic_p)
4273 : : {
4274 : 95215 : if (basic_p)
4275 : 2505 : asm_stmt->subcode |= GF_ASM_BASIC;
4276 : : else
4277 : 92710 : asm_stmt->subcode &= ~GF_ASM_BASIC;
4278 : : }
4279 : :
4280 : :
4281 : : /* Return true if asm ASM_STMT is a basic asm rather than an extended asm. */
4282 : :
4283 : : inline bool
4284 : 7218137 : gimple_asm_basic_p (const gasm *asm_stmt)
4285 : : {
4286 : 7218137 : return (asm_stmt->subcode & GF_ASM_BASIC) != 0;
4287 : : }
4288 : :
4289 : :
4290 : : /* Return the types handled by GIMPLE_CATCH statement CATCH_STMT. */
4291 : :
4292 : : inline tree
4293 : 61406 : gimple_catch_types (const gcatch *catch_stmt)
4294 : : {
4295 : 61406 : return catch_stmt->types;
4296 : : }
4297 : :
4298 : :
4299 : : /* Return a pointer to the types handled by GIMPLE_CATCH statement CATCH_STMT. */
4300 : :
4301 : : inline tree *
4302 : 17644 : gimple_catch_types_ptr (gcatch *catch_stmt)
4303 : : {
4304 : 17644 : return &catch_stmt->types;
4305 : : }
4306 : :
4307 : :
4308 : : /* Return a pointer to the GIMPLE sequence representing the body of
4309 : : the handler of GIMPLE_CATCH statement CATCH_STMT. */
4310 : :
4311 : : inline gimple_seq *
4312 : 74827 : gimple_catch_handler_ptr (gcatch *catch_stmt)
4313 : : {
4314 : 74827 : return &catch_stmt->handler;
4315 : : }
4316 : :
4317 : :
4318 : : /* Return the GIMPLE sequence representing the body of the handler of
4319 : : GIMPLE_CATCH statement CATCH_STMT. */
4320 : :
4321 : : inline gimple_seq
4322 : 365700 : gimple_catch_handler (const gcatch *catch_stmt)
4323 : : {
4324 : 365700 : return *gimple_catch_handler_ptr (const_cast <gcatch *> (catch_stmt));
4325 : : }
4326 : :
4327 : :
4328 : : /* Set T to be the set of types handled by GIMPLE_CATCH CATCH_STMT. */
4329 : :
4330 : : inline void
4331 : 56915 : gimple_catch_set_types (gcatch *catch_stmt, tree t)
4332 : : {
4333 : 56915 : catch_stmt->types = t;
4334 : 17498 : }
4335 : :
4336 : :
4337 : : /* Set HANDLER to be the body of GIMPLE_CATCH CATCH_STMT. */
4338 : :
4339 : : inline void
4340 : 56903 : gimple_catch_set_handler (gcatch *catch_stmt, gimple_seq handler)
4341 : : {
4342 : 17498 : catch_stmt->handler = handler;
4343 : 39405 : }
4344 : :
4345 : :
4346 : : /* Return the types handled by GIMPLE_EH_FILTER statement GS. */
4347 : :
4348 : : inline tree
4349 : 4681 : gimple_eh_filter_types (const gimple *gs)
4350 : : {
4351 : 4681 : const geh_filter *eh_filter_stmt = as_a <const geh_filter *> (gs);
4352 : 4681 : return eh_filter_stmt->types;
4353 : : }
4354 : :
4355 : :
4356 : : /* Return a pointer to the types handled by GIMPLE_EH_FILTER statement
4357 : : GS. */
4358 : :
4359 : : inline tree *
4360 : 71 : gimple_eh_filter_types_ptr (gimple *gs)
4361 : : {
4362 : 71 : geh_filter *eh_filter_stmt = as_a <geh_filter *> (gs);
4363 : 71 : return &eh_filter_stmt->types;
4364 : : }
4365 : :
4366 : :
4367 : : /* Return a pointer to the sequence of statement to execute when
4368 : : GIMPLE_EH_FILTER statement fails. */
4369 : :
4370 : : inline gimple_seq *
4371 : 42845 : gimple_eh_filter_failure_ptr (gimple *gs)
4372 : : {
4373 : 32954 : geh_filter *eh_filter_stmt = as_a <geh_filter *> (gs);
4374 : 32954 : return &eh_filter_stmt->failure;
4375 : : }
4376 : :
4377 : :
4378 : : /* Return the sequence of statement to execute when GIMPLE_EH_FILTER
4379 : : statement fails. */
4380 : :
4381 : : inline gimple_seq
4382 : 37544 : gimple_eh_filter_failure (const gimple *gs)
4383 : : {
4384 : 37544 : return *gimple_eh_filter_failure_ptr (const_cast <gimple *> (gs));
4385 : : }
4386 : :
4387 : :
4388 : : /* Set TYPES to be the set of types handled by GIMPLE_EH_FILTER
4389 : : EH_FILTER_STMT. */
4390 : :
4391 : : inline void
4392 : 4669 : gimple_eh_filter_set_types (geh_filter *eh_filter_stmt, tree types)
4393 : : {
4394 : 4669 : eh_filter_stmt->types = types;
4395 : 0 : }
4396 : :
4397 : :
4398 : : /* Set FAILURE to be the sequence of statements to execute on failure
4399 : : for GIMPLE_EH_FILTER EH_FILTER_STMT. */
4400 : :
4401 : : inline void
4402 : 4669 : gimple_eh_filter_set_failure (geh_filter *eh_filter_stmt,
4403 : : gimple_seq failure)
4404 : : {
4405 : 0 : eh_filter_stmt->failure = failure;
4406 : 4669 : }
4407 : :
4408 : : /* Get the function decl to be called by the MUST_NOT_THROW region. */
4409 : :
4410 : : inline tree
4411 : 1306973 : gimple_eh_must_not_throw_fndecl (const geh_mnt *eh_mnt_stmt)
4412 : : {
4413 : 1306973 : return eh_mnt_stmt->fndecl;
4414 : : }
4415 : :
4416 : : /* Set the function decl to be called by GS to DECL. */
4417 : :
4418 : : inline void
4419 : 1300427 : gimple_eh_must_not_throw_set_fndecl (geh_mnt *eh_mnt_stmt,
4420 : : tree decl)
4421 : : {
4422 : 1300427 : eh_mnt_stmt->fndecl = decl;
4423 : 0 : }
4424 : :
4425 : : /* GIMPLE_EH_ELSE accessors. */
4426 : :
4427 : : inline gimple_seq *
4428 : 906 : gimple_eh_else_n_body_ptr (geh_else *eh_else_stmt)
4429 : : {
4430 : 906 : return &eh_else_stmt->n_body;
4431 : : }
4432 : :
4433 : : inline gimple_seq
4434 : 3990 : gimple_eh_else_n_body (const geh_else *eh_else_stmt)
4435 : : {
4436 : 3723 : return *gimple_eh_else_n_body_ptr (const_cast <geh_else *> (eh_else_stmt));
4437 : : }
4438 : :
4439 : : inline gimple_seq *
4440 : 906 : gimple_eh_else_e_body_ptr (geh_else *eh_else_stmt)
4441 : : {
4442 : 906 : return &eh_else_stmt->e_body;
4443 : : }
4444 : :
4445 : : inline gimple_seq
4446 : 3233 : gimple_eh_else_e_body (const geh_else *eh_else_stmt)
4447 : : {
4448 : 3233 : return *gimple_eh_else_e_body_ptr (const_cast <geh_else *> (eh_else_stmt));
4449 : : }
4450 : :
4451 : : inline void
4452 : 636 : gimple_eh_else_set_n_body (geh_else *eh_else_stmt, gimple_seq seq)
4453 : : {
4454 : 273 : eh_else_stmt->n_body = seq;
4455 : : }
4456 : :
4457 : : inline void
4458 : 636 : gimple_eh_else_set_e_body (geh_else *eh_else_stmt, gimple_seq seq)
4459 : : {
4460 : 273 : eh_else_stmt->e_body = seq;
4461 : 273 : }
4462 : :
4463 : : /* GIMPLE_TRY accessors. */
4464 : :
4465 : : /* Return the kind of try block represented by GIMPLE_TRY GS. This is
4466 : : either GIMPLE_TRY_CATCH or GIMPLE_TRY_FINALLY. */
4467 : :
4468 : : inline enum gimple_try_flags
4469 : 10482585 : gimple_try_kind (const gimple *gs)
4470 : : {
4471 : 10482585 : GIMPLE_CHECK (gs, GIMPLE_TRY);
4472 : 10482585 : return (enum gimple_try_flags) (gs->subcode & GIMPLE_TRY_KIND);
4473 : : }
4474 : :
4475 : :
4476 : : /* Set the kind of try block represented by GIMPLE_TRY GS. */
4477 : :
4478 : : inline void
4479 : 1 : gimple_try_set_kind (gtry *gs, enum gimple_try_flags kind)
4480 : : {
4481 : 1 : gcc_gimple_checking_assert (kind == GIMPLE_TRY_CATCH
4482 : : || kind == GIMPLE_TRY_FINALLY);
4483 : 1 : if (gimple_try_kind (gs) != kind)
4484 : 1 : gs->subcode = (unsigned int) kind;
4485 : 1 : }
4486 : :
4487 : :
4488 : : /* Return the GIMPLE_TRY_CATCH_IS_CLEANUP flag. */
4489 : :
4490 : : inline bool
4491 : 5894 : gimple_try_catch_is_cleanup (const gimple *gs)
4492 : : {
4493 : 5894 : gcc_gimple_checking_assert (gimple_try_kind (gs) == GIMPLE_TRY_CATCH);
4494 : 5894 : return (gs->subcode & GIMPLE_TRY_CATCH_IS_CLEANUP) != 0;
4495 : : }
4496 : :
4497 : :
4498 : : /* Return a pointer to the sequence of statements used as the
4499 : : body for GIMPLE_TRY GS. */
4500 : :
4501 : : inline gimple_seq *
4502 : 28899104 : gimple_try_eval_ptr (gimple *gs)
4503 : : {
4504 : 19876529 : gtry *try_stmt = as_a <gtry *> (gs);
4505 : 19876529 : return &try_stmt->eval;
4506 : : }
4507 : :
4508 : :
4509 : : /* Return the sequence of statements used as the body for GIMPLE_TRY GS. */
4510 : :
4511 : : inline gimple_seq
4512 : 24436680 : gimple_try_eval (const gimple *gs)
4513 : : {
4514 : 24436680 : return *gimple_try_eval_ptr (const_cast <gimple *> (gs));
4515 : : }
4516 : :
4517 : :
4518 : : /* Return a pointer to the sequence of statements used as the cleanup body for
4519 : : GIMPLE_TRY GS. */
4520 : :
4521 : : inline gimple_seq *
4522 : 29330976 : gimple_try_cleanup_ptr (gimple *gs)
4523 : : {
4524 : 17520662 : gtry *try_stmt = as_a <gtry *> (gs);
4525 : 17520662 : return &try_stmt->cleanup;
4526 : : }
4527 : :
4528 : :
4529 : : /* Return the sequence of statements used as the cleanup body for
4530 : : GIMPLE_TRY GS. */
4531 : :
4532 : : inline gimple_seq
4533 : 14106462 : gimple_try_cleanup (const gimple *gs)
4534 : : {
4535 : 25367518 : return *gimple_try_cleanup_ptr (const_cast <gimple *> (gs));
4536 : : }
4537 : :
4538 : :
4539 : : /* Set the GIMPLE_TRY_CATCH_IS_CLEANUP flag. */
4540 : :
4541 : : inline void
4542 : 184616 : gimple_try_set_catch_is_cleanup (gtry *g, bool catch_is_cleanup)
4543 : : {
4544 : 184616 : gcc_gimple_checking_assert (gimple_try_kind (g) == GIMPLE_TRY_CATCH);
4545 : 184616 : if (catch_is_cleanup)
4546 : 215 : g->subcode |= GIMPLE_TRY_CATCH_IS_CLEANUP;
4547 : : else
4548 : 184401 : g->subcode &= ~GIMPLE_TRY_CATCH_IS_CLEANUP;
4549 : 184616 : }
4550 : :
4551 : :
4552 : : /* Set EVAL to be the sequence of statements to use as the body for
4553 : : GIMPLE_TRY TRY_STMT. */
4554 : :
4555 : : inline void
4556 : 3058633 : gimple_try_set_eval (gtry *try_stmt, gimple_seq eval)
4557 : : {
4558 : 23939 : try_stmt->eval = eval;
4559 : 3034694 : }
4560 : :
4561 : :
4562 : : /* Set CLEANUP to be the sequence of statements to use as the cleanup
4563 : : body for GIMPLE_TRY TRY_STMT. */
4564 : :
4565 : : inline void
4566 : 3235375 : gimple_try_set_cleanup (gtry *try_stmt, gimple_seq cleanup)
4567 : : {
4568 : 65718 : try_stmt->cleanup = cleanup;
4569 : 3193595 : }
4570 : :
4571 : :
4572 : : /* Return a pointer to the cleanup sequence for cleanup statement GS. */
4573 : :
4574 : : inline gimple_seq *
4575 : 606040 : gimple_wce_cleanup_ptr (gimple *gs)
4576 : : {
4577 : 606040 : gimple_statement_wce *wce_stmt = as_a <gimple_statement_wce *> (gs);
4578 : 606040 : return &wce_stmt->cleanup;
4579 : : }
4580 : :
4581 : :
4582 : : /* Return the cleanup sequence for cleanup statement GS. */
4583 : :
4584 : : inline gimple_seq
4585 : 606040 : gimple_wce_cleanup (gimple *gs)
4586 : : {
4587 : 606040 : return *gimple_wce_cleanup_ptr (gs);
4588 : : }
4589 : :
4590 : :
4591 : : /* Set CLEANUP to be the cleanup sequence for GS. */
4592 : :
4593 : : inline void
4594 : 606040 : gimple_wce_set_cleanup (gimple *gs, gimple_seq cleanup)
4595 : : {
4596 : 606040 : gimple_statement_wce *wce_stmt = as_a <gimple_statement_wce *> (gs);
4597 : 606040 : wce_stmt->cleanup = cleanup;
4598 : 606040 : }
4599 : :
4600 : :
4601 : : /* Return the CLEANUP_EH_ONLY flag for a WCE tuple. */
4602 : :
4603 : : inline bool
4604 : 606040 : gimple_wce_cleanup_eh_only (const gimple *gs)
4605 : : {
4606 : 606040 : GIMPLE_CHECK (gs, GIMPLE_WITH_CLEANUP_EXPR);
4607 : 606040 : return gs->subcode != 0;
4608 : : }
4609 : :
4610 : :
4611 : : /* Set the CLEANUP_EH_ONLY flag for a WCE tuple. */
4612 : :
4613 : : inline void
4614 : 594192 : gimple_wce_set_cleanup_eh_only (gimple *gs, bool eh_only_p)
4615 : : {
4616 : 594192 : GIMPLE_CHECK (gs, GIMPLE_WITH_CLEANUP_EXPR);
4617 : 594192 : gs->subcode = (unsigned int) eh_only_p;
4618 : 594192 : }
4619 : :
4620 : :
4621 : : /* Return the maximum number of arguments supported by GIMPLE_PHI GS. */
4622 : :
4623 : : inline unsigned
4624 : 409586989 : gimple_phi_capacity (const gimple *gs)
4625 : : {
4626 : 366123952 : const gphi *phi_stmt = as_a <const gphi *> (gs);
4627 : 409586989 : return phi_stmt->capacity;
4628 : : }
4629 : :
4630 : :
4631 : : /* Return the number of arguments in GIMPLE_PHI GS. This must always
4632 : : be exactly the number of incoming edges for the basic block holding
4633 : : GS. */
4634 : :
4635 : : inline unsigned
4636 : 7351797100 : gimple_phi_num_args (const gimple *gs)
4637 : : {
4638 : 7354442912 : const gphi *phi_stmt = as_a <const gphi *> (gs);
4639 : 7355181377 : return phi_stmt->nargs;
4640 : : }
4641 : :
4642 : :
4643 : : /* Return the SSA name created by GIMPLE_PHI GS. */
4644 : :
4645 : : inline tree
4646 : 8787349549 : gimple_phi_result (const gphi *gs)
4647 : : {
4648 : 8344051306 : return gs->result;
4649 : : }
4650 : :
4651 : : inline tree
4652 : 815096048 : gimple_phi_result (const gimple *gs)
4653 : : {
4654 : 807321877 : const gphi *phi_stmt = as_a <const gphi *> (gs);
4655 : 816584410 : return gimple_phi_result (phi_stmt);
4656 : : }
4657 : :
4658 : : /* Return a pointer to the SSA name created by GIMPLE_PHI GS. */
4659 : :
4660 : : inline tree *
4661 : 16330379 : gimple_phi_result_ptr (gphi *gs)
4662 : : {
4663 : 16330379 : return &gs->result;
4664 : : }
4665 : :
4666 : : inline tree *
4667 : : gimple_phi_result_ptr (gimple *gs)
4668 : : {
4669 : : gphi *phi_stmt = as_a <gphi *> (gs);
4670 : : return gimple_phi_result_ptr (phi_stmt);
4671 : : }
4672 : :
4673 : : /* Set RESULT to be the SSA name created by GIMPLE_PHI PHI. */
4674 : :
4675 : : inline void
4676 : 14620830 : gimple_phi_set_result (gphi *phi, tree result)
4677 : : {
4678 : 14620830 : phi->result = result;
4679 : 14620830 : if (result && TREE_CODE (result) == SSA_NAME)
4680 : 14620830 : SSA_NAME_DEF_STMT (result) = phi;
4681 : : }
4682 : :
4683 : :
4684 : : /* Return the PHI argument corresponding to incoming edge INDEX for
4685 : : GIMPLE_PHI GS. */
4686 : :
4687 : : inline struct phi_arg_d *
4688 : 3350828599 : gimple_phi_arg (gphi *gs, unsigned index)
4689 : : {
4690 : 132623657 : gcc_gimple_checking_assert (index < gs->nargs);
4691 : 3350660356 : return &(gs->args[index]);
4692 : : }
4693 : :
4694 : : inline const phi_arg_d *
4695 : 7911633023 : gimple_phi_arg (const gphi *gs, unsigned index)
4696 : : {
4697 : 0 : gcc_gimple_checking_assert (index < gs->nargs);
4698 : 7911604118 : return &(gs->args[index]);
4699 : : }
4700 : :
4701 : : inline const phi_arg_d *
4702 : 1147535531 : gimple_phi_arg (const gimple *gs, unsigned index)
4703 : : {
4704 : 1147535531 : const gphi *phi_stmt = as_a <const gphi *> (gs);
4705 : 1147535531 : return gimple_phi_arg (phi_stmt, index);
4706 : : }
4707 : :
4708 : : inline struct phi_arg_d *
4709 : 2854583514 : gimple_phi_arg (gimple *gs, unsigned index)
4710 : : {
4711 : 2854583514 : gphi *phi_stmt = as_a <gphi *> (gs);
4712 : 2854583514 : return gimple_phi_arg (phi_stmt, index);
4713 : : }
4714 : :
4715 : : /* Set PHIARG to be the argument corresponding to incoming edge INDEX
4716 : : for GIMPLE_PHI PHI. */
4717 : :
4718 : : inline void
4719 : : gimple_phi_set_arg (gphi *phi, unsigned index, struct phi_arg_d * phiarg)
4720 : : {
4721 : : gcc_gimple_checking_assert (index < phi->nargs);
4722 : : phi->args[index] = *phiarg;
4723 : : }
4724 : :
4725 : : /* Return the PHI nodes for basic block BB, or NULL if there are no
4726 : : PHI nodes. */
4727 : :
4728 : : inline gimple_seq
4729 : 729191694 : phi_nodes (const_basic_block bb)
4730 : : {
4731 : 729191694 : gcc_checking_assert (!(bb->flags & BB_RTL));
4732 : 729191694 : return bb->il.gimple.phi_nodes;
4733 : : }
4734 : :
4735 : : /* Return a pointer to the PHI nodes for basic block BB. */
4736 : :
4737 : : inline gimple_seq *
4738 : 11926051433 : phi_nodes_ptr (basic_block bb)
4739 : : {
4740 : 11926051433 : gcc_checking_assert (!(bb->flags & BB_RTL));
4741 : 11926051433 : return &bb->il.gimple.phi_nodes;
4742 : : }
4743 : :
4744 : : /* Return the tree operand for argument I of PHI node GS. */
4745 : :
4746 : : inline tree
4747 : 3980185395 : gimple_phi_arg_def (const gphi *gs, size_t index)
4748 : : {
4749 : 3997533998 : return gimple_phi_arg (gs, index)->def;
4750 : : }
4751 : :
4752 : : inline tree
4753 : 823471373 : gimple_phi_arg_def (const gimple *gs, size_t index)
4754 : : {
4755 : 823465581 : return gimple_phi_arg (gs, index)->def;
4756 : : }
4757 : :
4758 : : /* Return the tree operand for the argument associated with
4759 : : edge E of PHI node GS. */
4760 : :
4761 : : inline tree
4762 : 955870143 : gimple_phi_arg_def_from_edge (const gphi *gs, const_edge e)
4763 : : {
4764 : 955870143 : gcc_checking_assert (e->dest == gimple_bb (gs));
4765 : 955870143 : return gimple_phi_arg (gs, e->dest_idx)->def;
4766 : : }
4767 : :
4768 : : inline tree
4769 : 324063302 : gimple_phi_arg_def_from_edge (const gimple *gs, const_edge e)
4770 : : {
4771 : 324063302 : gcc_checking_assert (e->dest == gimple_bb (gs));
4772 : 324063302 : return gimple_phi_arg (gs, e->dest_idx)->def;
4773 : : }
4774 : :
4775 : : /* Return a pointer to the tree operand for argument I of phi node PHI. */
4776 : :
4777 : : inline tree *
4778 : 98355485 : gimple_phi_arg_def_ptr (gphi *phi, size_t index)
4779 : : {
4780 : 98355485 : return &gimple_phi_arg (phi, index)->def;
4781 : : }
4782 : :
4783 : : /* Return the edge associated with argument I of phi node PHI. */
4784 : :
4785 : : inline edge
4786 : 475137137 : gimple_phi_arg_edge (const gphi *phi, size_t i)
4787 : : {
4788 : 489617531 : return EDGE_PRED (gimple_bb (phi), i);
4789 : : }
4790 : :
4791 : : /* Return the source location of gimple argument I of phi node PHI. */
4792 : :
4793 : : inline location_t
4794 : 1806010927 : gimple_phi_arg_location (const gphi *phi, size_t i)
4795 : : {
4796 : 1806010927 : return gimple_phi_arg (phi, i)->locus;
4797 : : }
4798 : :
4799 : : /* Return the source location of the argument on edge E of phi node PHI. */
4800 : :
4801 : : inline location_t
4802 : 16828162 : gimple_phi_arg_location_from_edge (gphi *phi, edge e)
4803 : : {
4804 : 16828162 : return gimple_phi_arg (phi, e->dest_idx)->locus;
4805 : : }
4806 : :
4807 : : /* Set the source location of gimple argument I of phi node PHI to LOC. */
4808 : :
4809 : : inline void
4810 : 248213222 : gimple_phi_arg_set_location (gphi *phi, size_t i, location_t loc)
4811 : : {
4812 : 248213222 : gimple_phi_arg (phi, i)->locus = loc;
4813 : 248213222 : }
4814 : :
4815 : : /* Return address of source location of gimple argument I of phi node PHI. */
4816 : :
4817 : : inline location_t *
4818 : 178918 : gimple_phi_arg_location_ptr (gphi *phi, size_t i)
4819 : : {
4820 : 178918 : return &gimple_phi_arg (phi, i)->locus;
4821 : : }
4822 : :
4823 : : /* Return TRUE if argument I of phi node PHI has a location record. */
4824 : :
4825 : : inline bool
4826 : 7882467 : gimple_phi_arg_has_location (const gphi *phi, size_t i)
4827 : : {
4828 : 7882467 : return gimple_phi_arg_location (phi, i) != UNKNOWN_LOCATION;
4829 : : }
4830 : :
4831 : : /* Return the number of arguments that can be accessed by gimple_arg. */
4832 : :
4833 : : inline unsigned
4834 : 18522459 : gimple_num_args (const gimple *gs)
4835 : : {
4836 : 18522459 : if (auto phi = dyn_cast<const gphi *> (gs))
4837 : 1450869 : return gimple_phi_num_args (phi);
4838 : 17071590 : if (auto call = dyn_cast<const gcall *> (gs))
4839 : 107222 : return gimple_call_num_args (call);
4840 : 16964368 : return gimple_num_ops (as_a <const gassign *> (gs)) - 1;
4841 : : }
4842 : :
4843 : : /* GS must be an assignment, a call, or a PHI.
4844 : : If it's an assignment, return rhs operand I.
4845 : : If it's a call, return function argument I.
4846 : : If it's a PHI, return the value of PHI argument I. */
4847 : :
4848 : : inline tree
4849 : 28277603 : gimple_arg (const gimple *gs, unsigned int i)
4850 : : {
4851 : 28277603 : if (auto phi = dyn_cast<const gphi *> (gs))
4852 : 1468504 : return gimple_phi_arg_def (phi, i);
4853 : 26809099 : if (auto call = dyn_cast<const gcall *> (gs))
4854 : 64264 : return gimple_call_arg (call, i);
4855 : 26744835 : return gimple_op (as_a <const gassign *> (gs), i + 1);
4856 : : }
4857 : :
4858 : : /* Return a pointer to gimple_arg (GS, I). */
4859 : :
4860 : : inline tree *
4861 : : gimple_arg_ptr (gimple *gs, unsigned int i)
4862 : : {
4863 : : if (auto phi = dyn_cast<gphi *> (gs))
4864 : : return gimple_phi_arg_def_ptr (phi, i);
4865 : : if (auto call = dyn_cast<gcall *> (gs))
4866 : : return gimple_call_arg_ptr (call, i);
4867 : : return gimple_op_ptr (as_a <gassign *> (gs), i + 1);
4868 : : }
4869 : :
4870 : : /* Return the region number for GIMPLE_RESX RESX_STMT. */
4871 : :
4872 : : inline int
4873 : 1404305 : gimple_resx_region (const gresx *resx_stmt)
4874 : : {
4875 : 1404305 : return resx_stmt->region;
4876 : : }
4877 : :
4878 : : /* Set REGION to be the region number for GIMPLE_RESX RESX_STMT. */
4879 : :
4880 : : inline void
4881 : 83588 : gimple_resx_set_region (gresx *resx_stmt, int region)
4882 : : {
4883 : 83588 : resx_stmt->region = region;
4884 : 83588 : }
4885 : :
4886 : : /* Return the region number for GIMPLE_EH_DISPATCH EH_DISPATCH_STMT. */
4887 : :
4888 : : inline int
4889 : 2045840 : gimple_eh_dispatch_region (const geh_dispatch *eh_dispatch_stmt)
4890 : : {
4891 : 2045431 : return eh_dispatch_stmt->region;
4892 : : }
4893 : :
4894 : : /* Set REGION to be the region number for GIMPLE_EH_DISPATCH
4895 : : EH_DISPATCH_STMT. */
4896 : :
4897 : : inline void
4898 : 9264 : gimple_eh_dispatch_set_region (geh_dispatch *eh_dispatch_stmt, int region)
4899 : : {
4900 : 9264 : eh_dispatch_stmt->region = region;
4901 : 9264 : }
4902 : :
4903 : : /* Return the number of labels associated with the switch statement GS. */
4904 : :
4905 : : inline unsigned
4906 : 15203589 : gimple_switch_num_labels (const gswitch *gs)
4907 : : {
4908 : 15203589 : unsigned num_ops;
4909 : 15203589 : GIMPLE_CHECK (gs, GIMPLE_SWITCH);
4910 : 15203589 : num_ops = gimple_num_ops (gs);
4911 : 15203589 : gcc_gimple_checking_assert (num_ops > 1);
4912 : 15203589 : return num_ops - 1;
4913 : : }
4914 : :
4915 : :
4916 : : /* Set NLABELS to be the number of labels for the switch statement GS. */
4917 : :
4918 : : inline void
4919 : 24724 : gimple_switch_set_num_labels (gswitch *g, unsigned nlabels)
4920 : : {
4921 : 24724 : GIMPLE_CHECK (g, GIMPLE_SWITCH);
4922 : 24724 : gimple_set_num_ops (g, nlabels + 1);
4923 : 24724 : }
4924 : :
4925 : :
4926 : : /* Return the index variable used by the switch statement GS. */
4927 : :
4928 : : inline tree
4929 : 14111499 : gimple_switch_index (const gswitch *gs)
4930 : : {
4931 : 14040777 : return gs->op[0];
4932 : : }
4933 : :
4934 : :
4935 : : /* Return a pointer to the index variable for the switch statement GS. */
4936 : :
4937 : : inline tree *
4938 : 0 : gimple_switch_index_ptr (gswitch *gs)
4939 : : {
4940 : 0 : return &gs->op[0];
4941 : : }
4942 : :
4943 : :
4944 : : /* Set INDEX to be the index variable for switch statement GS. */
4945 : :
4946 : : inline void
4947 : 118120 : gimple_switch_set_index (gswitch *gs, tree index)
4948 : : {
4949 : 118120 : gcc_gimple_checking_assert (SSA_VAR_P (index) || CONSTANT_CLASS_P (index));
4950 : 118120 : gs->op[0] = index;
4951 : 118120 : }
4952 : :
4953 : :
4954 : : /* Return the label numbered INDEX. The default label is 0, followed by any
4955 : : labels in a switch statement. */
4956 : :
4957 : : inline tree
4958 : 152802112 : gimple_switch_label (const gswitch *gs, unsigned index)
4959 : : {
4960 : 152746983 : gcc_gimple_checking_assert (gimple_num_ops (gs) > index + 1);
4961 : 12060085 : return gs->op[index + 1];
4962 : : }
4963 : :
4964 : : /* Set the label number INDEX to LABEL. 0 is always the default label. */
4965 : :
4966 : : inline void
4967 : 1288224 : gimple_switch_set_label (gswitch *gs, unsigned index, tree label)
4968 : : {
4969 : 1288224 : gcc_gimple_checking_assert (gimple_num_ops (gs) > index + 1
4970 : : && (label == NULL_TREE
4971 : : || TREE_CODE (label) == CASE_LABEL_EXPR));
4972 : 1288224 : gs->op[index + 1] = label;
4973 : 1288224 : }
4974 : :
4975 : : /* Return the default label for a switch statement. */
4976 : :
4977 : : inline tree
4978 : 55129 : gimple_switch_default_label (const gswitch *gs)
4979 : : {
4980 : 55129 : tree label = gimple_switch_label (gs, 0);
4981 : 55129 : gcc_checking_assert (!CASE_LOW (label) && !CASE_HIGH (label));
4982 : 55129 : return label;
4983 : : }
4984 : :
4985 : : /* Set the default label for a switch statement. */
4986 : :
4987 : : inline void
4988 : 70437 : gimple_switch_set_default_label (gswitch *gs, tree label)
4989 : : {
4990 : 70437 : gcc_checking_assert (!CASE_LOW (label) && !CASE_HIGH (label));
4991 : 70437 : gimple_switch_set_label (gs, 0, label);
4992 : 70437 : }
4993 : :
4994 : : /* Return true if GS is a GIMPLE_DEBUG statement. */
4995 : :
4996 : : inline bool
4997 : 66222809188 : is_gimple_debug (const gimple *gs)
4998 : : {
4999 : 56415762669 : return gimple_code (gs) == GIMPLE_DEBUG;
5000 : : }
5001 : :
5002 : :
5003 : : /* Return the first nondebug statement in GIMPLE sequence S. */
5004 : :
5005 : : inline gimple *
5006 : 4469856 : gimple_seq_first_nondebug_stmt (gimple_seq s)
5007 : : {
5008 : 4469856 : gimple_seq_node n = gimple_seq_first (s);
5009 : 4537164 : while (n && is_gimple_debug (n))
5010 : 67308 : n = n->next;
5011 : 4469856 : return n;
5012 : : }
5013 : :
5014 : :
5015 : : /* Return the last nondebug statement in GIMPLE sequence S. */
5016 : :
5017 : : inline gimple *
5018 : 16493431 : gimple_seq_last_nondebug_stmt (gimple_seq s)
5019 : : {
5020 : 16493431 : gimple_seq_node n;
5021 : 16493431 : for (n = gimple_seq_last (s);
5022 : 16625536 : n && is_gimple_debug (n);
5023 : 132105 : n = n->prev)
5024 : 134858 : if (n == s)
5025 : : return NULL;
5026 : : return n;
5027 : : }
5028 : :
5029 : :
5030 : : /* Return true if S is a GIMPLE_DEBUG BIND statement. */
5031 : :
5032 : : inline bool
5033 : 35243050280 : gimple_debug_bind_p (const gimple *s)
5034 : : {
5035 : 16401646133 : if (is_gimple_debug (s))
5036 : 15804741306 : return s->subcode == GIMPLE_DEBUG_BIND;
5037 : :
5038 : : return false;
5039 : : }
5040 : :
5041 : : /* Return the variable bound in a GIMPLE_DEBUG bind statement. */
5042 : :
5043 : : inline tree
5044 : 942621015 : gimple_debug_bind_get_var (const gimple *dbg)
5045 : : {
5046 : 942621015 : GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
5047 : 942621015 : gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
5048 : 942621015 : return gimple_op (dbg, 0);
5049 : : }
5050 : :
5051 : : /* Return the value bound to the variable in a GIMPLE_DEBUG bind
5052 : : statement. */
5053 : :
5054 : : inline tree
5055 : 550579655 : gimple_debug_bind_get_value (const gimple *dbg)
5056 : : {
5057 : 550579655 : GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
5058 : 550579655 : gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
5059 : 550579655 : return gimple_op (dbg, 1);
5060 : : }
5061 : :
5062 : : /* Return a pointer to the value bound to the variable in a
5063 : : GIMPLE_DEBUG bind statement. */
5064 : :
5065 : : inline tree *
5066 : 2856408768 : gimple_debug_bind_get_value_ptr (gimple *dbg)
5067 : : {
5068 : 2856408768 : GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
5069 : 2856408768 : gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
5070 : 2856408768 : return gimple_op_ptr (dbg, 1);
5071 : : }
5072 : :
5073 : : /* Set the variable bound in a GIMPLE_DEBUG bind statement. */
5074 : :
5075 : : inline void
5076 : 97805830 : gimple_debug_bind_set_var (gimple *dbg, tree var)
5077 : : {
5078 : 97805830 : GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
5079 : 97805830 : gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
5080 : 97805830 : gimple_set_op (dbg, 0, var);
5081 : 97805830 : }
5082 : :
5083 : : /* Set the value bound to the variable in a GIMPLE_DEBUG bind
5084 : : statement. */
5085 : :
5086 : : inline void
5087 : 59700250 : gimple_debug_bind_set_value (gimple *dbg, tree value)
5088 : : {
5089 : 59700250 : GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
5090 : 59700250 : gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
5091 : 59700250 : gimple_set_op (dbg, 1, value);
5092 : 59700250 : }
5093 : :
5094 : : /* The second operand of a GIMPLE_DEBUG_BIND, when the value was
5095 : : optimized away. */
5096 : : #define GIMPLE_DEBUG_BIND_NOVALUE NULL_TREE /* error_mark_node */
5097 : :
5098 : : /* Remove the value bound to the variable in a GIMPLE_DEBUG bind
5099 : : statement. */
5100 : :
5101 : : inline void
5102 : 7364804 : gimple_debug_bind_reset_value (gimple *dbg)
5103 : : {
5104 : 7364804 : GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
5105 : 7364804 : gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
5106 : 7364804 : gimple_set_op (dbg, 1, GIMPLE_DEBUG_BIND_NOVALUE);
5107 : 7364804 : }
5108 : :
5109 : : /* Return true if the GIMPLE_DEBUG bind statement is bound to a
5110 : : value. */
5111 : :
5112 : : inline bool
5113 : 9453524484 : gimple_debug_bind_has_value_p (gimple *dbg)
5114 : : {
5115 : 9453524484 : GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
5116 : 9453524484 : gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
5117 : 9453524484 : return gimple_op (dbg, 1) != GIMPLE_DEBUG_BIND_NOVALUE;
5118 : : }
5119 : :
5120 : : #undef GIMPLE_DEBUG_BIND_NOVALUE
5121 : :
5122 : : /* Return true if S is a GIMPLE_DEBUG SOURCE BIND statement. */
5123 : :
5124 : : inline bool
5125 : 87754976 : gimple_debug_source_bind_p (const gimple *s)
5126 : : {
5127 : 86879997 : if (is_gimple_debug (s))
5128 : 57124963 : return s->subcode == GIMPLE_DEBUG_SOURCE_BIND;
5129 : :
5130 : : return false;
5131 : : }
5132 : :
5133 : : /* Return the variable bound in a GIMPLE_DEBUG source bind statement. */
5134 : :
5135 : : inline tree
5136 : 1100958 : gimple_debug_source_bind_get_var (const gimple *dbg)
5137 : : {
5138 : 1100958 : GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
5139 : 1100958 : gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg));
5140 : 1100958 : return gimple_op (dbg, 0);
5141 : : }
5142 : :
5143 : : /* Return the value bound to the variable in a GIMPLE_DEBUG source bind
5144 : : statement. */
5145 : :
5146 : : inline tree
5147 : 1070019 : gimple_debug_source_bind_get_value (const gimple *dbg)
5148 : : {
5149 : 1070019 : GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
5150 : 1070019 : gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg));
5151 : 1070019 : return gimple_op (dbg, 1);
5152 : : }
5153 : :
5154 : : /* Return a pointer to the value bound to the variable in a
5155 : : GIMPLE_DEBUG source bind statement. */
5156 : :
5157 : : inline tree *
5158 : 117889 : gimple_debug_source_bind_get_value_ptr (gimple *dbg)
5159 : : {
5160 : 117889 : GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
5161 : 117889 : gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg));
5162 : 117889 : return gimple_op_ptr (dbg, 1);
5163 : : }
5164 : :
5165 : : /* Set the variable bound in a GIMPLE_DEBUG source bind statement. */
5166 : :
5167 : : inline void
5168 : 1059479 : gimple_debug_source_bind_set_var (gimple *dbg, tree var)
5169 : : {
5170 : 1059479 : GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
5171 : 1059479 : gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg));
5172 : 1059479 : gimple_set_op (dbg, 0, var);
5173 : 1059479 : }
5174 : :
5175 : : /* Set the value bound to the variable in a GIMPLE_DEBUG source bind
5176 : : statement. */
5177 : :
5178 : : inline void
5179 : 597983 : gimple_debug_source_bind_set_value (gimple *dbg, tree value)
5180 : : {
5181 : 597983 : GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
5182 : 597983 : gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg));
5183 : 597983 : gimple_set_op (dbg, 1, value);
5184 : 597983 : }
5185 : :
5186 : : /* Return true if S is a GIMPLE_DEBUG BEGIN_STMT statement. */
5187 : :
5188 : : inline bool
5189 : 291748453 : gimple_debug_begin_stmt_p (const gimple *s)
5190 : : {
5191 : 302962295 : if (is_gimple_debug (s))
5192 : 80974517 : return s->subcode == GIMPLE_DEBUG_BEGIN_STMT;
5193 : :
5194 : : return false;
5195 : : }
5196 : :
5197 : : /* Return true if S is a GIMPLE_DEBUG INLINE_ENTRY statement. */
5198 : :
5199 : : inline bool
5200 : 1304191 : gimple_debug_inline_entry_p (const gimple *s)
5201 : : {
5202 : 8656762 : if (is_gimple_debug (s))
5203 : 12863 : return s->subcode == GIMPLE_DEBUG_INLINE_ENTRY;
5204 : :
5205 : : return false;
5206 : : }
5207 : :
5208 : : /* Return true if S is a GIMPLE_DEBUG non-binding marker statement. */
5209 : :
5210 : : inline bool
5211 : 729689999 : gimple_debug_nonbind_marker_p (const gimple *s)
5212 : : {
5213 : 689927533 : if (is_gimple_debug (s))
5214 : 566428807 : return s->subcode == GIMPLE_DEBUG_BEGIN_STMT
5215 : 566428807 : || s->subcode == GIMPLE_DEBUG_INLINE_ENTRY;
5216 : :
5217 : : return false;
5218 : : }
5219 : :
5220 : : /* Return the line number for EXPR, or return -1 if we have no line
5221 : : number information for it. */
5222 : : inline int
5223 : 0 : get_lineno (const gimple *stmt)
5224 : : {
5225 : 0 : location_t loc;
5226 : :
5227 : 0 : if (!stmt)
5228 : : return -1;
5229 : :
5230 : 0 : loc = gimple_location (stmt);
5231 : 0 : if (loc == UNKNOWN_LOCATION)
5232 : : return -1;
5233 : :
5234 : 0 : return LOCATION_LINE (loc);
5235 : : }
5236 : :
5237 : : /* Return a pointer to the body for the OMP statement GS. */
5238 : :
5239 : : inline gimple_seq *
5240 : 447645 : gimple_omp_body_ptr (gimple *gs)
5241 : : {
5242 : 447562 : return &static_cast <gimple_statement_omp *> (gs)->body;
5243 : : }
5244 : :
5245 : : /* Return the body for the OMP statement GS. */
5246 : :
5247 : : inline gimple_seq
5248 : 397378 : gimple_omp_body (const gimple *gs)
5249 : : {
5250 : 397378 : return *gimple_omp_body_ptr (const_cast <gimple *> (gs));
5251 : : }
5252 : :
5253 : : /* Set BODY to be the body for the OMP statement GS. */
5254 : :
5255 : : inline void
5256 : 292251 : gimple_omp_set_body (gimple *gs, gimple_seq body)
5257 : : {
5258 : 170421 : static_cast <gimple_statement_omp *> (gs)->body = body;
5259 : 119311 : }
5260 : :
5261 : :
5262 : : /* Return the name associated with OMP_CRITICAL statement CRIT_STMT. */
5263 : :
5264 : : inline tree
5265 : 820 : gimple_omp_critical_name (const gomp_critical *crit_stmt)
5266 : : {
5267 : 820 : return crit_stmt->name;
5268 : : }
5269 : :
5270 : :
5271 : : /* Return a pointer to the name associated with OMP critical statement
5272 : : CRIT_STMT. */
5273 : :
5274 : : inline tree *
5275 : 1352 : gimple_omp_critical_name_ptr (gomp_critical *crit_stmt)
5276 : : {
5277 : 1352 : return &crit_stmt->name;
5278 : : }
5279 : :
5280 : :
5281 : : /* Set NAME to be the name associated with OMP critical statement
5282 : : CRIT_STMT. */
5283 : :
5284 : : inline void
5285 : 546 : gimple_omp_critical_set_name (gomp_critical *crit_stmt, tree name)
5286 : : {
5287 : 546 : crit_stmt->name = name;
5288 : : }
5289 : :
5290 : :
5291 : : /* Return the clauses associated with OMP_CRITICAL statement CRIT_STMT. */
5292 : :
5293 : : inline tree
5294 : 16 : gimple_omp_critical_clauses (const gomp_critical *crit_stmt)
5295 : : {
5296 : 16 : return crit_stmt->clauses;
5297 : : }
5298 : :
5299 : :
5300 : : /* Return a pointer to the clauses associated with OMP critical statement
5301 : : CRIT_STMT. */
5302 : :
5303 : : inline tree *
5304 : 1352 : gimple_omp_critical_clauses_ptr (gomp_critical *crit_stmt)
5305 : : {
5306 : 1352 : return &crit_stmt->clauses;
5307 : : }
5308 : :
5309 : :
5310 : : /* Set CLAUSES to be the clauses associated with OMP critical statement
5311 : : CRIT_STMT. */
5312 : :
5313 : : inline void
5314 : 546 : gimple_omp_critical_set_clauses (gomp_critical *crit_stmt, tree clauses)
5315 : : {
5316 : 546 : crit_stmt->clauses = clauses;
5317 : : }
5318 : :
5319 : :
5320 : : /* Return the clauses associated with OMP_ORDERED statement ORD_STMT. */
5321 : :
5322 : : inline tree
5323 : 7030 : gimple_omp_ordered_clauses (const gomp_ordered *ord_stmt)
5324 : : {
5325 : 7030 : return ord_stmt->clauses;
5326 : : }
5327 : :
5328 : :
5329 : : /* Return a pointer to the clauses associated with OMP ordered statement
5330 : : ORD_STMT. */
5331 : :
5332 : : inline tree *
5333 : 5431 : gimple_omp_ordered_clauses_ptr (gomp_ordered *ord_stmt)
5334 : : {
5335 : 5431 : return &ord_stmt->clauses;
5336 : : }
5337 : :
5338 : :
5339 : : /* Set CLAUSES to be the clauses associated with OMP ordered statement
5340 : : ORD_STMT. */
5341 : :
5342 : : inline void
5343 : 1838 : gimple_omp_ordered_set_clauses (gomp_ordered *ord_stmt, tree clauses)
5344 : : {
5345 : 1838 : ord_stmt->clauses = clauses;
5346 : : }
5347 : :
5348 : :
5349 : : /* Return the clauses associated with OMP_SCAN statement SCAN_STMT. */
5350 : :
5351 : : inline tree
5352 : 3171 : gimple_omp_scan_clauses (const gomp_scan *scan_stmt)
5353 : : {
5354 : 3171 : return scan_stmt->clauses;
5355 : : }
5356 : :
5357 : :
5358 : : /* Return a pointer to the clauses associated with OMP scan statement
5359 : : ORD_STMT. */
5360 : :
5361 : : inline tree *
5362 : 824 : gimple_omp_scan_clauses_ptr (gomp_scan *scan_stmt)
5363 : : {
5364 : 824 : return &scan_stmt->clauses;
5365 : : }
5366 : :
5367 : :
5368 : : /* Set CLAUSES to be the clauses associated with OMP scan statement
5369 : : ORD_STMT. */
5370 : :
5371 : : inline void
5372 : 1284 : gimple_omp_scan_set_clauses (gomp_scan *scan_stmt, tree clauses)
5373 : : {
5374 : 1284 : scan_stmt->clauses = clauses;
5375 : : }
5376 : :
5377 : :
5378 : : /* Return the clauses associated with OMP_TASKGROUP statement GS. */
5379 : :
5380 : : inline tree
5381 : 1143 : gimple_omp_taskgroup_clauses (const gimple *gs)
5382 : : {
5383 : 1143 : GIMPLE_CHECK (gs, GIMPLE_OMP_TASKGROUP);
5384 : 1143 : return
5385 : 1143 : static_cast <const gimple_statement_omp_single_layout *> (gs)->clauses;
5386 : : }
5387 : :
5388 : :
5389 : : /* Return a pointer to the clauses associated with OMP taskgroup statement
5390 : : GS. */
5391 : :
5392 : : inline tree *
5393 : 76 : gimple_omp_taskgroup_clauses_ptr (gimple *gs)
5394 : : {
5395 : 76 : GIMPLE_CHECK (gs, GIMPLE_OMP_TASKGROUP);
5396 : 76 : return &static_cast <gimple_statement_omp_single_layout *> (gs)->clauses;
5397 : : }
5398 : :
5399 : :
5400 : : /* Set CLAUSES to be the clauses associated with OMP taskgroup statement
5401 : : GS. */
5402 : :
5403 : : inline void
5404 : 611 : gimple_omp_taskgroup_set_clauses (gimple *gs, tree clauses)
5405 : : {
5406 : 611 : GIMPLE_CHECK (gs, GIMPLE_OMP_TASKGROUP);
5407 : 611 : static_cast <gimple_statement_omp_single_layout *> (gs)->clauses
5408 : 611 : = clauses;
5409 : 611 : }
5410 : :
5411 : :
5412 : : /* Return the clauses associated with OMP_MASKED statement GS. */
5413 : :
5414 : : inline tree
5415 : 792 : gimple_omp_masked_clauses (const gimple *gs)
5416 : : {
5417 : 792 : GIMPLE_CHECK (gs, GIMPLE_OMP_MASKED);
5418 : 792 : return
5419 : 792 : static_cast <const gimple_statement_omp_single_layout *> (gs)->clauses;
5420 : : }
5421 : :
5422 : :
5423 : : /* Return a pointer to the clauses associated with OMP masked statement
5424 : : GS. */
5425 : :
5426 : : inline tree *
5427 : : gimple_omp_masked_clauses_ptr (gimple *gs)
5428 : : {
5429 : : GIMPLE_CHECK (gs, GIMPLE_OMP_MASKED);
5430 : : return &static_cast <gimple_statement_omp_single_layout *> (gs)->clauses;
5431 : : }
5432 : :
5433 : :
5434 : : /* Set CLAUSES to be the clauses associated with OMP masked statement
5435 : : GS. */
5436 : :
5437 : : inline void
5438 : 446 : gimple_omp_masked_set_clauses (gimple *gs, tree clauses)
5439 : : {
5440 : 446 : GIMPLE_CHECK (gs, GIMPLE_OMP_MASKED);
5441 : 446 : static_cast <gimple_statement_omp_single_layout *> (gs)->clauses
5442 : 446 : = clauses;
5443 : 446 : }
5444 : :
5445 : :
5446 : : /* Return the clauses associated with OMP_SCOPE statement GS. */
5447 : :
5448 : : inline tree
5449 : 864 : gimple_omp_scope_clauses (const gimple *gs)
5450 : : {
5451 : 864 : GIMPLE_CHECK (gs, GIMPLE_OMP_SCOPE);
5452 : 864 : return
5453 : 864 : static_cast <const gimple_statement_omp_single_layout *> (gs)->clauses;
5454 : : }
5455 : :
5456 : :
5457 : : /* Return a pointer to the clauses associated with OMP scope statement
5458 : : GS. */
5459 : :
5460 : : inline tree *
5461 : 0 : gimple_omp_scope_clauses_ptr (gimple *gs)
5462 : : {
5463 : 0 : GIMPLE_CHECK (gs, GIMPLE_OMP_SCOPE);
5464 : 0 : return &static_cast <gimple_statement_omp_single_layout *> (gs)->clauses;
5465 : : }
5466 : :
5467 : :
5468 : : /* Set CLAUSES to be the clauses associated with OMP scope statement
5469 : : GS. */
5470 : :
5471 : : inline void
5472 : 260 : gimple_omp_scope_set_clauses (gimple *gs, tree clauses)
5473 : : {
5474 : 260 : GIMPLE_CHECK (gs, GIMPLE_OMP_SCOPE);
5475 : 260 : static_cast <gimple_statement_omp_single_layout *> (gs)->clauses
5476 : 260 : = clauses;
5477 : 260 : }
5478 : :
5479 : : /* Return the clauses associated with OMP_DISPATCH statement GS. */
5480 : :
5481 : : inline tree
5482 : 401 : gimple_omp_dispatch_clauses (const gimple *gs)
5483 : : {
5484 : 401 : GIMPLE_CHECK (gs, GIMPLE_OMP_DISPATCH);
5485 : 401 : return static_cast<const gimple_statement_omp_single_layout *> (gs)->clauses;
5486 : : }
5487 : :
5488 : : /* Return a pointer to the clauses associated with OMP dispatch statement
5489 : : GS. */
5490 : :
5491 : : inline tree *
5492 : : gimple_omp_dispatch_clauses_ptr (gimple *gs)
5493 : : {
5494 : : GIMPLE_CHECK (gs, GIMPLE_OMP_DISPATCH);
5495 : : return &static_cast<gimple_statement_omp_single_layout *> (gs)->clauses;
5496 : : }
5497 : :
5498 : : /* Set CLAUSES to be the clauses associated with OMP dispatch statement
5499 : : GS. */
5500 : :
5501 : : inline void
5502 : 846 : gimple_omp_dispatch_set_clauses (gimple *gs, tree clauses)
5503 : : {
5504 : 846 : GIMPLE_CHECK (gs, GIMPLE_OMP_DISPATCH);
5505 : 846 : static_cast<gimple_statement_omp_single_layout *> (gs)->clauses = clauses;
5506 : 846 : }
5507 : :
5508 : : /* Return the clauses associated with OMP_INTEROP statement GS. */
5509 : :
5510 : : inline tree
5511 : 164 : gimple_omp_interop_clauses (const gimple *gs)
5512 : : {
5513 : 164 : GIMPLE_CHECK (gs, GIMPLE_OMP_INTEROP);
5514 : 164 : return static_cast<const gimple_statement_omp_single_layout *> (gs)->clauses;
5515 : : }
5516 : :
5517 : : /* Return a pointer to the clauses associated with OMP_INTEROP statement GS. */
5518 : :
5519 : : inline tree *
5520 : 35 : gimple_omp_interop_clauses_ptr (gimple *gs)
5521 : : {
5522 : 35 : GIMPLE_CHECK (gs, GIMPLE_OMP_INTEROP);
5523 : 35 : return &static_cast<gimple_statement_omp_single_layout *> (gs)->clauses;
5524 : : }
5525 : :
5526 : : /* Set CLAUSES to be the clauses associated with OMP interop statement
5527 : : GS. */
5528 : :
5529 : : inline void
5530 : 612 : gimple_omp_interop_set_clauses (gimple *gs, tree clauses)
5531 : : {
5532 : 612 : GIMPLE_CHECK (gs, GIMPLE_OMP_INTEROP);
5533 : 612 : static_cast<gimple_statement_omp_single_layout *> (gs)->clauses = clauses;
5534 : 612 : }
5535 : :
5536 : : /* Return the kind of the OMP_FOR statemement G. */
5537 : :
5538 : : inline int
5539 : 1193463 : gimple_omp_for_kind (const gimple *g)
5540 : : {
5541 : 1193463 : GIMPLE_CHECK (g, GIMPLE_OMP_FOR);
5542 : 1193463 : return (gimple_omp_subcode (g) & GF_OMP_FOR_KIND_MASK);
5543 : : }
5544 : :
5545 : :
5546 : : /* Set the kind of the OMP_FOR statement G. */
5547 : :
5548 : : inline void
5549 : 53380 : gimple_omp_for_set_kind (gomp_for *g, int kind)
5550 : : {
5551 : 53380 : g->subcode = (g->subcode & ~GF_OMP_FOR_KIND_MASK)
5552 : 53380 : | (kind & GF_OMP_FOR_KIND_MASK);
5553 : : }
5554 : :
5555 : :
5556 : : /* Return true if OMP_FOR statement G has the
5557 : : GF_OMP_FOR_COMBINED flag set. */
5558 : :
5559 : : inline bool
5560 : 162801 : gimple_omp_for_combined_p (const gimple *g)
5561 : : {
5562 : 162801 : GIMPLE_CHECK (g, GIMPLE_OMP_FOR);
5563 : 162801 : return (gimple_omp_subcode (g) & GF_OMP_FOR_COMBINED) != 0;
5564 : : }
5565 : :
5566 : :
5567 : : /* Set the GF_OMP_FOR_COMBINED field in the OMP_FOR statement G depending on
5568 : : the boolean value of COMBINED_P. */
5569 : :
5570 : : inline void
5571 : 15526 : gimple_omp_for_set_combined_p (gomp_for *g, bool combined_p)
5572 : : {
5573 : 15526 : if (combined_p)
5574 : 1579 : g->subcode |= GF_OMP_FOR_COMBINED;
5575 : : else
5576 : : g->subcode &= ~GF_OMP_FOR_COMBINED;
5577 : 13947 : }
5578 : :
5579 : :
5580 : : /* Return true if the OMP_FOR statement G has the
5581 : : GF_OMP_FOR_COMBINED_INTO flag set. */
5582 : :
5583 : : inline bool
5584 : 171190 : gimple_omp_for_combined_into_p (const gimple *g)
5585 : : {
5586 : 171190 : GIMPLE_CHECK (g, GIMPLE_OMP_FOR);
5587 : 171190 : return (gimple_omp_subcode (g) & GF_OMP_FOR_COMBINED_INTO) != 0;
5588 : : }
5589 : :
5590 : :
5591 : : /* Set the GF_OMP_FOR_COMBINED_INTO field in the OMP_FOR statement G depending
5592 : : on the boolean value of COMBINED_P. */
5593 : :
5594 : : inline void
5595 : 15526 : gimple_omp_for_set_combined_into_p (gomp_for *g, bool combined_p)
5596 : : {
5597 : 15526 : if (combined_p)
5598 : 15526 : g->subcode |= GF_OMP_FOR_COMBINED_INTO;
5599 : : else
5600 : : g->subcode &= ~GF_OMP_FOR_COMBINED_INTO;
5601 : : }
5602 : :
5603 : :
5604 : : /* Return the clauses associated with the OMP_FOR statement GS. */
5605 : :
5606 : : inline tree
5607 : 607200 : gimple_omp_for_clauses (const gimple *gs)
5608 : : {
5609 : 607200 : const gomp_for *omp_for_stmt = as_a <const gomp_for *> (gs);
5610 : 607200 : return omp_for_stmt->clauses;
5611 : : }
5612 : :
5613 : :
5614 : : /* Return a pointer to the clauses associated with the OMP_FOR statement
5615 : : GS. */
5616 : :
5617 : : inline tree *
5618 : 256728 : gimple_omp_for_clauses_ptr (gimple *gs)
5619 : : {
5620 : 256728 : gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
5621 : 256728 : return &omp_for_stmt->clauses;
5622 : : }
5623 : :
5624 : :
5625 : : /* Set CLAUSES to be the list of clauses associated with the OMP_FOR statement
5626 : : GS. */
5627 : :
5628 : : inline void
5629 : 67841 : gimple_omp_for_set_clauses (gimple *gs, tree clauses)
5630 : : {
5631 : 67841 : gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
5632 : 67841 : omp_for_stmt->clauses = clauses;
5633 : 11587 : }
5634 : :
5635 : :
5636 : : /* Get the collapse count of the OMP_FOR statement GS. */
5637 : :
5638 : : inline size_t
5639 : 783189 : gimple_omp_for_collapse (const gimple *gs)
5640 : : {
5641 : 783189 : const gomp_for *omp_for_stmt = as_a <const gomp_for *> (gs);
5642 : 783189 : return omp_for_stmt->collapse;
5643 : : }
5644 : :
5645 : :
5646 : : /* Return the condition code associated with the OMP_FOR statement GS. */
5647 : :
5648 : : inline enum tree_code
5649 : 199327 : gimple_omp_for_cond (const gimple *gs, size_t i)
5650 : : {
5651 : 199327 : const gomp_for *omp_for_stmt = as_a <const gomp_for *> (gs);
5652 : 199327 : gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
5653 : 199327 : return omp_for_stmt->iter[i].cond;
5654 : : }
5655 : :
5656 : :
5657 : : /* Set COND to be the condition code for the OMP_FOR statement GS. */
5658 : :
5659 : : inline void
5660 : 75611 : gimple_omp_for_set_cond (gimple *gs, size_t i, enum tree_code cond)
5661 : : {
5662 : 75611 : gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
5663 : 75611 : gcc_gimple_checking_assert (TREE_CODE_CLASS (cond) == tcc_comparison
5664 : : && i < omp_for_stmt->collapse);
5665 : 75611 : omp_for_stmt->iter[i].cond = cond;
5666 : 75611 : }
5667 : :
5668 : :
5669 : : /* Return the index variable for the OMP_FOR statement GS. */
5670 : :
5671 : : inline tree
5672 : 217083 : gimple_omp_for_index (const gimple *gs, size_t i)
5673 : : {
5674 : 217083 : const gomp_for *omp_for_stmt = as_a <const gomp_for *> (gs);
5675 : 217083 : gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
5676 : 217083 : return omp_for_stmt->iter[i].index;
5677 : : }
5678 : :
5679 : :
5680 : : /* Return a pointer to the index variable for the OMP_FOR statement GS. */
5681 : :
5682 : : inline tree *
5683 : 354564 : gimple_omp_for_index_ptr (gimple *gs, size_t i)
5684 : : {
5685 : 354564 : gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
5686 : 354564 : gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
5687 : 354564 : return &omp_for_stmt->iter[i].index;
5688 : : }
5689 : :
5690 : :
5691 : : /* Set INDEX to be the index variable for the OMP_FOR statement GS. */
5692 : :
5693 : : inline void
5694 : 75611 : gimple_omp_for_set_index (gimple *gs, size_t i, tree index)
5695 : : {
5696 : 75611 : gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
5697 : 75611 : gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
5698 : 75611 : omp_for_stmt->iter[i].index = index;
5699 : 75611 : }
5700 : :
5701 : :
5702 : : /* Return the initial value for the OMP_FOR statement GS. */
5703 : :
5704 : : inline tree
5705 : 263798 : gimple_omp_for_initial (const gimple *gs, size_t i)
5706 : : {
5707 : 263798 : const gomp_for *omp_for_stmt = as_a <const gomp_for *> (gs);
5708 : 263798 : gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
5709 : 263798 : return omp_for_stmt->iter[i].initial;
5710 : : }
5711 : :
5712 : :
5713 : : /* Return a pointer to the initial value for the OMP_FOR statement GS. */
5714 : :
5715 : : inline tree *
5716 : 422714 : gimple_omp_for_initial_ptr (gimple *gs, size_t i)
5717 : : {
5718 : 422714 : gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
5719 : 422714 : gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
5720 : 422714 : return &omp_for_stmt->iter[i].initial;
5721 : : }
5722 : :
5723 : :
5724 : : /* Set INITIAL to be the initial value for the OMP_FOR statement GS. */
5725 : :
5726 : : inline void
5727 : 75611 : gimple_omp_for_set_initial (gimple *gs, size_t i, tree initial)
5728 : : {
5729 : 75611 : gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
5730 : 75611 : gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
5731 : 75611 : omp_for_stmt->iter[i].initial = initial;
5732 : 75611 : }
5733 : :
5734 : :
5735 : : /* Return the final value for the OMP_FOR statement GS. */
5736 : :
5737 : : inline tree
5738 : 263616 : gimple_omp_for_final (const gimple *gs, size_t i)
5739 : : {
5740 : 263616 : const gomp_for *omp_for_stmt = as_a <const gomp_for *> (gs);
5741 : 263616 : gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
5742 : 263616 : return omp_for_stmt->iter[i].final;
5743 : : }
5744 : :
5745 : :
5746 : : /* Return a pointer to the final value for the OMP_FOR statement GS. */
5747 : :
5748 : : inline tree *
5749 : 422714 : gimple_omp_for_final_ptr (gimple *gs, size_t i)
5750 : : {
5751 : 422714 : gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
5752 : 422714 : gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
5753 : 422714 : return &omp_for_stmt->iter[i].final;
5754 : : }
5755 : :
5756 : :
5757 : : /* Set FINAL to be the final value for the OMP_FOR statement GS. */
5758 : :
5759 : : inline void
5760 : 75611 : gimple_omp_for_set_final (gimple *gs, size_t i, tree final)
5761 : : {
5762 : 75611 : gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
5763 : 75611 : gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
5764 : 75611 : omp_for_stmt->iter[i].final = final;
5765 : 75611 : }
5766 : :
5767 : :
5768 : : /* Return the increment value for the OMP_FOR statement GS. */
5769 : :
5770 : : inline tree
5771 : 271771 : gimple_omp_for_incr (const gimple *gs, size_t i)
5772 : : {
5773 : 271771 : const gomp_for *omp_for_stmt = as_a <const gomp_for *> (gs);
5774 : 271771 : gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
5775 : 271771 : return omp_for_stmt->iter[i].incr;
5776 : : }
5777 : :
5778 : :
5779 : : /* Return a pointer to the increment value for the OMP_FOR statement GS. */
5780 : :
5781 : : inline tree *
5782 : 350452 : gimple_omp_for_incr_ptr (gimple *gs, size_t i)
5783 : : {
5784 : 350452 : gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
5785 : 350452 : gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
5786 : 350452 : return &omp_for_stmt->iter[i].incr;
5787 : : }
5788 : :
5789 : :
5790 : : /* Set INCR to be the increment value for the OMP_FOR statement GS. */
5791 : :
5792 : : inline void
5793 : 75611 : gimple_omp_for_set_incr (gimple *gs, size_t i, tree incr)
5794 : : {
5795 : 75611 : gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
5796 : 75611 : gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
5797 : 75611 : omp_for_stmt->iter[i].incr = incr;
5798 : 75611 : }
5799 : :
5800 : :
5801 : : /* Return a pointer to the sequence of statements to execute before the OMP_FOR
5802 : : statement GS starts. */
5803 : :
5804 : : inline gimple_seq *
5805 : 294196 : gimple_omp_for_pre_body_ptr (gimple *gs)
5806 : : {
5807 : 194496 : gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
5808 : 194496 : return &omp_for_stmt->pre_body;
5809 : : }
5810 : :
5811 : :
5812 : : /* Return the sequence of statements to execute before the OMP_FOR
5813 : : statement GS starts. */
5814 : :
5815 : : inline gimple_seq
5816 : 128266 : gimple_omp_for_pre_body (const gimple *gs)
5817 : : {
5818 : 128266 : return *gimple_omp_for_pre_body_ptr (const_cast <gimple *> (gs));
5819 : : }
5820 : :
5821 : :
5822 : : /* Set PRE_BODY to be the sequence of statements to execute before the
5823 : : OMP_FOR statement GS starts. */
5824 : :
5825 : : inline void
5826 : 51216 : gimple_omp_for_set_pre_body (gimple *gs, gimple_seq pre_body)
5827 : : {
5828 : 51216 : gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
5829 : 51216 : omp_for_stmt->pre_body = pre_body;
5830 : 2449 : }
5831 : :
5832 : : /* Return the clauses associated with OMP_PARALLEL GS. */
5833 : :
5834 : : inline tree
5835 : 116410 : gimple_omp_parallel_clauses (const gimple *gs)
5836 : : {
5837 : 116410 : const gomp_parallel *omp_parallel_stmt = as_a <const gomp_parallel *> (gs);
5838 : 116410 : return omp_parallel_stmt->clauses;
5839 : : }
5840 : :
5841 : :
5842 : : /* Return a pointer to the clauses associated with OMP_PARALLEL_STMT. */
5843 : :
5844 : : inline tree *
5845 : 65758 : gimple_omp_parallel_clauses_ptr (gomp_parallel *omp_parallel_stmt)
5846 : : {
5847 : 65758 : return &omp_parallel_stmt->clauses;
5848 : : }
5849 : :
5850 : :
5851 : : /* Set CLAUSES to be the list of clauses associated with OMP_PARALLEL_STMT. */
5852 : :
5853 : : inline void
5854 : 18473 : gimple_omp_parallel_set_clauses (gomp_parallel *omp_parallel_stmt,
5855 : : tree clauses)
5856 : : {
5857 : 66 : omp_parallel_stmt->clauses = clauses;
5858 : 66 : }
5859 : :
5860 : :
5861 : : /* Return the child function used to hold the body of OMP_PARALLEL_STMT. */
5862 : :
5863 : : inline tree
5864 : 18407 : gimple_omp_parallel_child_fn (const gomp_parallel *omp_parallel_stmt)
5865 : : {
5866 : 18407 : return omp_parallel_stmt->child_fn;
5867 : : }
5868 : :
5869 : : /* Return a pointer to the child function used to hold the body of
5870 : : OMP_PARALLEL_STMT. */
5871 : :
5872 : : inline tree *
5873 : 65758 : gimple_omp_parallel_child_fn_ptr (gomp_parallel *omp_parallel_stmt)
5874 : : {
5875 : 65758 : return &omp_parallel_stmt->child_fn;
5876 : : }
5877 : :
5878 : :
5879 : : /* Set CHILD_FN to be the child function for OMP_PARALLEL_STMT. */
5880 : :
5881 : : inline void
5882 : 36511 : gimple_omp_parallel_set_child_fn (gomp_parallel *omp_parallel_stmt,
5883 : : tree child_fn)
5884 : : {
5885 : 18104 : omp_parallel_stmt->child_fn = child_fn;
5886 : : }
5887 : :
5888 : :
5889 : : /* Return the artificial argument used to send variables and values
5890 : : from the parent to the children threads in OMP_PARALLEL_STMT. */
5891 : :
5892 : : inline tree
5893 : 16402 : gimple_omp_parallel_data_arg (const gomp_parallel *omp_parallel_stmt)
5894 : : {
5895 : 16402 : return omp_parallel_stmt->data_arg;
5896 : : }
5897 : :
5898 : :
5899 : : /* Return a pointer to the data argument for OMP_PARALLEL_STMT. */
5900 : :
5901 : : inline tree *
5902 : 65758 : gimple_omp_parallel_data_arg_ptr (gomp_parallel *omp_parallel_stmt)
5903 : : {
5904 : 65758 : return &omp_parallel_stmt->data_arg;
5905 : : }
5906 : :
5907 : :
5908 : : /* Set DATA_ARG to be the data argument for OMP_PARALLEL_STMT. */
5909 : :
5910 : : inline void
5911 : 18407 : gimple_omp_parallel_set_data_arg (gomp_parallel *omp_parallel_stmt,
5912 : : tree data_arg)
5913 : : {
5914 : 0 : omp_parallel_stmt->data_arg = data_arg;
5915 : : }
5916 : :
5917 : : /* Return the clauses associated with OMP_TASK GS. */
5918 : :
5919 : : inline tree
5920 : 28024 : gimple_omp_task_clauses (const gimple *gs)
5921 : : {
5922 : 28024 : const gomp_task *omp_task_stmt = as_a <const gomp_task *> (gs);
5923 : 28024 : return omp_task_stmt->clauses;
5924 : : }
5925 : :
5926 : :
5927 : : /* Return a pointer to the clauses associated with OMP_TASK GS. */
5928 : :
5929 : : inline tree *
5930 : 16855 : gimple_omp_task_clauses_ptr (gimple *gs)
5931 : : {
5932 : 16855 : gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
5933 : 16855 : return &omp_task_stmt->clauses;
5934 : : }
5935 : :
5936 : :
5937 : : /* Set CLAUSES to be the list of clauses associated with OMP_TASK
5938 : : GS. */
5939 : :
5940 : : inline void
5941 : 6101 : gimple_omp_task_set_clauses (gimple *gs, tree clauses)
5942 : : {
5943 : 6101 : gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
5944 : 6101 : omp_task_stmt->clauses = clauses;
5945 : 513 : }
5946 : :
5947 : :
5948 : : /* Return true if OMP task statement G has the
5949 : : GF_OMP_TASK_TASKLOOP flag set. */
5950 : :
5951 : : inline bool
5952 : 21997 : gimple_omp_task_taskloop_p (const gimple *g)
5953 : : {
5954 : 21997 : GIMPLE_CHECK (g, GIMPLE_OMP_TASK);
5955 : 21997 : return (gimple_omp_subcode (g) & GF_OMP_TASK_TASKLOOP) != 0;
5956 : : }
5957 : :
5958 : :
5959 : : /* Set the GF_OMP_TASK_TASKLOOP field in G depending on the boolean
5960 : : value of TASKLOOP_P. */
5961 : :
5962 : : inline void
5963 : 1579 : gimple_omp_task_set_taskloop_p (gimple *g, bool taskloop_p)
5964 : : {
5965 : 1579 : GIMPLE_CHECK (g, GIMPLE_OMP_TASK);
5966 : 1579 : if (taskloop_p)
5967 : 1579 : g->subcode |= GF_OMP_TASK_TASKLOOP;
5968 : : else
5969 : 0 : g->subcode &= ~GF_OMP_TASK_TASKLOOP;
5970 : 1579 : }
5971 : :
5972 : :
5973 : : /* Return true if OMP task statement G has the
5974 : : GF_OMP_TASK_TASKWAIT flag set. */
5975 : :
5976 : : inline bool
5977 : 24826 : gimple_omp_task_taskwait_p (const gimple *g)
5978 : : {
5979 : 24826 : GIMPLE_CHECK (g, GIMPLE_OMP_TASK);
5980 : 24826 : return (gimple_omp_subcode (g) & GF_OMP_TASK_TASKWAIT) != 0;
5981 : : }
5982 : :
5983 : :
5984 : : /* Set the GF_OMP_TASK_TASKWAIT field in G depending on the boolean
5985 : : value of TASKWAIT_P. */
5986 : :
5987 : : inline void
5988 : 90 : gimple_omp_task_set_taskwait_p (gimple *g, bool taskwait_p)
5989 : : {
5990 : 90 : GIMPLE_CHECK (g, GIMPLE_OMP_TASK);
5991 : 90 : if (taskwait_p)
5992 : 90 : g->subcode |= GF_OMP_TASK_TASKWAIT;
5993 : : else
5994 : 0 : g->subcode &= ~GF_OMP_TASK_TASKWAIT;
5995 : 90 : }
5996 : :
5997 : :
5998 : : /* Return the child function used to hold the body of OMP_TASK GS. */
5999 : :
6000 : : inline tree
6001 : 4106 : gimple_omp_task_child_fn (const gimple *gs)
6002 : : {
6003 : 4106 : const gomp_task *omp_task_stmt = as_a <const gomp_task *> (gs);
6004 : 4106 : return omp_task_stmt->child_fn;
6005 : : }
6006 : :
6007 : : /* Return a pointer to the child function used to hold the body of
6008 : : OMP_TASK GS. */
6009 : :
6010 : : inline tree *
6011 : 15673 : gimple_omp_task_child_fn_ptr (gimple *gs)
6012 : : {
6013 : 15673 : gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
6014 : 15673 : return &omp_task_stmt->child_fn;
6015 : : }
6016 : :
6017 : :
6018 : : /* Set CHILD_FN to be the child function for OMP_TASK GS. */
6019 : :
6020 : : inline void
6021 : 11005 : gimple_omp_task_set_child_fn (gimple *gs, tree child_fn)
6022 : : {
6023 : 11005 : gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
6024 : 11005 : omp_task_stmt->child_fn = child_fn;
6025 : : }
6026 : :
6027 : :
6028 : : /* Return the artificial argument used to send variables and values
6029 : : from the parent to the children threads in OMP_TASK GS. */
6030 : :
6031 : : inline tree
6032 : 3767 : gimple_omp_task_data_arg (const gimple *gs)
6033 : : {
6034 : 3767 : const gomp_task *omp_task_stmt = as_a <const gomp_task *> (gs);
6035 : 3767 : return omp_task_stmt->data_arg;
6036 : : }
6037 : :
6038 : :
6039 : : /* Return a pointer to the data argument for OMP_TASK GS. */
6040 : :
6041 : : inline tree *
6042 : 15673 : gimple_omp_task_data_arg_ptr (gimple *gs)
6043 : : {
6044 : 15673 : gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
6045 : 15673 : return &omp_task_stmt->data_arg;
6046 : : }
6047 : :
6048 : :
6049 : : /* Set DATA_ARG to be the data argument for OMP_TASK GS. */
6050 : :
6051 : : inline void
6052 : 5588 : gimple_omp_task_set_data_arg (gimple *gs, tree data_arg)
6053 : : {
6054 : 5588 : gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
6055 : 5588 : omp_task_stmt->data_arg = data_arg;
6056 : : }
6057 : :
6058 : :
6059 : : /* Return the clauses associated with OMP_TASK GS. */
6060 : :
6061 : : inline tree
6062 : 59011 : gimple_omp_taskreg_clauses (const gimple *gs)
6063 : : {
6064 : 59011 : const gimple_statement_omp_taskreg *omp_taskreg_stmt
6065 : 59011 : = as_a <const gimple_statement_omp_taskreg *> (gs);
6066 : 59011 : return omp_taskreg_stmt->clauses;
6067 : : }
6068 : :
6069 : :
6070 : : /* Return a pointer to the clauses associated with OMP_TASK GS. */
6071 : :
6072 : : inline tree *
6073 : 2762 : gimple_omp_taskreg_clauses_ptr (gimple *gs)
6074 : : {
6075 : 2762 : gimple_statement_omp_taskreg *omp_taskreg_stmt
6076 : 2762 : = as_a <gimple_statement_omp_taskreg *> (gs);
6077 : 2762 : return &omp_taskreg_stmt->clauses;
6078 : : }
6079 : :
6080 : :
6081 : : /* Set CLAUSES to be the list of clauses associated with OMP_TASK
6082 : : GS. */
6083 : :
6084 : : inline void
6085 : 19833 : gimple_omp_taskreg_set_clauses (gimple *gs, tree clauses)
6086 : : {
6087 : 19833 : gimple_statement_omp_taskreg *omp_taskreg_stmt
6088 : 19833 : = as_a <gimple_statement_omp_taskreg *> (gs);
6089 : 19833 : omp_taskreg_stmt->clauses = clauses;
6090 : 961 : }
6091 : :
6092 : :
6093 : : /* Return the child function used to hold the body of OMP_TASK GS. */
6094 : :
6095 : : inline tree
6096 : 29415 : gimple_omp_taskreg_child_fn (const gimple *gs)
6097 : : {
6098 : 29415 : const gimple_statement_omp_taskreg *omp_taskreg_stmt
6099 : 29415 : = as_a <const gimple_statement_omp_taskreg *> (gs);
6100 : 29415 : return omp_taskreg_stmt->child_fn;
6101 : : }
6102 : :
6103 : : /* Return a pointer to the child function used to hold the body of
6104 : : OMP_TASK GS. */
6105 : :
6106 : : inline tree *
6107 : : gimple_omp_taskreg_child_fn_ptr (gimple *gs)
6108 : : {
6109 : : gimple_statement_omp_taskreg *omp_taskreg_stmt
6110 : : = as_a <gimple_statement_omp_taskreg *> (gs);
6111 : : return &omp_taskreg_stmt->child_fn;
6112 : : }
6113 : :
6114 : :
6115 : : /* Set CHILD_FN to be the child function for OMP_TASK GS. */
6116 : :
6117 : : inline void
6118 : : gimple_omp_taskreg_set_child_fn (gimple *gs, tree child_fn)
6119 : : {
6120 : : gimple_statement_omp_taskreg *omp_taskreg_stmt
6121 : : = as_a <gimple_statement_omp_taskreg *> (gs);
6122 : : omp_taskreg_stmt->child_fn = child_fn;
6123 : : }
6124 : :
6125 : :
6126 : : /* Return the artificial argument used to send variables and values
6127 : : from the parent to the children threads in OMP_TASK GS. */
6128 : :
6129 : : inline tree
6130 : 40711 : gimple_omp_taskreg_data_arg (const gimple *gs)
6131 : : {
6132 : 40711 : const gimple_statement_omp_taskreg *omp_taskreg_stmt
6133 : 18150 : = as_a <const gimple_statement_omp_taskreg *> (gs);
6134 : 40711 : return omp_taskreg_stmt->data_arg;
6135 : : }
6136 : :
6137 : :
6138 : : /* Return a pointer to the data argument for OMP_TASK GS. */
6139 : :
6140 : : inline tree *
6141 : : gimple_omp_taskreg_data_arg_ptr (gimple *gs)
6142 : : {
6143 : : gimple_statement_omp_taskreg *omp_taskreg_stmt
6144 : : = as_a <gimple_statement_omp_taskreg *> (gs);
6145 : : return &omp_taskreg_stmt->data_arg;
6146 : : }
6147 : :
6148 : :
6149 : : /* Set DATA_ARG to be the data argument for OMP_TASK GS. */
6150 : :
6151 : : inline void
6152 : 17999 : gimple_omp_taskreg_set_data_arg (gimple *gs, tree data_arg)
6153 : : {
6154 : 17999 : gimple_statement_omp_taskreg *omp_taskreg_stmt
6155 : 17999 : = as_a <gimple_statement_omp_taskreg *> (gs);
6156 : 17999 : omp_taskreg_stmt->data_arg = data_arg;
6157 : 17999 : }
6158 : :
6159 : :
6160 : : /* Return the copy function used to hold the body of OMP_TASK GS. */
6161 : :
6162 : : inline tree
6163 : 4799 : gimple_omp_task_copy_fn (const gimple *gs)
6164 : : {
6165 : 4799 : const gomp_task *omp_task_stmt = as_a <const gomp_task *> (gs);
6166 : 4799 : return omp_task_stmt->copy_fn;
6167 : : }
6168 : :
6169 : : /* Return a pointer to the copy function used to hold the body of
6170 : : OMP_TASK GS. */
6171 : :
6172 : : inline tree *
6173 : 15673 : gimple_omp_task_copy_fn_ptr (gimple *gs)
6174 : : {
6175 : 15673 : gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
6176 : 15673 : return &omp_task_stmt->copy_fn;
6177 : : }
6178 : :
6179 : :
6180 : : /* Set CHILD_FN to be the copy function for OMP_TASK GS. */
6181 : :
6182 : : inline void
6183 : 6152 : gimple_omp_task_set_copy_fn (gimple *gs, tree copy_fn)
6184 : : {
6185 : 6152 : gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
6186 : 6152 : omp_task_stmt->copy_fn = copy_fn;
6187 : 564 : }
6188 : :
6189 : :
6190 : : /* Return size of the data block in bytes in OMP_TASK GS. */
6191 : :
6192 : : inline tree
6193 : 3763 : gimple_omp_task_arg_size (const gimple *gs)
6194 : : {
6195 : 3763 : const gomp_task *omp_task_stmt = as_a <const gomp_task *> (gs);
6196 : 3763 : return omp_task_stmt->arg_size;
6197 : : }
6198 : :
6199 : :
6200 : : /* Return a pointer to the data block size for OMP_TASK GS. */
6201 : :
6202 : : inline tree *
6203 : 15673 : gimple_omp_task_arg_size_ptr (gimple *gs)
6204 : : {
6205 : 15673 : gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
6206 : 15673 : return &omp_task_stmt->arg_size;
6207 : : }
6208 : :
6209 : :
6210 : : /* Set ARG_SIZE to be the data block size for OMP_TASK GS. */
6211 : :
6212 : : inline void
6213 : 11005 : gimple_omp_task_set_arg_size (gimple *gs, tree arg_size)
6214 : : {
6215 : 11005 : gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
6216 : 11005 : omp_task_stmt->arg_size = arg_size;
6217 : : }
6218 : :
6219 : :
6220 : : /* Return align of the data block in bytes in OMP_TASK GS. */
6221 : :
6222 : : inline tree
6223 : 3763 : gimple_omp_task_arg_align (const gimple *gs)
6224 : : {
6225 : 3763 : const gomp_task *omp_task_stmt = as_a <const gomp_task *> (gs);
6226 : 3763 : return omp_task_stmt->arg_align;
6227 : : }
6228 : :
6229 : :
6230 : : /* Return a pointer to the data block align for OMP_TASK GS. */
6231 : :
6232 : : inline tree *
6233 : 15673 : gimple_omp_task_arg_align_ptr (gimple *gs)
6234 : : {
6235 : 15673 : gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
6236 : 15673 : return &omp_task_stmt->arg_align;
6237 : : }
6238 : :
6239 : :
6240 : : /* Set ARG_SIZE to be the data block align for OMP_TASK GS. */
6241 : :
6242 : : inline void
6243 : 11005 : gimple_omp_task_set_arg_align (gimple *gs, tree arg_align)
6244 : : {
6245 : 11005 : gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
6246 : 5417 : omp_task_stmt->arg_align = arg_align;
6247 : 1982 : }
6248 : :
6249 : :
6250 : : /* Return the clauses associated with OMP_SINGLE GS. */
6251 : :
6252 : : inline tree
6253 : 3607 : gimple_omp_single_clauses (const gimple *gs)
6254 : : {
6255 : 3607 : const gomp_single *omp_single_stmt = as_a <const gomp_single *> (gs);
6256 : 3607 : return omp_single_stmt->clauses;
6257 : : }
6258 : :
6259 : :
6260 : : /* Return a pointer to the clauses associated with OMP_SINGLE GS. */
6261 : :
6262 : : inline tree *
6263 : 5032 : gimple_omp_single_clauses_ptr (gimple *gs)
6264 : : {
6265 : 5032 : gomp_single *omp_single_stmt = as_a <gomp_single *> (gs);
6266 : 5032 : return &omp_single_stmt->clauses;
6267 : : }
6268 : :
6269 : :
6270 : : /* Set CLAUSES to be the clauses associated with OMP_SINGLE_STMT. */
6271 : :
6272 : : inline void
6273 : 1274 : gimple_omp_single_set_clauses (gomp_single *omp_single_stmt, tree clauses)
6274 : : {
6275 : 0 : omp_single_stmt->clauses = clauses;
6276 : : }
6277 : :
6278 : :
6279 : : /* Return the clauses associated with OMP_TARGET GS. */
6280 : :
6281 : : inline tree
6282 : 179955 : gimple_omp_target_clauses (const gimple *gs)
6283 : : {
6284 : 179955 : const gomp_target *omp_target_stmt = as_a <const gomp_target *> (gs);
6285 : 179955 : return omp_target_stmt->clauses;
6286 : : }
6287 : :
6288 : :
6289 : : /* Return a pointer to the clauses associated with OMP_TARGET GS. */
6290 : :
6291 : : inline tree *
6292 : 160375 : gimple_omp_target_clauses_ptr (gimple *gs)
6293 : : {
6294 : 160375 : gomp_target *omp_target_stmt = as_a <gomp_target *> (gs);
6295 : 160375 : return &omp_target_stmt->clauses;
6296 : : }
6297 : :
6298 : :
6299 : : /* Set CLAUSES to be the clauses associated with OMP_TARGET_STMT. */
6300 : :
6301 : : inline void
6302 : 42632 : gimple_omp_target_set_clauses (gomp_target *omp_target_stmt,
6303 : : tree clauses)
6304 : : {
6305 : 693 : omp_target_stmt->clauses = clauses;
6306 : 88 : }
6307 : :
6308 : :
6309 : : /* Return the kind of the OMP_TARGET G. */
6310 : :
6311 : : inline int
6312 : 1531177 : gimple_omp_target_kind (const gimple *g)
6313 : : {
6314 : 1531177 : GIMPLE_CHECK (g, GIMPLE_OMP_TARGET);
6315 : 1531177 : return (gimple_omp_subcode (g) & GF_OMP_TARGET_KIND_MASK);
6316 : : }
6317 : :
6318 : :
6319 : : /* Set the kind of the OMP_TARGET G. */
6320 : :
6321 : : inline void
6322 : 41851 : gimple_omp_target_set_kind (gomp_target *g, int kind)
6323 : : {
6324 : 41851 : g->subcode = (g->subcode & ~GF_OMP_TARGET_KIND_MASK)
6325 : 41851 : | (kind & GF_OMP_TARGET_KIND_MASK);
6326 : : }
6327 : :
6328 : :
6329 : : /* Return the child function used to hold the body of OMP_TARGET_STMT. */
6330 : :
6331 : : inline tree
6332 : 27320 : gimple_omp_target_child_fn (const gomp_target *omp_target_stmt)
6333 : : {
6334 : 27320 : return omp_target_stmt->child_fn;
6335 : : }
6336 : :
6337 : : /* Return a pointer to the child function used to hold the body of
6338 : : OMP_TARGET_STMT. */
6339 : :
6340 : : inline tree *
6341 : 145093 : gimple_omp_target_child_fn_ptr (gomp_target *omp_target_stmt)
6342 : : {
6343 : 145093 : return &omp_target_stmt->child_fn;
6344 : : }
6345 : :
6346 : :
6347 : : /* Set CHILD_FN to be the child function for OMP_TARGET_STMT. */
6348 : :
6349 : : inline void
6350 : 23965 : gimple_omp_target_set_child_fn (gomp_target *omp_target_stmt,
6351 : : tree child_fn)
6352 : : {
6353 : 23965 : omp_target_stmt->child_fn = child_fn;
6354 : 23965 : }
6355 : :
6356 : :
6357 : : /* Return the artificial argument used to send variables and values
6358 : : from the parent to the children threads in OMP_TARGET_STMT. */
6359 : :
6360 : : inline tree
6361 : 56263 : gimple_omp_target_data_arg (const gomp_target *omp_target_stmt)
6362 : : {
6363 : 56263 : return omp_target_stmt->data_arg;
6364 : : }
6365 : :
6366 : :
6367 : : /* Return a pointer to the data argument for OMP_TARGET GS. */
6368 : :
6369 : : inline tree *
6370 : 145093 : gimple_omp_target_data_arg_ptr (gomp_target *omp_target_stmt)
6371 : : {
6372 : 145093 : return &omp_target_stmt->data_arg;
6373 : : }
6374 : :
6375 : :
6376 : : /* Set DATA_ARG to be the data argument for OMP_TARGET_STMT. */
6377 : :
6378 : : inline void
6379 : 31354 : gimple_omp_target_set_data_arg (gomp_target *omp_target_stmt,
6380 : : tree data_arg)
6381 : : {
6382 : 31354 : omp_target_stmt->data_arg = data_arg;
6383 : : }
6384 : :
6385 : :
6386 : : /* Return the Gimple sequence used to store loops for OpenMP iterators used
6387 : : by OMP_TARGET_STMT. */
6388 : :
6389 : : inline gimple_seq
6390 : 38508 : gimple_omp_target_iterator_loops (const gomp_target *omp_target_stmt)
6391 : : {
6392 : 38508 : return omp_target_stmt->iterator_loops;
6393 : : }
6394 : :
6395 : :
6396 : : /* Return a pointer to the Gimple sequence used to store loops for OpenMP
6397 : : iterators used by OMP_TARGET GS. */
6398 : :
6399 : : inline gimple_seq *
6400 : 5283 : gimple_omp_target_iterator_loops_ptr (gimple *gs)
6401 : : {
6402 : 5283 : gomp_target *omp_target_stmt = as_a <gomp_target *> (gs);
6403 : 5283 : return &omp_target_stmt->iterator_loops;
6404 : : }
6405 : :
6406 : :
6407 : : /* Set ITERATOR_LOOPS to be the Gimple sequence used to store loops
6408 : : constructed for OpenMP iterators in OMP_TARGET_STMT. */
6409 : :
6410 : : inline void
6411 : 78016 : gimple_omp_target_set_iterator_loops (gomp_target *omp_target_stmt,
6412 : : gimple_seq iterator_loops)
6413 : : {
6414 : 78016 : omp_target_stmt->iterator_loops = iterator_loops;
6415 : : }
6416 : :
6417 : :
6418 : : /* Return the clauses associated with OMP_TEAMS GS. */
6419 : :
6420 : : inline tree
6421 : 35481 : gimple_omp_teams_clauses (const gimple *gs)
6422 : : {
6423 : 35481 : const gomp_teams *omp_teams_stmt = as_a <const gomp_teams *> (gs);
6424 : 35481 : return omp_teams_stmt->clauses;
6425 : : }
6426 : :
6427 : :
6428 : : /* Return a pointer to the clauses associated with OMP_TEAMS GS. */
6429 : :
6430 : : inline tree *
6431 : 33964 : gimple_omp_teams_clauses_ptr (gimple *gs)
6432 : : {
6433 : 33964 : gomp_teams *omp_teams_stmt = as_a <gomp_teams *> (gs);
6434 : 33964 : return &omp_teams_stmt->clauses;
6435 : : }
6436 : :
6437 : :
6438 : : /* Set CLAUSES to be the clauses associated with OMP_TEAMS_STMT. */
6439 : :
6440 : : inline void
6441 : 8813 : gimple_omp_teams_set_clauses (gomp_teams *omp_teams_stmt, tree clauses)
6442 : : {
6443 : 8813 : omp_teams_stmt->clauses = clauses;
6444 : 0 : }
6445 : :
6446 : : /* Return the child function used to hold the body of OMP_TEAMS_STMT. */
6447 : :
6448 : : inline tree
6449 : 2535 : gimple_omp_teams_child_fn (const gomp_teams *omp_teams_stmt)
6450 : : {
6451 : 2535 : return omp_teams_stmt->child_fn;
6452 : : }
6453 : :
6454 : : /* Return a pointer to the child function used to hold the body of
6455 : : OMP_TEAMS_STMT. */
6456 : :
6457 : : inline tree *
6458 : : gimple_omp_teams_child_fn_ptr (gomp_teams *omp_teams_stmt)
6459 : : {
6460 : : return &omp_teams_stmt->child_fn;
6461 : : }
6462 : :
6463 : :
6464 : : /* Set CHILD_FN to be the child function for OMP_TEAMS_STMT. */
6465 : :
6466 : : inline void
6467 : 2657 : gimple_omp_teams_set_child_fn (gomp_teams *omp_teams_stmt, tree child_fn)
6468 : : {
6469 : 2657 : omp_teams_stmt->child_fn = child_fn;
6470 : : }
6471 : :
6472 : :
6473 : : /* Return the artificial argument used to send variables and values
6474 : : from the parent to the children threads in OMP_TEAMS_STMT. */
6475 : :
6476 : : inline tree
6477 : 2535 : gimple_omp_teams_data_arg (const gomp_teams *omp_teams_stmt)
6478 : : {
6479 : 2535 : return omp_teams_stmt->data_arg;
6480 : : }
6481 : :
6482 : :
6483 : : /* Return a pointer to the data argument for OMP_TEAMS_STMT. */
6484 : :
6485 : : inline tree *
6486 : : gimple_omp_teams_data_arg_ptr (gomp_teams *omp_teams_stmt)
6487 : : {
6488 : : return &omp_teams_stmt->data_arg;
6489 : : }
6490 : :
6491 : :
6492 : : /* Set DATA_ARG to be the data argument for OMP_TEAMS_STMT. */
6493 : :
6494 : : inline void
6495 : : gimple_omp_teams_set_data_arg (gomp_teams *omp_teams_stmt, tree data_arg)
6496 : : {
6497 : : omp_teams_stmt->data_arg = data_arg;
6498 : : }
6499 : :
6500 : : /* Return the host flag of an OMP_TEAMS_STMT. */
6501 : :
6502 : : inline bool
6503 : 106439 : gimple_omp_teams_host (const gomp_teams *omp_teams_stmt)
6504 : : {
6505 : 106439 : return (gimple_omp_subcode (omp_teams_stmt) & GF_OMP_TEAMS_HOST) != 0;
6506 : : }
6507 : :
6508 : : /* Set host flag of an OMP_TEAMS_STMT to VALUE. */
6509 : :
6510 : : inline void
6511 : 2671 : gimple_omp_teams_set_host (gomp_teams *omp_teams_stmt, bool value)
6512 : : {
6513 : 2671 : if (value)
6514 : 2671 : omp_teams_stmt->subcode |= GF_OMP_TEAMS_HOST;
6515 : : else
6516 : : omp_teams_stmt->subcode &= ~GF_OMP_TEAMS_HOST;
6517 : : }
6518 : :
6519 : : /* Return the clauses associated with OMP_SECTIONS GS. */
6520 : :
6521 : : inline tree
6522 : 3297 : gimple_omp_sections_clauses (const gimple *gs)
6523 : : {
6524 : 2919 : const gomp_sections *omp_sections_stmt = as_a <const gomp_sections *> (gs);
6525 : 3297 : return omp_sections_stmt->clauses;
6526 : : }
6527 : :
6528 : :
6529 : : /* Return a pointer to the clauses associated with OMP_SECTIONS GS. */
6530 : :
6531 : : inline tree *
6532 : 2016 : gimple_omp_sections_clauses_ptr (gimple *gs)
6533 : : {
6534 : 2016 : gomp_sections *omp_sections_stmt = as_a <gomp_sections *> (gs);
6535 : 2016 : return &omp_sections_stmt->clauses;
6536 : : }
6537 : :
6538 : :
6539 : : /* Set CLAUSES to be the set of clauses associated with OMP_SECTIONS
6540 : : GS. */
6541 : :
6542 : : inline void
6543 : 634 : gimple_omp_sections_set_clauses (gimple *gs, tree clauses)
6544 : : {
6545 : 634 : gomp_sections *omp_sections_stmt = as_a <gomp_sections *> (gs);
6546 : 8 : omp_sections_stmt->clauses = clauses;
6547 : : }
6548 : :
6549 : :
6550 : : /* Return the control variable associated with the GIMPLE_OMP_SECTIONS
6551 : : in GS. */
6552 : :
6553 : : inline tree
6554 : 420 : gimple_omp_sections_control (const gimple *gs)
6555 : : {
6556 : 420 : const gomp_sections *omp_sections_stmt = as_a <const gomp_sections *> (gs);
6557 : 420 : return omp_sections_stmt->control;
6558 : : }
6559 : :
6560 : :
6561 : : /* Return a pointer to the clauses associated with the GIMPLE_OMP_SECTIONS
6562 : : GS. */
6563 : :
6564 : : inline tree *
6565 : 1554 : gimple_omp_sections_control_ptr (gimple *gs)
6566 : : {
6567 : 1554 : gomp_sections *omp_sections_stmt = as_a <gomp_sections *> (gs);
6568 : 1554 : return &omp_sections_stmt->control;
6569 : : }
6570 : :
6571 : :
6572 : : /* Set CONTROL to be the set of clauses associated with the
6573 : : GIMPLE_OMP_SECTIONS in GS. */
6574 : :
6575 : : inline void
6576 : 378 : gimple_omp_sections_set_control (gimple *gs, tree control)
6577 : : {
6578 : 378 : gomp_sections *omp_sections_stmt = as_a <gomp_sections *> (gs);
6579 : 378 : omp_sections_stmt->control = control;
6580 : : }
6581 : :
6582 : :
6583 : : /* Set the value being stored in an atomic store. */
6584 : :
6585 : : inline void
6586 : 10317 : gimple_omp_atomic_store_set_val (gomp_atomic_store *store_stmt, tree val)
6587 : : {
6588 : 10317 : store_stmt->val = val;
6589 : : }
6590 : :
6591 : :
6592 : : /* Return the value being stored in an atomic store. */
6593 : :
6594 : : inline tree
6595 : 10019 : gimple_omp_atomic_store_val (const gomp_atomic_store *store_stmt)
6596 : : {
6597 : 10019 : return store_stmt->val;
6598 : : }
6599 : :
6600 : :
6601 : : /* Return a pointer to the value being stored in an atomic store. */
6602 : :
6603 : : inline tree *
6604 : 49383 : gimple_omp_atomic_store_val_ptr (gomp_atomic_store *store_stmt)
6605 : : {
6606 : 49383 : return &store_stmt->val;
6607 : : }
6608 : :
6609 : :
6610 : : /* Set the LHS of an atomic load. */
6611 : :
6612 : : inline void
6613 : 10317 : gimple_omp_atomic_load_set_lhs (gomp_atomic_load *load_stmt, tree lhs)
6614 : : {
6615 : 10317 : load_stmt->lhs = lhs;
6616 : : }
6617 : :
6618 : :
6619 : : /* Get the LHS of an atomic load. */
6620 : :
6621 : : inline tree
6622 : 10019 : gimple_omp_atomic_load_lhs (const gomp_atomic_load *load_stmt)
6623 : : {
6624 : 10019 : return load_stmt->lhs;
6625 : : }
6626 : :
6627 : :
6628 : : /* Return a pointer to the LHS of an atomic load. */
6629 : :
6630 : : inline tree *
6631 : 48373 : gimple_omp_atomic_load_lhs_ptr (gomp_atomic_load *load_stmt)
6632 : : {
6633 : 48373 : return &load_stmt->lhs;
6634 : : }
6635 : :
6636 : :
6637 : : /* Set the RHS of an atomic load. */
6638 : :
6639 : : inline void
6640 : 10317 : gimple_omp_atomic_load_set_rhs (gomp_atomic_load *load_stmt, tree rhs)
6641 : : {
6642 : 10317 : load_stmt->rhs = rhs;
6643 : : }
6644 : :
6645 : :
6646 : : /* Get the RHS of an atomic load. */
6647 : :
6648 : : inline tree
6649 : 10019 : gimple_omp_atomic_load_rhs (const gomp_atomic_load *load_stmt)
6650 : : {
6651 : 10019 : return load_stmt->rhs;
6652 : : }
6653 : :
6654 : :
6655 : : /* Return a pointer to the RHS of an atomic load. */
6656 : :
6657 : : inline tree *
6658 : 52233 : gimple_omp_atomic_load_rhs_ptr (gomp_atomic_load *load_stmt)
6659 : : {
6660 : 52233 : return &load_stmt->rhs;
6661 : : }
6662 : :
6663 : :
6664 : : /* Get the definition of the control variable in a GIMPLE_OMP_CONTINUE. */
6665 : :
6666 : : inline tree
6667 : 25104 : gimple_omp_continue_control_def (const gomp_continue *cont_stmt)
6668 : : {
6669 : 25104 : return cont_stmt->control_def;
6670 : : }
6671 : :
6672 : : /* The same as above, but return the address. */
6673 : :
6674 : : inline tree *
6675 : 195962 : gimple_omp_continue_control_def_ptr (gomp_continue *cont_stmt)
6676 : : {
6677 : 195962 : return &cont_stmt->control_def;
6678 : : }
6679 : :
6680 : : /* Set the definition of the control variable in a GIMPLE_OMP_CONTINUE. */
6681 : :
6682 : : inline void
6683 : 51847 : gimple_omp_continue_set_control_def (gomp_continue *cont_stmt, tree def)
6684 : : {
6685 : 51847 : cont_stmt->control_def = def;
6686 : : }
6687 : :
6688 : :
6689 : : /* Get the use of the control variable in a GIMPLE_OMP_CONTINUE. */
6690 : :
6691 : : inline tree
6692 : 25104 : gimple_omp_continue_control_use (const gomp_continue *cont_stmt)
6693 : : {
6694 : 25104 : return cont_stmt->control_use;
6695 : : }
6696 : :
6697 : :
6698 : : /* The same as above, but return the address. */
6699 : :
6700 : : inline tree *
6701 : 195962 : gimple_omp_continue_control_use_ptr (gomp_continue *cont_stmt)
6702 : : {
6703 : 195962 : return &cont_stmt->control_use;
6704 : : }
6705 : :
6706 : :
6707 : : /* Set the use of the control variable in a GIMPLE_OMP_CONTINUE. */
6708 : :
6709 : : inline void
6710 : 51847 : gimple_omp_continue_set_control_use (gomp_continue *cont_stmt, tree use)
6711 : : {
6712 : 51847 : cont_stmt->control_use = use;
6713 : : }
6714 : :
6715 : : /* Return the guard associated with the GIMPLE_ASSUME statement GS. */
6716 : :
6717 : : inline tree
6718 : 124 : gimple_assume_guard (const gimple *gs)
6719 : : {
6720 : 124 : const gimple_statement_assume *assume_stmt
6721 : 124 : = as_a <const gimple_statement_assume *> (gs);
6722 : 124 : return assume_stmt->guard;
6723 : : }
6724 : :
6725 : : /* Set the guard associated with the GIMPLE_ASSUME statement GS. */
6726 : :
6727 : : inline void
6728 : 124 : gimple_assume_set_guard (gimple *gs, tree guard)
6729 : : {
6730 : 124 : gimple_statement_assume *assume_stmt = as_a <gimple_statement_assume *> (gs);
6731 : 124 : assume_stmt->guard = guard;
6732 : 0 : }
6733 : :
6734 : : inline tree *
6735 : 12 : gimple_assume_guard_ptr (gimple *gs)
6736 : : {
6737 : 12 : gimple_statement_assume *assume_stmt = as_a <gimple_statement_assume *> (gs);
6738 : 12 : return &assume_stmt->guard;
6739 : : }
6740 : :
6741 : : /* Return the address of the GIMPLE sequence contained in the GIMPLE_ASSUME
6742 : : statement GS. */
6743 : :
6744 : : inline gimple_seq *
6745 : 275 : gimple_assume_body_ptr (gimple *gs)
6746 : : {
6747 : 275 : gimple_statement_assume *assume_stmt = as_a <gimple_statement_assume *> (gs);
6748 : 151 : return &assume_stmt->body;
6749 : : }
6750 : :
6751 : : /* Return the GIMPLE sequence contained in the GIMPLE_ASSUME statement GS. */
6752 : :
6753 : : inline gimple_seq
6754 : 502 : gimple_assume_body (const gimple *gs)
6755 : : {
6756 : 502 : const gimple_statement_assume *assume_stmt
6757 : 502 : = as_a <const gimple_statement_assume *> (gs);
6758 : 502 : return assume_stmt->body;
6759 : : }
6760 : :
6761 : : /* Return a pointer to the body for the GIMPLE_TRANSACTION statement
6762 : : TRANSACTION_STMT. */
6763 : :
6764 : : inline gimple_seq *
6765 : 1645 : gimple_transaction_body_ptr (gtransaction *transaction_stmt)
6766 : : {
6767 : 1645 : return &transaction_stmt->body;
6768 : : }
6769 : :
6770 : : /* Return the body for the GIMPLE_TRANSACTION statement TRANSACTION_STMT. */
6771 : :
6772 : : inline gimple_seq
6773 : 35107 : gimple_transaction_body (const gtransaction *transaction_stmt)
6774 : : {
6775 : 35107 : return transaction_stmt->body;
6776 : : }
6777 : :
6778 : : /* Return the label associated with a GIMPLE_TRANSACTION. */
6779 : :
6780 : : inline tree
6781 : 35381 : gimple_transaction_label_norm (const gtransaction *transaction_stmt)
6782 : : {
6783 : 35381 : return transaction_stmt->label_norm;
6784 : : }
6785 : :
6786 : : inline tree *
6787 : 61988 : gimple_transaction_label_norm_ptr (gtransaction *transaction_stmt)
6788 : : {
6789 : 61988 : return &transaction_stmt->label_norm;
6790 : : }
6791 : :
6792 : : inline tree
6793 : 35381 : gimple_transaction_label_uninst (const gtransaction *transaction_stmt)
6794 : : {
6795 : 35381 : return transaction_stmt->label_uninst;
6796 : : }
6797 : :
6798 : : inline tree *
6799 : 61988 : gimple_transaction_label_uninst_ptr (gtransaction *transaction_stmt)
6800 : : {
6801 : 61988 : return &transaction_stmt->label_uninst;
6802 : : }
6803 : :
6804 : : inline tree
6805 : 35381 : gimple_transaction_label_over (const gtransaction *transaction_stmt)
6806 : : {
6807 : 35381 : return transaction_stmt->label_over;
6808 : : }
6809 : :
6810 : : inline tree *
6811 : 61988 : gimple_transaction_label_over_ptr (gtransaction *transaction_stmt)
6812 : : {
6813 : 61988 : return &transaction_stmt->label_over;
6814 : : }
6815 : :
6816 : : /* Return the subcode associated with a GIMPLE_TRANSACTION. */
6817 : :
6818 : : inline unsigned int
6819 : 3925 : gimple_transaction_subcode (const gtransaction *transaction_stmt)
6820 : : {
6821 : 3917 : return transaction_stmt->subcode;
6822 : : }
6823 : :
6824 : : /* Set BODY to be the body for the GIMPLE_TRANSACTION statement
6825 : : TRANSACTION_STMT. */
6826 : :
6827 : : inline void
6828 : 1025 : gimple_transaction_set_body (gtransaction *transaction_stmt,
6829 : : gimple_seq body)
6830 : : {
6831 : 480 : transaction_stmt->body = body;
6832 : 6 : }
6833 : :
6834 : : /* Set the label associated with a GIMPLE_TRANSACTION. */
6835 : :
6836 : : inline void
6837 : 1149 : gimple_transaction_set_label_norm (gtransaction *transaction_stmt, tree label)
6838 : : {
6839 : 1149 : transaction_stmt->label_norm = label;
6840 : 135 : }
6841 : :
6842 : : inline void
6843 : 1133 : gimple_transaction_set_label_uninst (gtransaction *transaction_stmt, tree label)
6844 : : {
6845 : 1133 : transaction_stmt->label_uninst = label;
6846 : 520 : }
6847 : :
6848 : : inline void
6849 : 1102 : gimple_transaction_set_label_over (gtransaction *transaction_stmt, tree label)
6850 : : {
6851 : 1102 : transaction_stmt->label_over = label;
6852 : 557 : }
6853 : :
6854 : : /* Set the subcode associated with a GIMPLE_TRANSACTION. */
6855 : :
6856 : : inline void
6857 : 1970 : gimple_transaction_set_subcode (gtransaction *transaction_stmt,
6858 : : unsigned int subcode)
6859 : : {
6860 : 946 : transaction_stmt->subcode = subcode;
6861 : 1024 : }
6862 : :
6863 : : /* Return a pointer to the return value for GIMPLE_RETURN GS. */
6864 : :
6865 : : inline tree *
6866 : 576090 : gimple_return_retval_ptr (greturn *gs)
6867 : : {
6868 : 576090 : return &gs->op[0];
6869 : : }
6870 : :
6871 : : /* Return the return value for GIMPLE_RETURN GS. */
6872 : :
6873 : : inline tree
6874 : 361788384 : gimple_return_retval (const greturn *gs)
6875 : : {
6876 : 361788384 : return gs->op[0];
6877 : : }
6878 : :
6879 : :
6880 : : /* Set RETVAL to be the return value for GIMPLE_RETURN GS. */
6881 : :
6882 : : inline void
6883 : 2160684 : gimple_return_set_retval (greturn *gs, tree retval)
6884 : : {
6885 : 2160684 : gs->op[0] = retval;
6886 : 2160356 : }
6887 : :
6888 : :
6889 : : /* Returns true when the gimple statement STMT is any of the OMP types. */
6890 : :
6891 : : #define CASE_GIMPLE_OMP \
6892 : : case GIMPLE_OMP_PARALLEL: \
6893 : : case GIMPLE_OMP_TASK: \
6894 : : case GIMPLE_OMP_FOR: \
6895 : : case GIMPLE_OMP_SECTIONS: \
6896 : : case GIMPLE_OMP_SECTIONS_SWITCH: \
6897 : : case GIMPLE_OMP_SINGLE: \
6898 : : case GIMPLE_OMP_TARGET: \
6899 : : case GIMPLE_OMP_TEAMS: \
6900 : : case GIMPLE_OMP_SCOPE: \
6901 : : case GIMPLE_OMP_DISPATCH: \
6902 : : case GIMPLE_OMP_INTEROP: \
6903 : : case GIMPLE_OMP_SECTION: \
6904 : : case GIMPLE_OMP_STRUCTURED_BLOCK: \
6905 : : case GIMPLE_OMP_MASTER: \
6906 : : case GIMPLE_OMP_MASKED: \
6907 : : case GIMPLE_OMP_TASKGROUP: \
6908 : : case GIMPLE_OMP_ORDERED: \
6909 : : case GIMPLE_OMP_CRITICAL: \
6910 : : case GIMPLE_OMP_SCAN: \
6911 : : case GIMPLE_OMP_RETURN: \
6912 : : case GIMPLE_OMP_ATOMIC_LOAD: \
6913 : : case GIMPLE_OMP_ATOMIC_STORE: \
6914 : : case GIMPLE_OMP_CONTINUE
6915 : :
6916 : : inline bool
6917 : 8618391 : is_gimple_omp (const gimple *stmt)
6918 : : {
6919 : 7224162 : switch (gimple_code (stmt))
6920 : : {
6921 : : CASE_GIMPLE_OMP:
6922 : : return true;
6923 : 3080669 : default:
6924 : 3080669 : return false;
6925 : : }
6926 : : }
6927 : :
6928 : : /* Return true if the OMP gimple statement STMT is any of the OpenACC types
6929 : : specifically. */
6930 : :
6931 : : inline bool
6932 : 1108741 : is_gimple_omp_oacc (const gimple *stmt)
6933 : : {
6934 : 1108741 : gcc_assert (is_gimple_omp (stmt));
6935 : 1108741 : switch (gimple_code (stmt))
6936 : : {
6937 : 0 : case GIMPLE_OMP_ATOMIC_LOAD:
6938 : 0 : case GIMPLE_OMP_ATOMIC_STORE:
6939 : 0 : case GIMPLE_OMP_CONTINUE:
6940 : 0 : case GIMPLE_OMP_RETURN:
6941 : : /* Codes shared between OpenACC and OpenMP cannot be used to disambiguate
6942 : : the two. */
6943 : 0 : gcc_unreachable ();
6944 : :
6945 : 398585 : case GIMPLE_OMP_FOR:
6946 : 398585 : switch (gimple_omp_for_kind (stmt))
6947 : : {
6948 : : case GF_OMP_FOR_KIND_OACC_LOOP:
6949 : : return true;
6950 : : default:
6951 : : return false;
6952 : : }
6953 : 472509 : case GIMPLE_OMP_TARGET:
6954 : 472509 : switch (gimple_omp_target_kind (stmt))
6955 : : {
6956 : : case GF_OMP_TARGET_KIND_OACC_PARALLEL:
6957 : : case GF_OMP_TARGET_KIND_OACC_KERNELS:
6958 : : case GF_OMP_TARGET_KIND_OACC_SERIAL:
6959 : : case GF_OMP_TARGET_KIND_OACC_DATA:
6960 : : case GF_OMP_TARGET_KIND_OACC_UPDATE:
6961 : : case GF_OMP_TARGET_KIND_OACC_ENTER_DATA:
6962 : : case GF_OMP_TARGET_KIND_OACC_EXIT_DATA:
6963 : : case GF_OMP_TARGET_KIND_OACC_DECLARE:
6964 : : case GF_OMP_TARGET_KIND_OACC_HOST_DATA:
6965 : : case GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_PARALLELIZED:
6966 : : case GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_GANG_SINGLE:
6967 : : case GF_OMP_TARGET_KIND_OACC_DATA_KERNELS:
6968 : : return true;
6969 : : default:
6970 : : return false;
6971 : : }
6972 : : default:
6973 : : return false;
6974 : : }
6975 : : }
6976 : :
6977 : :
6978 : : /* Return true if the OMP gimple statement STMT is offloaded. */
6979 : :
6980 : : inline bool
6981 : 688941 : is_gimple_omp_offloaded (const gimple *stmt)
6982 : : {
6983 : 688941 : gcc_assert (is_gimple_omp (stmt));
6984 : 688941 : switch (gimple_code (stmt))
6985 : : {
6986 : 490561 : case GIMPLE_OMP_TARGET:
6987 : 490561 : switch (gimple_omp_target_kind (stmt))
6988 : : {
6989 : : case GF_OMP_TARGET_KIND_REGION:
6990 : : case GF_OMP_TARGET_KIND_OACC_PARALLEL:
6991 : : case GF_OMP_TARGET_KIND_OACC_KERNELS:
6992 : : case GF_OMP_TARGET_KIND_OACC_SERIAL:
6993 : : case GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_PARALLELIZED:
6994 : : case GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_GANG_SINGLE:
6995 : : return true;
6996 : : default:
6997 : : return false;
6998 : : }
6999 : : default:
7000 : : return false;
7001 : : }
7002 : : }
7003 : :
7004 : :
7005 : : /* Returns TRUE if statement G is a GIMPLE_NOP. */
7006 : :
7007 : : inline bool
7008 : 24180807189 : gimple_nop_p (const gimple *g)
7009 : : {
7010 : 24502127066 : return gimple_code (g) == GIMPLE_NOP;
7011 : : }
7012 : :
7013 : :
7014 : : /* Return true if GS is a GIMPLE_RESX. */
7015 : :
7016 : : inline bool
7017 : 2482424 : is_gimple_resx (const gimple *gs)
7018 : : {
7019 : 2482424 : return gimple_code (gs) == GIMPLE_RESX;
7020 : : }
7021 : :
7022 : :
7023 : : /* Enum and arrays used for allocation stats. Keep in sync with
7024 : : gimple.cc:gimple_alloc_kind_names. */
7025 : : enum gimple_alloc_kind
7026 : : {
7027 : : gimple_alloc_kind_assign, /* Assignments. */
7028 : : gimple_alloc_kind_phi, /* PHI nodes. */
7029 : : gimple_alloc_kind_cond, /* Conditionals. */
7030 : : gimple_alloc_kind_rest, /* Everything else. */
7031 : : gimple_alloc_kind_all
7032 : : };
7033 : :
7034 : : extern uint64_t gimple_alloc_counts[];
7035 : : extern uint64_t gimple_alloc_sizes[];
7036 : :
7037 : : /* Return the allocation kind for a given stmt CODE. */
7038 : : inline enum gimple_alloc_kind
7039 : : gimple_alloc_kind (enum gimple_code code)
7040 : : {
7041 : : switch (code)
7042 : : {
7043 : : case GIMPLE_ASSIGN:
7044 : : return gimple_alloc_kind_assign;
7045 : : case GIMPLE_PHI:
7046 : : return gimple_alloc_kind_phi;
7047 : : case GIMPLE_COND:
7048 : : return gimple_alloc_kind_cond;
7049 : : default:
7050 : : return gimple_alloc_kind_rest;
7051 : : }
7052 : : }
7053 : :
7054 : : /* Return true if a location should not be emitted for this statement
7055 : : by annotate_all_with_location. */
7056 : :
7057 : : inline bool
7058 : 336002838 : gimple_do_not_emit_location_p (gimple *g)
7059 : : {
7060 : 336002838 : return gimple_plf (g, GF_PLF_1);
7061 : : }
7062 : :
7063 : : /* Mark statement G so a location will not be emitted by
7064 : : annotate_one_with_location. */
7065 : :
7066 : : inline void
7067 : 1909225 : gimple_set_do_not_emit_location (gimple *g)
7068 : : {
7069 : : /* The PLF flags are initialized to 0 when a new tuple is created,
7070 : : so no need to initialize it anywhere. */
7071 : 1909225 : gimple_set_plf (g, GF_PLF_1, true);
7072 : : }
7073 : :
7074 : : #endif /* GCC_GIMPLE_H */
|