forked from riscvarchive/riscv-gcc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgimple.h
6730 lines (5193 loc) · 156 KB
/
gimple.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* Gimple IR definitions.
Copyright (C) 2007-2020 Free Software Foundation, Inc.
Contributed by Aldy Hernandez <[email protected]>
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 3, or (at your option) any later
version.
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
#ifndef GCC_GIMPLE_H
#define GCC_GIMPLE_H
#include "tree-ssa-alias.h"
#include "gimple-expr.h"
typedef gimple *gimple_seq_node;
enum gimple_code {
#define DEFGSCODE(SYM, STRING, STRUCT) SYM,
#include "gimple.def"
#undef DEFGSCODE
LAST_AND_UNUSED_GIMPLE_CODE
};
extern const char *const gimple_code_name[];
extern const unsigned char gimple_rhs_class_table[];
/* Strip the outermost pointer, from tr1/type_traits. */
template<typename T> struct remove_pointer { typedef T type; };
template<typename T> struct remove_pointer<T *> { typedef T type; };
/* Error out if a gimple tuple is addressed incorrectly. */
#if defined ENABLE_GIMPLE_CHECKING
#define gcc_gimple_checking_assert(EXPR) gcc_assert (EXPR)
extern void gimple_check_failed (const gimple *, const char *, int, \
const char *, enum gimple_code, \
enum tree_code) ATTRIBUTE_NORETURN \
ATTRIBUTE_COLD;
#define GIMPLE_CHECK(GS, CODE) \
do { \
const gimple *__gs = (GS); \
if (gimple_code (__gs) != (CODE)) \
gimple_check_failed (__gs, __FILE__, __LINE__, __FUNCTION__, \
(CODE), ERROR_MARK); \
} while (0)
template <typename T>
static inline T
GIMPLE_CHECK2(const gimple *gs,
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)
const char *file = __builtin_FILE (),
int line = __builtin_LINE (),
const char *fun = __builtin_FUNCTION ())
#else
const char *file = __FILE__,
int line = __LINE__,
const char *fun = NULL)
#endif
{
T ret = dyn_cast <T> (gs);
if (!ret)
gimple_check_failed (gs, file, line, fun,
remove_pointer<T>::type::code_, ERROR_MARK);
return ret;
}
template <typename T>
static inline T
GIMPLE_CHECK2(gimple *gs,
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)
const char *file = __builtin_FILE (),
int line = __builtin_LINE (),
const char *fun = __builtin_FUNCTION ())
#else
const char *file = __FILE__,
int line = __LINE__,
const char *fun = NULL)
#endif
{
T ret = dyn_cast <T> (gs);
if (!ret)
gimple_check_failed (gs, file, line, fun,
remove_pointer<T>::type::code_, ERROR_MARK);
return ret;
}
#else /* not ENABLE_GIMPLE_CHECKING */
#define gcc_gimple_checking_assert(EXPR) ((void)(0 && (EXPR)))
#define GIMPLE_CHECK(GS, CODE) (void)0
template <typename T>
static inline T
GIMPLE_CHECK2(gimple *gs)
{
return as_a <T> (gs);
}
template <typename T>
static inline T
GIMPLE_CHECK2(const gimple *gs)
{
return as_a <T> (gs);
}
#endif
/* Class of GIMPLE expressions suitable for the RHS of assignments. See
get_gimple_rhs_class. */
enum gimple_rhs_class
{
GIMPLE_INVALID_RHS, /* The expression cannot be used on the RHS. */
GIMPLE_TERNARY_RHS, /* The expression is a ternary operation. */
GIMPLE_BINARY_RHS, /* The expression is a binary operation. */
GIMPLE_UNARY_RHS, /* The expression is a unary operation. */
GIMPLE_SINGLE_RHS /* The expression is a single object (an SSA
name, a _DECL, a _REF, etc. */
};
/* Specific flags for individual GIMPLE statements. These flags are
always stored in gimple.subcode and they may only be
defined for statement codes that do not use subcodes.
Values for the masks can overlap as long as the overlapping values
are never used in the same statement class.
The maximum mask value that can be defined is 1 << 15 (i.e., each
statement code can hold up to 16 bitflags).
Keep this list sorted. */
enum gf_mask {
GF_ASM_INPUT = 1 << 0,
GF_ASM_VOLATILE = 1 << 1,
GF_ASM_INLINE = 1 << 2,
GF_CALL_FROM_THUNK = 1 << 0,
GF_CALL_RETURN_SLOT_OPT = 1 << 1,
GF_CALL_TAILCALL = 1 << 2,
GF_CALL_VA_ARG_PACK = 1 << 3,
GF_CALL_NOTHROW = 1 << 4,
GF_CALL_ALLOCA_FOR_VAR = 1 << 5,
GF_CALL_INTERNAL = 1 << 6,
GF_CALL_CTRL_ALTERING = 1 << 7,
GF_CALL_MUST_TAIL_CALL = 1 << 9,
GF_CALL_BY_DESCRIPTOR = 1 << 10,
GF_CALL_NOCF_CHECK = 1 << 11,
GF_OMP_PARALLEL_COMBINED = 1 << 0,
GF_OMP_PARALLEL_GRID_PHONY = 1 << 1,
GF_OMP_TASK_TASKLOOP = 1 << 0,
GF_OMP_TASK_TASKWAIT = 1 << 1,
GF_OMP_FOR_KIND_MASK = (1 << 3) - 1,
GF_OMP_FOR_KIND_FOR = 0,
GF_OMP_FOR_KIND_DISTRIBUTE = 1,
GF_OMP_FOR_KIND_TASKLOOP = 2,
GF_OMP_FOR_KIND_OACC_LOOP = 4,
GF_OMP_FOR_KIND_GRID_LOOP = 5,
GF_OMP_FOR_KIND_SIMD = 6,
GF_OMP_FOR_COMBINED = 1 << 3,
GF_OMP_FOR_COMBINED_INTO = 1 << 4,
/* The following flag must not be used on GF_OMP_FOR_KIND_GRID_LOOP loop
statements. */
GF_OMP_FOR_GRID_PHONY = 1 << 5,
/* The following two flags should only be set on GF_OMP_FOR_KIND_GRID_LOOP
loop statements. */
GF_OMP_FOR_GRID_INTRA_GROUP = 1 << 5,
GF_OMP_FOR_GRID_GROUP_ITER = 1 << 6,
GF_OMP_TARGET_KIND_MASK = (1 << 4) - 1,
GF_OMP_TARGET_KIND_REGION = 0,
GF_OMP_TARGET_KIND_DATA = 1,
GF_OMP_TARGET_KIND_UPDATE = 2,
GF_OMP_TARGET_KIND_ENTER_DATA = 3,
GF_OMP_TARGET_KIND_EXIT_DATA = 4,
GF_OMP_TARGET_KIND_OACC_PARALLEL = 5,
GF_OMP_TARGET_KIND_OACC_KERNELS = 6,
GF_OMP_TARGET_KIND_OACC_SERIAL = 7,
GF_OMP_TARGET_KIND_OACC_DATA = 8,
GF_OMP_TARGET_KIND_OACC_UPDATE = 9,
GF_OMP_TARGET_KIND_OACC_ENTER_EXIT_DATA = 10,
GF_OMP_TARGET_KIND_OACC_DECLARE = 11,
GF_OMP_TARGET_KIND_OACC_HOST_DATA = 12,
GF_OMP_TEAMS_GRID_PHONY = 1 << 0,
GF_OMP_TEAMS_HOST = 1 << 1,
/* True on an GIMPLE_OMP_RETURN statement if the return does not require
a thread synchronization via some sort of barrier. The exact barrier
that would otherwise be emitted is dependent on the OMP statement with
which this return is associated. */
GF_OMP_RETURN_NOWAIT = 1 << 0,
GF_OMP_SECTION_LAST = 1 << 0,
GF_OMP_ATOMIC_MEMORY_ORDER = (1 << 3) - 1,
GF_OMP_ATOMIC_NEED_VALUE = 1 << 3,
GF_PREDICT_TAKEN = 1 << 15
};
/* This subcode tells apart different kinds of stmts that are not used
for codegen, but rather to retain debug information. */
enum gimple_debug_subcode {
GIMPLE_DEBUG_BIND = 0,
GIMPLE_DEBUG_SOURCE_BIND = 1,
GIMPLE_DEBUG_BEGIN_STMT = 2,
GIMPLE_DEBUG_INLINE_ENTRY = 3
};
/* Masks for selecting a pass local flag (PLF) to work on. These
masks are used by gimple_set_plf and gimple_plf. */
enum plf_mask {
GF_PLF_1 = 1 << 0,
GF_PLF_2 = 1 << 1
};
/* Data structure definitions for GIMPLE tuples. NOTE: word markers
are for 64 bit hosts. */
struct GTY((desc ("gimple_statement_structure (&%h)"), tag ("GSS_BASE"),
chain_next ("%h.next"), variable_size))
gimple
{
/* [ WORD 1 ]
Main identifying code for a tuple. */
ENUM_BITFIELD(gimple_code) code : 8;
/* Nonzero if a warning should not be emitted on this tuple. */
unsigned int no_warning : 1;
/* Nonzero if this tuple has been visited. Passes are responsible
for clearing this bit before using it. */
unsigned int visited : 1;
/* Nonzero if this tuple represents a non-temporal move. */
unsigned int nontemporal_move : 1;
/* Pass local flags. These flags are free for any pass to use as
they see fit. Passes should not assume that these flags contain
any useful value when the pass starts. Any initial state that
the pass requires should be set on entry to the pass. See
gimple_set_plf and gimple_plf for usage. */
unsigned int plf : 2;
/* Nonzero if this statement has been modified and needs to have its
operands rescanned. */
unsigned modified : 1;
/* Nonzero if this statement contains volatile operands. */
unsigned has_volatile_ops : 1;
/* Padding to get subcode to 16 bit alignment. */
unsigned pad : 1;
/* The SUBCODE field can be used for tuple-specific flags for tuples
that do not require subcodes. Note that SUBCODE should be at
least as wide as tree codes, as several tuples store tree codes
in there. */
unsigned int subcode : 16;
/* UID of this statement. This is used by passes that want to
assign IDs to statements. It must be assigned and used by each
pass. By default it should be assumed to contain garbage. */
unsigned uid;
/* [ WORD 2 ]
Locus information for debug info. */
location_t location;
/* Number of operands in this tuple. */
unsigned num_ops;
/* [ WORD 3 ]
Basic block holding this statement. */
basic_block bb;
/* [ WORD 4-5 ]
Linked lists of gimple statements. The next pointers form
a NULL terminated list, the prev pointers are a cyclic list.
A gimple statement is hence also a double-ended list of
statements, with the pointer itself being the first element,
and the prev pointer being the last. */
gimple *next;
gimple *GTY((skip)) prev;
};
/* Base structure for tuples with operands. */
/* This gimple subclass has no tag value. */
struct GTY(())
gimple_statement_with_ops_base : public gimple
{
/* [ WORD 1-6 ] : base class */
/* [ WORD 7 ]
SSA operand vectors. NOTE: It should be possible to
amalgamate these vectors with the operand vector OP. However,
the SSA operand vectors are organized differently and contain
more information (like immediate use chaining). */
struct use_optype_d GTY((skip (""))) *use_ops;
};
/* Statements that take register operands. */
struct GTY((tag("GSS_WITH_OPS")))
gimple_statement_with_ops : public gimple_statement_with_ops_base
{
/* [ WORD 1-7 ] : base class */
/* [ WORD 8 ]
Operand vector. NOTE! This must always be the last field
of this structure. In particular, this means that this
structure cannot be embedded inside another one. */
tree GTY((length ("%h.num_ops"))) op[1];
};
/* Base for statements that take both memory and register operands. */
struct GTY((tag("GSS_WITH_MEM_OPS_BASE")))
gimple_statement_with_memory_ops_base : public gimple_statement_with_ops_base
{
/* [ WORD 1-7 ] : base class */
/* [ WORD 8-9 ]
Virtual operands for this statement. The GC will pick them
up via the ssa_names array. */
tree GTY((skip (""))) vdef;
tree GTY((skip (""))) vuse;
};
/* Statements that take both memory and register operands. */
struct GTY((tag("GSS_WITH_MEM_OPS")))
gimple_statement_with_memory_ops :
public gimple_statement_with_memory_ops_base
{
/* [ WORD 1-9 ] : base class */
/* [ WORD 10 ]
Operand vector. NOTE! This must always be the last field
of this structure. In particular, this means that this
structure cannot be embedded inside another one. */
tree GTY((length ("%h.num_ops"))) op[1];
};
/* Call statements that take both memory and register operands. */
struct GTY((tag("GSS_CALL")))
gcall : public gimple_statement_with_memory_ops_base
{
/* [ WORD 1-9 ] : base class */
/* [ WORD 10-13 ] */
struct pt_solution call_used;
struct pt_solution call_clobbered;
/* [ WORD 14 ] */
union GTY ((desc ("%1.subcode & GF_CALL_INTERNAL"))) {
tree GTY ((tag ("0"))) fntype;
enum internal_fn GTY ((tag ("GF_CALL_INTERNAL"))) internal_fn;
} u;
/* [ WORD 15 ]
Operand vector. NOTE! This must always be the last field
of this structure. In particular, this means that this
structure cannot be embedded inside another one. */
tree GTY((length ("%h.num_ops"))) op[1];
static const enum gimple_code code_ = GIMPLE_CALL;
};
/* OMP statements. */
struct GTY((tag("GSS_OMP")))
gimple_statement_omp : public gimple
{
/* [ WORD 1-6 ] : base class */
/* [ WORD 7 ] */
gimple_seq body;
};
/* GIMPLE_BIND */
struct GTY((tag("GSS_BIND")))
gbind : public gimple
{
/* [ WORD 1-6 ] : base class */
/* [ WORD 7 ]
Variables declared in this scope. */
tree vars;
/* [ WORD 8 ]
This is different than the BLOCK field in gimple,
which is analogous to TREE_BLOCK (i.e., the lexical block holding
this statement). This field is the equivalent of BIND_EXPR_BLOCK
in tree land (i.e., the lexical scope defined by this bind). See
gimple-low.c. */
tree block;
/* [ WORD 9 ] */
gimple_seq body;
};
/* GIMPLE_CATCH */
struct GTY((tag("GSS_CATCH")))
gcatch : public gimple
{
/* [ WORD 1-6 ] : base class */
/* [ WORD 7 ] */
tree types;
/* [ WORD 8 ] */
gimple_seq handler;
};
/* GIMPLE_EH_FILTER */
struct GTY((tag("GSS_EH_FILTER")))
geh_filter : public gimple
{
/* [ WORD 1-6 ] : base class */
/* [ WORD 7 ]
Filter types. */
tree types;
/* [ WORD 8 ]
Failure actions. */
gimple_seq failure;
};
/* GIMPLE_EH_ELSE */
struct GTY((tag("GSS_EH_ELSE")))
geh_else : public gimple
{
/* [ WORD 1-6 ] : base class */
/* [ WORD 7,8 ] */
gimple_seq n_body, e_body;
};
/* GIMPLE_EH_MUST_NOT_THROW */
struct GTY((tag("GSS_EH_MNT")))
geh_mnt : public gimple
{
/* [ WORD 1-6 ] : base class */
/* [ WORD 7 ] Abort function decl. */
tree fndecl;
};
/* GIMPLE_PHI */
struct GTY((tag("GSS_PHI")))
gphi : public gimple
{
/* [ WORD 1-6 ] : base class */
/* [ WORD 7 ] */
unsigned capacity;
unsigned nargs;
/* [ WORD 8 ] */
tree result;
/* [ WORD 9 ] */
struct phi_arg_d GTY ((length ("%h.nargs"))) args[1];
};
/* GIMPLE_RESX, GIMPLE_EH_DISPATCH */
struct GTY((tag("GSS_EH_CTRL")))
gimple_statement_eh_ctrl : public gimple
{
/* [ WORD 1-6 ] : base class */
/* [ WORD 7 ]
Exception region number. */
int region;
};
struct GTY((tag("GSS_EH_CTRL")))
gresx : public gimple_statement_eh_ctrl
{
/* No extra fields; adds invariant:
stmt->code == GIMPLE_RESX. */
};
struct GTY((tag("GSS_EH_CTRL")))
geh_dispatch : public gimple_statement_eh_ctrl
{
/* No extra fields; adds invariant:
stmt->code == GIMPLE_EH_DISPATH. */
};
/* GIMPLE_TRY */
struct GTY((tag("GSS_TRY")))
gtry : public gimple
{
/* [ WORD 1-6 ] : base class */
/* [ WORD 7 ]
Expression to evaluate. */
gimple_seq eval;
/* [ WORD 8 ]
Cleanup expression. */
gimple_seq cleanup;
};
/* Kind of GIMPLE_TRY statements. */
enum gimple_try_flags
{
/* A try/catch. */
GIMPLE_TRY_CATCH = 1 << 0,
/* A try/finally. */
GIMPLE_TRY_FINALLY = 1 << 1,
GIMPLE_TRY_KIND = GIMPLE_TRY_CATCH | GIMPLE_TRY_FINALLY,
/* Analogous to TRY_CATCH_IS_CLEANUP. */
GIMPLE_TRY_CATCH_IS_CLEANUP = 1 << 2
};
/* GIMPLE_WITH_CLEANUP_EXPR */
struct GTY((tag("GSS_WCE")))
gimple_statement_wce : public gimple
{
/* [ WORD 1-6 ] : base class */
/* Subcode: CLEANUP_EH_ONLY. True if the cleanup should only be
executed if an exception is thrown, not on normal exit of its
scope. This flag is analogous to the CLEANUP_EH_ONLY flag
in TARGET_EXPRs. */
/* [ WORD 7 ]
Cleanup expression. */
gimple_seq cleanup;
};
/* GIMPLE_ASM */
struct GTY((tag("GSS_ASM")))
gasm : public gimple_statement_with_memory_ops_base
{
/* [ WORD 1-9 ] : base class */
/* [ WORD 10 ]
__asm__ statement. */
const char *string;
/* [ WORD 11 ]
Number of inputs, outputs, clobbers, labels. */
unsigned char ni;
unsigned char no;
unsigned char nc;
unsigned char nl;
/* [ WORD 12 ]
Operand vector. NOTE! This must always be the last field
of this structure. In particular, this means that this
structure cannot be embedded inside another one. */
tree GTY((length ("%h.num_ops"))) op[1];
};
/* GIMPLE_OMP_CRITICAL */
struct GTY((tag("GSS_OMP_CRITICAL")))
gomp_critical : public gimple_statement_omp
{
/* [ WORD 1-7 ] : base class */
/* [ WORD 8 ] */
tree clauses;
/* [ WORD 9 ]
Critical section name. */
tree name;
};
struct GTY(()) gimple_omp_for_iter {
/* Condition code. */
enum tree_code cond;
/* Index variable. */
tree index;
/* Initial value. */
tree initial;
/* Final value. */
tree final;
/* Increment. */
tree incr;
};
/* GIMPLE_OMP_FOR */
struct GTY((tag("GSS_OMP_FOR")))
gomp_for : public gimple_statement_omp
{
/* [ WORD 1-7 ] : base class */
/* [ WORD 8 ] */
tree clauses;
/* [ WORD 9 ]
Number of elements in iter array. */
size_t collapse;
/* [ WORD 10 ] */
struct gimple_omp_for_iter * GTY((length ("%h.collapse"))) iter;
/* [ WORD 11 ]
Pre-body evaluated before the loop body begins. */
gimple_seq pre_body;
};
/* GIMPLE_OMP_PARALLEL, GIMPLE_OMP_TARGET, GIMPLE_OMP_TASK, GIMPLE_OMP_TEAMS */
struct GTY((tag("GSS_OMP_PARALLEL_LAYOUT")))
gimple_statement_omp_parallel_layout : public gimple_statement_omp
{
/* [ WORD 1-7 ] : base class */
/* [ WORD 8 ]
Clauses. */
tree clauses;
/* [ WORD 9 ]
Child function holding the body of the parallel region. */
tree child_fn;
/* [ WORD 10 ]
Shared data argument. */
tree data_arg;
};
/* GIMPLE_OMP_PARALLEL or GIMPLE_TASK */
struct GTY((tag("GSS_OMP_PARALLEL_LAYOUT")))
gimple_statement_omp_taskreg : public gimple_statement_omp_parallel_layout
{
/* No extra fields; adds invariant:
stmt->code == GIMPLE_OMP_PARALLEL
|| stmt->code == GIMPLE_OMP_TASK
|| stmt->code == GIMPLE_OMP_TEAMS. */
};
/* GIMPLE_OMP_PARALLEL */
struct GTY((tag("GSS_OMP_PARALLEL_LAYOUT")))
gomp_parallel : public gimple_statement_omp_taskreg
{
/* No extra fields; adds invariant:
stmt->code == GIMPLE_OMP_PARALLEL. */
};
/* GIMPLE_OMP_TARGET */
struct GTY((tag("GSS_OMP_PARALLEL_LAYOUT")))
gomp_target : public gimple_statement_omp_parallel_layout
{
/* No extra fields; adds invariant:
stmt->code == GIMPLE_OMP_TARGET. */
};
/* GIMPLE_OMP_TASK */
struct GTY((tag("GSS_OMP_TASK")))
gomp_task : public gimple_statement_omp_taskreg
{
/* [ WORD 1-10 ] : base class */
/* [ WORD 11 ]
Child function holding firstprivate initialization if needed. */
tree copy_fn;
/* [ WORD 12-13 ]
Size and alignment in bytes of the argument data block. */
tree arg_size;
tree arg_align;
};
/* GIMPLE_OMP_SECTION */
/* Uses struct gimple_statement_omp. */
/* GIMPLE_OMP_SECTIONS */
struct GTY((tag("GSS_OMP_SECTIONS")))
gomp_sections : public gimple_statement_omp
{
/* [ WORD 1-7 ] : base class */
/* [ WORD 8 ] */
tree clauses;
/* [ WORD 9 ]
The control variable used for deciding which of the sections to
execute. */
tree control;
};
/* GIMPLE_OMP_CONTINUE.
Note: This does not inherit from gimple_statement_omp, because we
do not need the body field. */
struct GTY((tag("GSS_OMP_CONTINUE")))
gomp_continue : public gimple
{
/* [ WORD 1-6 ] : base class */
/* [ WORD 7 ] */
tree control_def;
/* [ WORD 8 ] */
tree control_use;
};
/* GIMPLE_OMP_SINGLE, GIMPLE_OMP_ORDERED, GIMPLE_OMP_TASKGROUP,
GIMPLE_OMP_SCAN. */
struct GTY((tag("GSS_OMP_SINGLE_LAYOUT")))
gimple_statement_omp_single_layout : public gimple_statement_omp
{
/* [ WORD 1-7 ] : base class */
/* [ WORD 8 ] */
tree clauses;
};
struct GTY((tag("GSS_OMP_SINGLE_LAYOUT")))
gomp_single : public gimple_statement_omp_single_layout
{
/* No extra fields; adds invariant:
stmt->code == GIMPLE_OMP_SINGLE. */
};
struct GTY((tag("GSS_OMP_PARALLEL_LAYOUT")))
gomp_teams : public gimple_statement_omp_taskreg
{
/* No extra fields; adds invariant:
stmt->code == GIMPLE_OMP_TEAMS. */
};
struct GTY((tag("GSS_OMP_SINGLE_LAYOUT")))
gomp_ordered : public gimple_statement_omp_single_layout
{
/* No extra fields; adds invariant:
stmt->code == GIMPLE_OMP_ORDERED. */
};
struct GTY((tag("GSS_OMP_SINGLE_LAYOUT")))
gomp_scan : public gimple_statement_omp_single_layout
{
/* No extra fields; adds invariant:
stmt->code == GIMPLE_OMP_SCAN. */
};
/* GIMPLE_OMP_ATOMIC_LOAD.
Note: This is based on gimple, not g_s_omp, because g_s_omp
contains a sequence, which we don't need here. */
struct GTY((tag("GSS_OMP_ATOMIC_LOAD")))
gomp_atomic_load : public gimple
{
/* [ WORD 1-6 ] : base class */
/* [ WORD 7-8 ] */
tree rhs, lhs;
};
/* GIMPLE_OMP_ATOMIC_STORE.
See note on GIMPLE_OMP_ATOMIC_LOAD. */
struct GTY((tag("GSS_OMP_ATOMIC_STORE_LAYOUT")))
gimple_statement_omp_atomic_store_layout : public gimple
{
/* [ WORD 1-6 ] : base class */
/* [ WORD 7 ] */
tree val;
};
struct GTY((tag("GSS_OMP_ATOMIC_STORE_LAYOUT")))
gomp_atomic_store :
public gimple_statement_omp_atomic_store_layout
{
/* No extra fields; adds invariant:
stmt->code == GIMPLE_OMP_ATOMIC_STORE. */
};
struct GTY((tag("GSS_OMP_ATOMIC_STORE_LAYOUT")))
gimple_statement_omp_return :
public gimple_statement_omp_atomic_store_layout
{
/* No extra fields; adds invariant:
stmt->code == GIMPLE_OMP_RETURN. */
};
/* GIMPLE_TRANSACTION. */
/* Bits to be stored in the GIMPLE_TRANSACTION subcode. */
/* The __transaction_atomic was declared [[outer]] or it is
__transaction_relaxed. */
#define GTMA_IS_OUTER (1u << 0)
#define GTMA_IS_RELAXED (1u << 1)
#define GTMA_DECLARATION_MASK (GTMA_IS_OUTER | GTMA_IS_RELAXED)
/* The transaction is seen to not have an abort. */
#define GTMA_HAVE_ABORT (1u << 2)
/* The transaction is seen to have loads or stores. */
#define GTMA_HAVE_LOAD (1u << 3)
#define GTMA_HAVE_STORE (1u << 4)
/* The transaction MAY enter serial irrevocable mode in its dynamic scope. */
#define GTMA_MAY_ENTER_IRREVOCABLE (1u << 5)
/* The transaction WILL enter serial irrevocable mode.
An irrevocable block post-dominates the entire transaction, such
that all invocations of the transaction will go serial-irrevocable.
In such case, we don't bother instrumenting the transaction, and
tell the runtime that it should begin the transaction in
serial-irrevocable mode. */
#define GTMA_DOES_GO_IRREVOCABLE (1u << 6)
/* The transaction contains no instrumentation code whatsover, most
likely because it is guaranteed to go irrevocable upon entry. */
#define GTMA_HAS_NO_INSTRUMENTATION (1u << 7)
struct GTY((tag("GSS_TRANSACTION")))
gtransaction : public gimple_statement_with_memory_ops_base
{
/* [ WORD 1-9 ] : base class */
/* [ WORD 10 ] */
gimple_seq body;
/* [ WORD 11-13 ] */
tree label_norm;
tree label_uninst;
tree label_over;
};
#define DEFGSSTRUCT(SYM, STRUCT, HAS_TREE_OP) SYM,
enum gimple_statement_structure_enum {
#include "gsstruct.def"
LAST_GSS_ENUM
};
#undef DEFGSSTRUCT
/* A statement with the invariant that
stmt->code == GIMPLE_COND
i.e. a conditional jump statement. */
struct GTY((tag("GSS_WITH_OPS")))
gcond : public gimple_statement_with_ops
{
/* no additional fields; this uses the layout for GSS_WITH_OPS. */
static const enum gimple_code code_ = GIMPLE_COND;
};
/* A statement with the invariant that
stmt->code == GIMPLE_DEBUG
i.e. a debug statement. */
struct GTY((tag("GSS_WITH_OPS")))
gdebug : public gimple_statement_with_ops
{
/* no additional fields; this uses the layout for GSS_WITH_OPS. */
};
/* A statement with the invariant that
stmt->code == GIMPLE_GOTO
i.e. a goto statement. */
struct GTY((tag("GSS_WITH_OPS")))
ggoto : public gimple_statement_with_ops
{
/* no additional fields; this uses the layout for GSS_WITH_OPS. */
};
/* A statement with the invariant that
stmt->code == GIMPLE_LABEL
i.e. a label statement. */
struct GTY((tag("GSS_WITH_OPS")))
glabel : public gimple_statement_with_ops
{
/* no additional fields; this uses the layout for GSS_WITH_OPS. */
};
/* A statement with the invariant that
stmt->code == GIMPLE_SWITCH
i.e. a switch statement. */
struct GTY((tag("GSS_WITH_OPS")))
gswitch : public gimple_statement_with_ops
{
/* no additional fields; this uses the layout for GSS_WITH_OPS. */
};
/* A statement with the invariant that
stmt->code == GIMPLE_ASSIGN
i.e. an assignment statement. */
struct GTY((tag("GSS_WITH_MEM_OPS")))
gassign : public gimple_statement_with_memory_ops
{
static const enum gimple_code code_ = GIMPLE_ASSIGN;
/* no additional fields; this uses the layout for GSS_WITH_MEM_OPS. */
};
/* A statement with the invariant that
stmt->code == GIMPLE_RETURN
i.e. a return statement. */
struct GTY((tag("GSS_WITH_MEM_OPS")))
greturn : public gimple_statement_with_memory_ops
{
/* no additional fields; this uses the layout for GSS_WITH_MEM_OPS. */
};
template <>
template <>
inline bool
is_a_helper <gasm *>::test (gimple *gs)
{
return gs->code == GIMPLE_ASM;
}
template <>
template <>
inline bool
is_a_helper <gassign *>::test (gimple *gs)
{
return gs->code == GIMPLE_ASSIGN;
}
template <>
template <>
inline bool
is_a_helper <const gassign *>::test (const gimple *gs)
{
return gs->code == GIMPLE_ASSIGN;
}
template <>
template <>
inline bool
is_a_helper <gbind *>::test (gimple *gs)
{
return gs->code == GIMPLE_BIND;
}
template <>
template <>
inline bool
is_a_helper <gcall *>::test (gimple *gs)
{
return gs->code == GIMPLE_CALL;
}
template <>
template <>
inline bool
is_a_helper <gcatch *>::test (gimple *gs)
{
return gs->code == GIMPLE_CATCH;
}
template <>
template <>
inline bool
is_a_helper <gcond *>::test (gimple *gs)
{
return gs->code == GIMPLE_COND;
}