Subversion Repositories QNX 8.QNX8 LLVM/Clang compiler suite

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
14 pmbaty 1
//===--- OMPKinds.def - OpenMP directives, clauses, rt-calls -*- C++ -*-===//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
/// \file
9
///
10
/// This file defines the list of supported OpenMP runtime
11
/// calls, and other things that need to be listed in enums.
12
///
13
/// This file is under transition to OMP.td with TableGen code generation.
14
///
15
//===----------------------------------------------------------------------===//
16
 
17
/// OpenMP Directives, combined directives and Clauses
18
/// - Moved to OMP.td
19
 
20
/// Types used in runtime structs or runtime functions
21
///
22
///{
23
 
24
#ifndef OMP_TYPE
25
#define OMP_TYPE(VarName, InitValue)
26
#endif
27
 
28
#define __OMP_TYPE(VarName) OMP_TYPE(VarName, Type::get##VarName##Ty(Ctx))
29
 
30
__OMP_TYPE(Void)
31
__OMP_TYPE(Int1)
32
__OMP_TYPE(Int8)
33
__OMP_TYPE(Int16)
34
__OMP_TYPE(Int32)
35
__OMP_TYPE(Int64)
36
__OMP_TYPE(Int8Ptr)
37
__OMP_TYPE(Int16Ptr)
38
__OMP_TYPE(Int32Ptr)
39
__OMP_TYPE(Int64Ptr)
40
__OMP_TYPE(Double)
41
 
42
OMP_TYPE(SizeTy, M.getDataLayout().getIntPtrType(Ctx))
43
OMP_TYPE(Int63, Type::getIntNTy(Ctx, 63))
44
 
45
#define __OMP_PTR_TYPE(NAME, BASE) OMP_TYPE(NAME, BASE->getPointerTo())
46
 
47
__OMP_PTR_TYPE(VoidPtr, Int8)
48
__OMP_PTR_TYPE(VoidPtrPtr, VoidPtr)
49
__OMP_PTR_TYPE(VoidPtrPtrPtr, VoidPtrPtr)
50
 
51
__OMP_PTR_TYPE(Int8PtrPtr, Int8Ptr)
52
__OMP_PTR_TYPE(Int8PtrPtrPtr, Int8PtrPtr)
53
 
54
#undef __OMP_PTR_TYPE
55
 
56
#undef __OMP_TYPE
57
#undef OMP_TYPE
58
 
59
///}
60
 
61
/// array types
62
///
63
///{
64
 
65
#ifndef OMP_ARRAY_TYPE
66
#define OMP_ARRAY_TYPE(VarName, ElemTy, ArraySize)
67
#endif
68
 
69
#define __OMP_ARRAY_TYPE(VarName, ElemTy, ArraySize)                           \
70
  OMP_ARRAY_TYPE(VarName, ElemTy, ArraySize)
71
 
72
__OMP_ARRAY_TYPE(KmpCriticalName, Int32, 8)
73
__OMP_ARRAY_TYPE(Int32Arr3, Int32, 3)
74
 
75
#undef __OMP_ARRAY_TYPE
76
#undef OMP_ARRAY_TYPE
77
 
78
///}
79
 
80
/// Struct and function types
81
///
82
///{
83
 
84
#ifndef OMP_STRUCT_TYPE
85
#define OMP_STRUCT_TYPE(VarName, StructName, Packed, ...)
86
#endif
87
 
88
#define __OMP_STRUCT_TYPE(VarName, Name, Packed, ...)                                  \
89
  OMP_STRUCT_TYPE(VarName, "struct." #Name, Packed, __VA_ARGS__)
90
 
91
__OMP_STRUCT_TYPE(Ident, ident_t, false, Int32, Int32, Int32, Int32, Int8Ptr)
92
__OMP_STRUCT_TYPE(OffloadEntry, __tgt_offload_entry, false, Int8Ptr, Int8Ptr, SizeTy,
93
                  Int32, Int32)
94
__OMP_STRUCT_TYPE(KernelArgs, __tgt_kernel_arguments, false, Int32, Int32, VoidPtrPtr,
95
		  VoidPtrPtr, Int64Ptr, Int64Ptr, VoidPtrPtr, VoidPtrPtr,
96
		  Int64, Int64, Int32Arr3Ty, Int32Arr3Ty, Int32)
97
__OMP_STRUCT_TYPE(AsyncInfo, __tgt_async_info, false, Int8Ptr)
98
__OMP_STRUCT_TYPE(DependInfo, kmp_dep_info, false, SizeTy, SizeTy, Int8)
99
 
100
#undef __OMP_STRUCT_TYPE
101
#undef OMP_STRUCT_TYPE
102
 
103
#ifndef OMP_FUNCTION_TYPE
104
#define OMP_FUNCTION_TYPE(VarName, IsVarArg, ReturnType, ...)
105
#endif
106
 
107
#define __OMP_FUNCTION_TYPE(VarName, IsVarArg, ReturnType, ...)                \
108
  OMP_FUNCTION_TYPE(VarName, IsVarArg, ReturnType, __VA_ARGS__)
109
 
110
__OMP_FUNCTION_TYPE(ParallelTask, true, Void, Int32Ptr, Int32Ptr)
111
__OMP_FUNCTION_TYPE(ReduceFunction, false, Void, VoidPtr, VoidPtr)
112
__OMP_FUNCTION_TYPE(CopyFunction, false, Void, VoidPtr, VoidPtr)
113
__OMP_FUNCTION_TYPE(KmpcCtor, false, VoidPtr, VoidPtr)
114
__OMP_FUNCTION_TYPE(KmpcDtor, false, Void, VoidPtr)
115
__OMP_FUNCTION_TYPE(KmpcCopyCtor, false, VoidPtr, VoidPtr, VoidPtr)
116
__OMP_FUNCTION_TYPE(TaskRoutineEntry, false, Int32, Int32,
117
                    /* kmp_task_t */ VoidPtr)
118
__OMP_FUNCTION_TYPE(ShuffleReduce, false, Void, VoidPtr, Int16, Int16, Int16)
119
__OMP_FUNCTION_TYPE(InterWarpCopy, false, Void, VoidPtr, Int32)
120
__OMP_FUNCTION_TYPE(GlobalList, false, Void, VoidPtr, Int32, VoidPtr)
121
 
122
#undef __OMP_FUNCTION_TYPE
123
#undef OMP_FUNCTION_TYPE
124
 
125
///}
126
 
127
/// Internal Control Variables information
128
///
129
///{
130
 
131
#ifndef ICV_INIT_VALUE
132
#define ICV_INIT_VALUE(Enum, Name)
133
#endif
134
 
135
#define __ICV_INIT_VALUE(Name) ICV_INIT_VALUE(ICV_##Name, #Name)
136
 
137
__ICV_INIT_VALUE(ZERO)
138
__ICV_INIT_VALUE(FALSE)
139
__ICV_INIT_VALUE(IMPLEMENTATION_DEFINED)
140
__ICV_INIT_VALUE(LAST)
141
 
142
#undef __ICV_INIT_VALUE
143
#undef ICV_INIT_VALUE
144
 
145
#ifndef ICV_DATA_ENV
146
#define ICV_DATA_ENV(Enum, Name, EnvVarName, Init)
147
#endif
148
 
149
#define __ICV_DATA_ENV(Name, EnvVarName, Init)                                 \
150
  ICV_DATA_ENV(ICV_##Name, #Name, #EnvVarName, Init)
151
 
152
__ICV_DATA_ENV(nthreads, OMP_NUM_THREADS, ICV_IMPLEMENTATION_DEFINED)
153
__ICV_DATA_ENV(active_levels, NONE, ICV_ZERO)
154
__ICV_DATA_ENV(cancel, OMP_CANCELLATION, ICV_FALSE)
155
__ICV_DATA_ENV(proc_bind, OMP_PROC_BIND, ICV_IMPLEMENTATION_DEFINED)
156
__ICV_DATA_ENV(__last, last, ICV_LAST)
157
 
158
#undef __ICV_DATA_ENV
159
#undef ICV_DATA_ENV
160
 
161
#ifndef ICV_RT_SET
162
#define ICV_RT_SET(Name, RTL)
163
#endif
164
 
165
#define __ICV_RT_SET(Name, RTL) ICV_RT_SET(ICV_##Name, OMPRTL_##RTL)
166
 
167
__ICV_RT_SET(nthreads, omp_set_num_threads)
168
 
169
#undef __ICV_RT_SET
170
#undef ICV_RT_SET
171
 
172
#ifndef ICV_RT_GET
173
#define ICV_RT_GET(Name, RTL)
174
#endif
175
 
176
#define __ICV_RT_GET(Name, RTL) ICV_RT_GET(ICV_##Name, OMPRTL_##RTL)
177
 
178
__ICV_RT_GET(nthreads, omp_get_max_threads)
179
__ICV_RT_GET(active_levels, omp_get_active_level)
180
__ICV_RT_GET(cancel, omp_get_cancellation)
181
__ICV_RT_GET(proc_bind, omp_get_proc_bind)
182
 
183
#undef __ICV_RT_GET
184
#undef ICV_RT_GET
185
 
186
///}
187
 
188
/// Runtime library function (and their attributes)
189
///
190
///{
191
 
192
#ifndef OMP_RTL
193
#define OMP_RTL(Enum, Str, IsVarArg, ReturnType, ...)
194
#endif
195
 
196
#define __OMP_RTL(Name, IsVarArg, ReturnType, ...)                             \
197
  OMP_RTL(OMPRTL_##Name, #Name, IsVarArg, ReturnType, __VA_ARGS__)
198
 
199
 
200
 
201
__OMP_RTL(__kmpc_barrier, false, Void, IdentPtr, Int32)
202
__OMP_RTL(__kmpc_cancel, false, Int32, IdentPtr, Int32, Int32)
203
__OMP_RTL(__kmpc_cancel_barrier, false, Int32, IdentPtr, Int32)
204
__OMP_RTL(__kmpc_error, false, Void, IdentPtr, Int32, Int8Ptr)
205
__OMP_RTL(__kmpc_flush, false, Void, IdentPtr)
206
__OMP_RTL(__kmpc_global_thread_num, false, Int32, IdentPtr)
207
__OMP_RTL(__kmpc_get_hardware_thread_id_in_block, false, Int32, )
208
__OMP_RTL(__kmpc_fork_call, true, Void, IdentPtr, Int32, ParallelTaskPtr)
209
__OMP_RTL(__kmpc_fork_call_if, false, Void, IdentPtr, Int32, ParallelTaskPtr,
210
          Int32, VoidPtr)
211
__OMP_RTL(__kmpc_omp_taskwait, false, Int32, IdentPtr, Int32)
212
__OMP_RTL(__kmpc_omp_taskyield, false, Int32, IdentPtr, Int32, /* Int */ Int32)
213
__OMP_RTL(__kmpc_push_num_threads, false, Void, IdentPtr, Int32,
214
          /* Int */ Int32)
215
__OMP_RTL(__kmpc_push_proc_bind, false, Void, IdentPtr, Int32, /* Int */ Int32)
216
__OMP_RTL(__kmpc_omp_reg_task_with_affinity, false, Int32, IdentPtr, Int32,
217
          /* kmp_task_t */ VoidPtr, Int32,
218
          /* kmp_task_affinity_info_t */ VoidPtr)
219
 
220
__OMP_RTL(__kmpc_get_hardware_num_blocks, false, Int32, )
221
__OMP_RTL(__kmpc_get_hardware_num_threads_in_block, false, Int32, )
222
__OMP_RTL(__kmpc_get_warp_size, false, Int32, )
223
 
224
__OMP_RTL(omp_get_thread_num, false, Int32, )
225
__OMP_RTL(omp_get_num_threads, false, Int32, )
226
__OMP_RTL(omp_get_max_threads, false, Int32, )
227
__OMP_RTL(omp_in_parallel, false, Int32, )
228
__OMP_RTL(omp_get_dynamic, false, Int32, )
229
__OMP_RTL(omp_get_cancellation, false, Int32, )
230
__OMP_RTL(omp_get_nested, false, Int32, )
231
__OMP_RTL(omp_get_schedule, false, Void, Int32Ptr, Int32Ptr)
232
__OMP_RTL(omp_get_thread_limit, false, Int32, )
233
__OMP_RTL(omp_get_supported_active_levels, false, Int32, )
234
__OMP_RTL(omp_get_max_active_levels, false, Int32, )
235
__OMP_RTL(omp_get_level, false, Int32, )
236
__OMP_RTL(omp_get_ancestor_thread_num, false, Int32, Int32)
237
__OMP_RTL(omp_get_team_size, false, Int32, Int32)
238
__OMP_RTL(omp_get_active_level, false, Int32, )
239
__OMP_RTL(omp_in_final, false, Int32, )
240
__OMP_RTL(omp_get_proc_bind, false, Int32, )
241
__OMP_RTL(omp_get_num_places, false, Int32, )
242
__OMP_RTL(omp_get_num_procs, false, Int32, )
243
__OMP_RTL(omp_get_place_proc_ids, false, Void, Int32, Int32Ptr)
244
__OMP_RTL(omp_get_place_num, false, Int32, )
245
__OMP_RTL(omp_get_partition_num_places, false, Int32, )
246
__OMP_RTL(omp_get_partition_place_nums, false, Void, Int32Ptr)
247
__OMP_RTL(omp_get_wtime, false, Double,)
248
 
249
__OMP_RTL(omp_set_num_threads, false, Void, Int32)
250
__OMP_RTL(omp_set_dynamic, false, Void, Int32)
251
__OMP_RTL(omp_set_nested, false, Void, Int32)
252
__OMP_RTL(omp_set_schedule, false, Void, Int32, Int32)
253
__OMP_RTL(omp_set_max_active_levels, false, Void, Int32)
254
 
255
__OMP_RTL(__kmpc_master, false, Int32, IdentPtr, Int32)
256
__OMP_RTL(__kmpc_end_master, false, Void, IdentPtr, Int32)
257
__OMP_RTL(__kmpc_masked, false, Int32, IdentPtr, Int32, Int32)
258
__OMP_RTL(__kmpc_end_masked, false, Void, IdentPtr, Int32)
259
__OMP_RTL(__kmpc_critical, false, Void, IdentPtr, Int32, KmpCriticalNamePtrTy)
260
__OMP_RTL(__kmpc_critical_with_hint, false, Void, IdentPtr, Int32,
261
          KmpCriticalNamePtrTy, Int32)
262
__OMP_RTL(__kmpc_end_critical, false, Void, IdentPtr, Int32,
263
          KmpCriticalNamePtrTy)
264
 
265
__OMP_RTL(__kmpc_begin, false, Void, IdentPtr, Int32)
266
__OMP_RTL(__kmpc_end, false, Void, IdentPtr)
267
 
268
__OMP_RTL(__kmpc_reduce, false, Int32, IdentPtr, Int32, Int32, SizeTy, VoidPtr,
269
          ReduceFunctionPtr, KmpCriticalNamePtrTy)
270
__OMP_RTL(__kmpc_reduce_nowait, false, Int32, IdentPtr, Int32, Int32, SizeTy,
271
          VoidPtr, ReduceFunctionPtr, KmpCriticalNamePtrTy)
272
__OMP_RTL(__kmpc_end_reduce, false, Void, IdentPtr, Int32, KmpCriticalNamePtrTy)
273
__OMP_RTL(__kmpc_end_reduce_nowait, false, Void, IdentPtr, Int32,
274
          KmpCriticalNamePtrTy)
275
 
276
__OMP_RTL(__kmpc_ordered, false, Void, IdentPtr, Int32)
277
__OMP_RTL(__kmpc_end_ordered, false, Void, IdentPtr, Int32)
278
 
279
__OMP_RTL(__kmpc_for_static_init_4, false, Void, IdentPtr, Int32, Int32,
280
          Int32Ptr, Int32Ptr, Int32Ptr, Int32Ptr, Int32, Int32)
281
__OMP_RTL(__kmpc_for_static_init_4u, false, Void, IdentPtr, Int32, Int32,
282
          Int32Ptr, Int32Ptr, Int32Ptr, Int32Ptr, Int32, Int32)
283
__OMP_RTL(__kmpc_for_static_init_8, false, Void, IdentPtr, Int32, Int32,
284
          Int32Ptr, Int64Ptr, Int64Ptr, Int64Ptr, Int64, Int64)
285
__OMP_RTL(__kmpc_for_static_init_8u, false, Void, IdentPtr, Int32, Int32,
286
          Int32Ptr, Int64Ptr, Int64Ptr, Int64Ptr, Int64, Int64)
287
__OMP_RTL(__kmpc_for_static_fini, false, Void, IdentPtr, Int32)
288
__OMP_RTL(__kmpc_distribute_static_init_4, false, Void, IdentPtr, Int32, Int32,
289
          Int32Ptr, Int32Ptr, Int32Ptr, Int32Ptr, Int32, Int32)
290
__OMP_RTL(__kmpc_distribute_static_init_4u, false, Void, IdentPtr, Int32, Int32,
291
          Int32Ptr, Int32Ptr, Int32Ptr, Int32Ptr, Int32, Int32)
292
__OMP_RTL(__kmpc_distribute_static_init_8, false, Void, IdentPtr, Int32, Int32,
293
          Int32Ptr, Int64Ptr, Int64Ptr, Int64Ptr, Int64, Int64)
294
__OMP_RTL(__kmpc_distribute_static_init_8u, false, Void, IdentPtr, Int32, Int32,
295
          Int32Ptr, Int64Ptr, Int64Ptr, Int64Ptr, Int64, Int64)
296
__OMP_RTL(__kmpc_distribute_static_fini, false, Void, IdentPtr, Int32)
297
__OMP_RTL(__kmpc_dist_dispatch_init_4, false, Void, IdentPtr, Int32, Int32,
298
          Int32Ptr, Int32, Int32, Int32, Int32)
299
__OMP_RTL(__kmpc_dist_dispatch_init_4u, false, Void, IdentPtr, Int32, Int32,
300
          Int32Ptr, Int32, Int32, Int32, Int32)
301
__OMP_RTL(__kmpc_dist_dispatch_init_8, false, Void, IdentPtr, Int32, Int32,
302
          Int32Ptr, Int64, Int64, Int64, Int64)
303
__OMP_RTL(__kmpc_dist_dispatch_init_8u, false, Void, IdentPtr, Int32, Int32,
304
          Int32Ptr, Int64, Int64, Int64, Int64)
305
__OMP_RTL(__kmpc_dispatch_init_4, false, Void, IdentPtr, Int32, Int32, Int32,
306
          Int32, Int32, Int32)
307
__OMP_RTL(__kmpc_dispatch_init_4u, false, Void, IdentPtr, Int32, Int32, Int32,
308
          Int32, Int32, Int32)
309
__OMP_RTL(__kmpc_dispatch_init_8, false, Void, IdentPtr, Int32, Int32, Int64,
310
          Int64, Int64, Int64)
311
__OMP_RTL(__kmpc_dispatch_init_8u, false, Void, IdentPtr, Int32, Int32, Int64,
312
          Int64, Int64, Int64)
313
__OMP_RTL(__kmpc_dispatch_next_4, false, Int32, IdentPtr, Int32, Int32Ptr,
314
          Int32Ptr, Int32Ptr, Int32Ptr)
315
__OMP_RTL(__kmpc_dispatch_next_4u, false, Int32, IdentPtr, Int32, Int32Ptr,
316
          Int32Ptr, Int32Ptr, Int32Ptr)
317
__OMP_RTL(__kmpc_dispatch_next_8, false, Int32, IdentPtr, Int32, Int32Ptr,
318
          Int64Ptr, Int64Ptr, Int64Ptr)
319
__OMP_RTL(__kmpc_dispatch_next_8u, false, Int32, IdentPtr, Int32, Int32Ptr,
320
          Int64Ptr, Int64Ptr, Int64Ptr)
321
__OMP_RTL(__kmpc_dispatch_fini_4, false, Void, IdentPtr, Int32)
322
__OMP_RTL(__kmpc_dispatch_fini_4u, false, Void, IdentPtr, Int32)
323
__OMP_RTL(__kmpc_dispatch_fini_8, false, Void, IdentPtr, Int32)
324
__OMP_RTL(__kmpc_dispatch_fini_8u, false, Void, IdentPtr, Int32)
325
__OMP_RTL(__kmpc_team_static_init_4, false, Void, IdentPtr, Int32, Int32Ptr,
326
          Int32Ptr, Int32Ptr, Int32Ptr, Int32, Int32)
327
__OMP_RTL(__kmpc_team_static_init_4u, false, Void, IdentPtr, Int32, Int32Ptr,
328
          Int32Ptr, Int32Ptr, Int32Ptr, Int32, Int32)
329
__OMP_RTL(__kmpc_team_static_init_8, false, Void, IdentPtr, Int32, Int32Ptr,
330
          Int64Ptr, Int64Ptr, Int64Ptr, Int64, Int64)
331
__OMP_RTL(__kmpc_team_static_init_8u, false, Void, IdentPtr, Int32, Int32Ptr,
332
          Int64Ptr, Int64Ptr, Int64Ptr, Int64, Int64)
333
__OMP_RTL(__kmpc_dist_for_static_init_4, false, Void, IdentPtr, Int32, Int32,
334
          Int32Ptr, Int32Ptr, Int32Ptr, Int32Ptr, Int32Ptr, Int32, Int32)
335
__OMP_RTL(__kmpc_dist_for_static_init_4u, false, Void, IdentPtr, Int32, Int32,
336
          Int32Ptr, Int32Ptr, Int32Ptr, Int32Ptr, Int32Ptr, Int32, Int32)
337
__OMP_RTL(__kmpc_dist_for_static_init_8, false, Void, IdentPtr, Int32, Int32,
338
          Int32Ptr, Int64Ptr, Int64Ptr, Int64Ptr, Int64Ptr, Int64, Int64)
339
__OMP_RTL(__kmpc_dist_for_static_init_8u, false, Void, IdentPtr, Int32, Int32,
340
          Int32Ptr, Int64Ptr, Int64Ptr, Int64Ptr, Int64Ptr, Int64, Int64)
341
 
342
__OMP_RTL(__kmpc_single, false, Int32, IdentPtr, Int32)
343
__OMP_RTL(__kmpc_end_single, false, Void, IdentPtr, Int32)
344
 
345
__OMP_RTL(__kmpc_omp_task_alloc, false, /* kmp_task_t */ VoidPtr, IdentPtr,
346
          Int32, Int32, SizeTy, SizeTy, TaskRoutineEntryPtr)
347
__OMP_RTL(__kmpc_omp_task, false, Int32, IdentPtr, Int32,
348
          /* kmp_task_t */ VoidPtr)
349
__OMP_RTL(__kmpc_end_taskgroup, false, Void, IdentPtr, Int32)
350
__OMP_RTL(__kmpc_taskgroup, false, Void, IdentPtr, Int32)
351
__OMP_RTL(__kmpc_omp_task_begin_if0, false, Void, IdentPtr, Int32,
352
          /* kmp_task_t */ VoidPtr)
353
__OMP_RTL(__kmpc_omp_task_complete_if0, false, Void, IdentPtr, Int32,
354
          /* kmp_tasK_t */ VoidPtr)
355
__OMP_RTL(__kmpc_omp_task_with_deps, false, Int32, IdentPtr, Int32,
356
          /* kmp_task_t */ VoidPtr, Int32,
357
          /* kmp_depend_info_t */ VoidPtr, Int32,
358
          /* kmp_depend_info_t */ VoidPtr)
359
__OMP_RTL(__kmpc_taskloop, false, Void, IdentPtr, /* Int */ Int32, VoidPtr,
360
          /* Int */ Int32, Int64Ptr, Int64Ptr, Int64, /* Int */ Int32,
361
          /* Int */ Int32, Int64, VoidPtr)
362
__OMP_RTL(__kmpc_omp_target_task_alloc, false, /* kmp_task_t */ VoidPtr,
363
          IdentPtr, Int32, Int32, SizeTy, SizeTy, TaskRoutineEntryPtr, Int64)
364
__OMP_RTL(__kmpc_taskred_modifier_init, false, /* kmp_taskgroup */ VoidPtr,
365
          IdentPtr, /* Int */ Int32, /* Int */ Int32, /* Int */ Int32, VoidPtr)
366
__OMP_RTL(__kmpc_taskred_init, false, /* kmp_taskgroup */ VoidPtr,
367
          /* Int */ Int32, /* Int */ Int32, VoidPtr)
368
__OMP_RTL(__kmpc_task_reduction_modifier_fini, false, Void, IdentPtr,
369
          /* Int */ Int32, /* Int */ Int32)
370
__OMP_RTL(__kmpc_task_reduction_get_th_data, false, VoidPtr, Int32, VoidPtr,
371
          VoidPtr)
372
__OMP_RTL(__kmpc_task_reduction_init, false, VoidPtr, Int32, Int32, VoidPtr)
373
__OMP_RTL(__kmpc_task_reduction_modifier_init, false, VoidPtr, VoidPtr, Int32,
374
          Int32, Int32, VoidPtr)
375
__OMP_RTL(__kmpc_proxy_task_completed_ooo, false, Void, VoidPtr)
376
 
377
__OMP_RTL(__kmpc_omp_wait_deps, false, Void, IdentPtr, Int32, Int32,
378
          /* kmp_depend_info_t */ VoidPtr, Int32, VoidPtr)
379
__OMP_RTL(__kmpc_omp_taskwait_deps_51, false, Void, IdentPtr, Int32, Int32,
380
          /* kmp_depend_info_t */ VoidPtr, Int32, VoidPtr, Int32)
381
__OMP_RTL(__kmpc_cancellationpoint, false, Int32, IdentPtr, Int32, Int32)
382
 
383
__OMP_RTL(__kmpc_fork_teams, true, Void, IdentPtr, Int32, ParallelTaskPtr)
384
__OMP_RTL(__kmpc_push_num_teams, false, Void, IdentPtr, Int32, Int32, Int32)
385
 
386
__OMP_RTL(__kmpc_copyprivate, false, Void, IdentPtr, Int32, SizeTy, VoidPtr,
387
          CopyFunctionPtr, Int32)
388
__OMP_RTL(__kmpc_threadprivate_cached, false, VoidPtr, IdentPtr, Int32, VoidPtr,
389
          SizeTy, VoidPtrPtrPtr)
390
__OMP_RTL(__kmpc_threadprivate_register, false, Void, IdentPtr, VoidPtr,
391
          KmpcCtorPtr, KmpcCopyCtorPtr, KmpcDtorPtr)
392
 
393
__OMP_RTL(__kmpc_doacross_init, false, Void, IdentPtr, Int32, Int32,
394
          /* kmp_dim */ VoidPtr)
395
__OMP_RTL(__kmpc_doacross_post, false, Void, IdentPtr, Int32, Int64Ptr)
396
__OMP_RTL(__kmpc_doacross_wait, false, Void, IdentPtr, Int32, Int64Ptr)
397
__OMP_RTL(__kmpc_doacross_fini, false, Void, IdentPtr, Int32)
398
 
399
__OMP_RTL(__kmpc_alloc, false, VoidPtr, /* Int */ Int32, SizeTy, VoidPtr)
400
__OMP_RTL(__kmpc_aligned_alloc, false, VoidPtr, /* Int */ Int32, SizeTy, SizeTy,
401
          VoidPtr)
402
__OMP_RTL(__kmpc_free, false, Void, /* Int */ Int32, VoidPtr, VoidPtr)
403
 
404
__OMP_RTL(__tgt_interop_init, false, Void, IdentPtr, Int32, VoidPtrPtr, Int32,
405
          Int32, Int64, VoidPtr, Int32)
406
__OMP_RTL(__tgt_interop_destroy, false, Void, IdentPtr, Int32, VoidPtrPtr,
407
          Int32, Int32, VoidPtr, Int32)
408
__OMP_RTL(__tgt_interop_use, false, Void, IdentPtr, Int32, VoidPtrPtr, Int32,
409
          Int32, VoidPtr, Int32)
410
 
411
__OMP_RTL(__kmpc_init_allocator, false, /* omp_allocator_handle_t */ VoidPtr,
412
          /* Int */ Int32, /* omp_memespace_handle_t */ VoidPtr,
413
          /* Int */ Int32, /* omp_alloctrait_t */ VoidPtr)
414
__OMP_RTL(__kmpc_destroy_allocator, false, Void, /* Int */ Int32,
415
          /* omp_allocator_handle_t */ VoidPtr)
416
 
417
__OMP_RTL(__kmpc_push_target_tripcount_mapper, false, Void, IdentPtr, Int64, Int64)
418
__OMP_RTL(__tgt_target_mapper, false, Int32, IdentPtr, Int64, VoidPtr, Int32, VoidPtrPtr,
419
          VoidPtrPtr, Int64Ptr, Int64Ptr, VoidPtrPtr, VoidPtrPtr)
420
__OMP_RTL(__tgt_target_nowait_mapper, false, Int32, IdentPtr, Int64, VoidPtr,
421
          Int32, VoidPtrPtr, VoidPtrPtr, Int64Ptr, Int64Ptr, VoidPtrPtr,
422
          VoidPtrPtr, Int32, VoidPtr, Int32, VoidPtr)
423
__OMP_RTL(__tgt_target_teams_mapper, false, Int32, IdentPtr, Int64, VoidPtr, Int32,
424
          VoidPtrPtr, VoidPtrPtr, Int64Ptr, Int64Ptr, VoidPtrPtr, VoidPtrPtr, Int32, Int32)
425
__OMP_RTL(__tgt_target_teams_nowait_mapper, false, Int32, IdentPtr, Int64,
426
          VoidPtr, Int32, VoidPtrPtr, VoidPtrPtr, Int64Ptr, Int64Ptr,
427
          VoidPtrPtr, VoidPtrPtr, Int32, Int32, Int32, VoidPtr, Int32, VoidPtr)
428
__OMP_RTL(__tgt_target_kernel, false, Int32, IdentPtr, Int64, Int32, Int32,
429
          VoidPtr, KernelArgsPtr)
430
__OMP_RTL(__tgt_target_kernel_nowait, false, Int32, IdentPtr, Int64, Int32,
431
          Int32, VoidPtr, KernelArgsPtr, Int32, VoidPtr, Int32, VoidPtr)
432
__OMP_RTL(__tgt_register_requires, false, Void, Int64)
433
__OMP_RTL(__tgt_target_data_begin_mapper, false, Void, IdentPtr, Int64, Int32, VoidPtrPtr,
434
          VoidPtrPtr, Int64Ptr, Int64Ptr, VoidPtrPtr, VoidPtrPtr)
435
__OMP_RTL(__tgt_target_data_begin_nowait_mapper, false, Void, IdentPtr, Int64, Int32,
436
          VoidPtrPtr, VoidPtrPtr, Int64Ptr, Int64Ptr, VoidPtrPtr, VoidPtrPtr)
437
__OMP_RTL(__tgt_target_data_begin_mapper_issue, false, Void, IdentPtr, Int64, Int32,
438
          VoidPtrPtr, VoidPtrPtr, Int64Ptr, Int64Ptr, VoidPtrPtr, VoidPtrPtr, AsyncInfoPtr)
439
__OMP_RTL(__tgt_target_data_begin_mapper_wait, false, Void, Int64, AsyncInfoPtr)
440
__OMP_RTL(__tgt_target_data_end_mapper, false, Void, IdentPtr, Int64, Int32, VoidPtrPtr,
441
          VoidPtrPtr, Int64Ptr, Int64Ptr, VoidPtrPtr, VoidPtrPtr)
442
__OMP_RTL(__tgt_target_data_end_nowait_mapper, false, Void, IdentPtr, Int64, Int32,
443
          VoidPtrPtr, VoidPtrPtr, Int64Ptr, Int64Ptr, VoidPtrPtr, VoidPtrPtr)
444
__OMP_RTL(__tgt_target_data_update_mapper, false, Void, IdentPtr, Int64, Int32,
445
          VoidPtrPtr, VoidPtrPtr, Int64Ptr, Int64Ptr, VoidPtrPtr, VoidPtrPtr)
446
__OMP_RTL(__tgt_target_data_update_nowait_mapper, false, Void, IdentPtr, Int64, Int32,
447
          VoidPtrPtr, VoidPtrPtr, Int64Ptr, Int64Ptr, VoidPtrPtr, VoidPtrPtr)
448
__OMP_RTL(__tgt_mapper_num_components, false, Int64, VoidPtr)
449
__OMP_RTL(__tgt_push_mapper_component, false, Void, VoidPtr, VoidPtr, VoidPtr,
450
          Int64, Int64, VoidPtr)
451
__OMP_RTL(__kmpc_task_allow_completion_event, false, VoidPtr, IdentPtr,
452
          /* Int */ Int32, /* kmp_task_t */ VoidPtr)
453
 
454
/// OpenMP Device runtime functions
455
__OMP_RTL(__kmpc_target_init, false, Int32, IdentPtr, Int8, Int1)
456
__OMP_RTL(__kmpc_target_deinit, false, Void, IdentPtr, Int8)
457
__OMP_RTL(__kmpc_kernel_prepare_parallel, false, Void, VoidPtr)
458
__OMP_RTL(__kmpc_parallel_51, false, Void, IdentPtr, Int32, Int32, Int32, Int32,
459
          VoidPtr, VoidPtr, VoidPtrPtr, SizeTy)
460
__OMP_RTL(__kmpc_kernel_parallel, false, Int1, VoidPtrPtr)
461
__OMP_RTL(__kmpc_kernel_end_parallel, false, Void, )
462
__OMP_RTL(__kmpc_serialized_parallel, false, Void, IdentPtr, Int32)
463
__OMP_RTL(__kmpc_end_serialized_parallel, false, Void, IdentPtr, Int32)
464
__OMP_RTL(__kmpc_shuffle_int32, false, Int32, Int32, Int16, Int16)
465
__OMP_RTL(__kmpc_nvptx_parallel_reduce_nowait_v2, false, Int32, IdentPtr, Int32,
466
          Int32, SizeTy, VoidPtr, ShuffleReducePtr, InterWarpCopyPtr)
467
__OMP_RTL(__kmpc_nvptx_end_reduce_nowait, false, Void, Int32)
468
__OMP_RTL(__kmpc_nvptx_teams_reduce_nowait_v2, false, Int32, IdentPtr, Int32,
469
          VoidPtr, Int32, VoidPtr, ShuffleReducePtr, InterWarpCopyPtr,
470
          GlobalListPtr, GlobalListPtr, GlobalListPtr, GlobalListPtr)
471
 
472
__OMP_RTL(__kmpc_shuffle_int64, false, Int64, Int64, Int16, Int16)
473
 
474
__OMP_RTL(__kmpc_alloc_shared, false, VoidPtr, SizeTy)
475
__OMP_RTL(__kmpc_free_shared, false, Void, VoidPtr, SizeTy)
476
__OMP_RTL(__kmpc_begin_sharing_variables, false, Void, VoidPtrPtrPtr, SizeTy)
477
__OMP_RTL(__kmpc_end_sharing_variables, false, Void, )
478
__OMP_RTL(__kmpc_get_shared_variables, false, Void, VoidPtrPtrPtr)
479
__OMP_RTL(__kmpc_parallel_level, false, Int16, IdentPtr, Int32)
480
__OMP_RTL(__kmpc_is_spmd_exec_mode, false, Int8, )
481
__OMP_RTL(__kmpc_barrier_simple_spmd, false, Void, IdentPtr, Int32)
482
__OMP_RTL(__kmpc_barrier_simple_generic, false, Void, IdentPtr, Int32)
483
 
484
__OMP_RTL(__kmpc_warp_active_thread_mask, false, Int64,)
485
__OMP_RTL(__kmpc_syncwarp, false, Void, Int64)
486
 
487
__OMP_RTL(__last, false, Void, )
488
 
489
#undef __OMP_RTL
490
#undef OMP_RTL
491
 
492
#define ParamAttrs(...) ArrayRef<AttributeSet>({__VA_ARGS__})
493
#define EnumAttr(Kind) Attribute::get(Ctx, Attribute::AttrKind::Kind)
494
#define EnumAttrInt(Kind, N) Attribute::get(Ctx, Attribute::AttrKind::Kind, N)
495
#define AllocSizeAttr(N, M) Attribute::getWithAllocSizeArgs(Ctx, N, M)
496
#define MemoryAttr(ME) Attribute::getWithMemoryEffects(Ctx, ME)
497
#define AttributeSet(...)                                                      \
498
  AttributeSet::get(Ctx, ArrayRef<Attribute>({__VA_ARGS__}))
499
 
500
#ifndef OMP_ATTRS_SET
501
#define OMP_ATTRS_SET(VarName, AttrSet)
502
#endif
503
 
504
#define __OMP_ATTRS_SET(VarName, AttrSet) OMP_ATTRS_SET(VarName, AttrSet)
505
 
506
__OMP_ATTRS_SET(
507
    GetterAttrs,
508
    OptimisticAttributes
509
        ? AttributeSet(
510
              EnumAttr(NoUnwind), EnumAttr(NoSync), EnumAttr(NoFree),
511
              EnumAttr(WillReturn),
512
              MemoryAttr(MemoryEffects::inaccessibleMemOnly(ModRefInfo::Ref)))
513
        : AttributeSet(EnumAttr(NoUnwind)))
514
__OMP_ATTRS_SET(
515
    GetterArgWriteAttrs,
516
    OptimisticAttributes
517
        ? AttributeSet(EnumAttr(NoUnwind), EnumAttr(NoSync), EnumAttr(NoFree),
518
                       EnumAttr(WillReturn),
519
                       MemoryAttr(MemoryEffects::inaccessibleOrArgMemOnly()))
520
        : AttributeSet(EnumAttr(NoUnwind)))
521
__OMP_ATTRS_SET(
522
  SetterAttrs,
523
  OptimisticAttributes
524
      ? AttributeSet(
525
            EnumAttr(NoUnwind), EnumAttr(NoSync), EnumAttr(NoFree),
526
            EnumAttr(WillReturn),
527
            MemoryAttr(MemoryEffects::inaccessibleMemOnly(ModRefInfo::Mod)))
528
      : AttributeSet(EnumAttr(NoUnwind)))
529
 
530
__OMP_ATTRS_SET(DefaultAttrs,
531
                OptimisticAttributes
532
                    ? AttributeSet(EnumAttr(NoUnwind), EnumAttr(NoSync),
533
                                   EnumAttr(WillReturn), EnumAttr(NoFree))
534
                    : AttributeSet(EnumAttr(NoUnwind)))
535
 
536
__OMP_ATTRS_SET(BarrierAttrs,
537
                OptimisticAttributes
538
                    ? AttributeSet(EnumAttr(NoUnwind), EnumAttr(Convergent))
539
                    : AttributeSet(EnumAttr(NoUnwind), EnumAttr(Convergent)))
540
 
541
__OMP_ATTRS_SET(
542
    InaccessibleArgOnlyAttrs,
543
    OptimisticAttributes
544
         ? AttributeSet(EnumAttr(NoUnwind), EnumAttr(NoSync), EnumAttr(NoFree),
545
                        EnumAttr(WillReturn),
546
                        MemoryAttr(MemoryEffects::inaccessibleOrArgMemOnly()))
547
         : AttributeSet(EnumAttr(NoUnwind)))
548
 
549
__OMP_ATTRS_SET(AlwaysInlineAttrs,
550
                OptimisticAttributes
551
                    ? AttributeSet(EnumAttr(AlwaysInline))
552
                    : AttributeSet(EnumAttr(AlwaysInline)))
553
 
554
#if 0
555
__OMP_ATTRS_SET(
556
    InaccessibleOnlyAttrs,
557
    OptimisticAttributes
558
        ? AttributeSet(EnumAttr(NoUnwind), EnumAttr(NoSync), EnumAttr(NoFree),
559
                       EnumAttr(WillReturn),
560
                       MemoryAttr(MemoryEffects::inaccessibleMemOnly()))
561
        : AttributeSet(EnumAttr(NoUnwind)))
562
#endif
563
 
564
__OMP_ATTRS_SET(AllocAttrs,
565
                OptimisticAttributes
566
                    ? AttributeSet(EnumAttr(NoUnwind), EnumAttr(NoSync),
567
                                   EnumAttr(WillReturn))
568
                    : AttributeSet(EnumAttr(NoUnwind)))
569
 
570
__OMP_ATTRS_SET(ForkAttrs, OptimisticAttributes
571
                               ? AttributeSet(EnumAttr(NoUnwind))
572
                               : AttributeSet(EnumAttr(NoUnwind)))
573
 
574
__OMP_ATTRS_SET(ReadOnlyPtrAttrs,
575
                OptimisticAttributes
576
                    ? AttributeSet(EnumAttr(ReadOnly), EnumAttr(NoFree),
577
                                   EnumAttr(NoCapture))
578
                    : AttributeSet())
579
 
580
__OMP_ATTRS_SET(DeviceAllocAttrs,
581
                OptimisticAttributes
582
                    ? AttributeSet(EnumAttr(NoUnwind), EnumAttr(NoSync))
583
                    : AttributeSet(EnumAttr(NoUnwind), EnumAttr(NoSync)))
584
 
585
#if 0
586
__OMP_ATTRS_SET(WriteOnlyPtrAttrs,
587
                OptimisticAttributes
588
                    ? AttributeSet(EnumAttr(WriteOnly), EnumAttr(NoFree),
589
                                   EnumAttr(NoCapture))
590
                    : AttributeSet())
591
#endif
592
 
593
__OMP_ATTRS_SET(ArgPtrAttrs,
594
                OptimisticAttributes
595
                    ? AttributeSet(EnumAttr(NoCapture), EnumAttr(NoFree))
596
                    : AttributeSet())
597
 
598
__OMP_ATTRS_SET(ReturnPtrAttrs,
599
                OptimisticAttributes
600
                    ? AttributeSet(EnumAttr(NoAlias))
601
                    : AttributeSet())
602
 
603
__OMP_ATTRS_SET(ZExt, AttributeSet(EnumAttr(ZExt)))
604
__OMP_ATTRS_SET(SExt, AttributeSet(EnumAttr(SExt)))
605
__OMP_ATTRS_SET(SizeTyExt,
606
                M.getDataLayout().getIntPtrType(Ctx)->getBitWidth() < 64
607
                    ? AttributeSet(EnumAttr(ZExt))
608
                    : AttributeSet())
609
 
610
#if 0
611
__OMP_ATTRS_SET(ReturnAlignedPtrAttrs,
612
                OptimisticAttributes
613
                    ? AttributeSet(EnumAttr(NoAlias), EnumAttrInt(Alignment, 8),
614
                                   EnumAttrInt(DereferenceableOrNull, 8))
615
                    : AttributeSet())
616
#endif
617
 
618
#undef __OMP_ATTRS_SET
619
#undef OMP_ATTRS_SET
620
 
621
#ifndef OMP_RTL_ATTRS
622
#define OMP_RTL_ATTRS(Enum, FnAttrSet, RetAttrSet, ArgAttrSets)
623
#endif
624
 
625
#define __OMP_RTL_ATTRS(Name, FnAttrSet, RetAttrSet, ArgAttrSets)              \
626
  OMP_RTL_ATTRS(OMPRTL_##Name, FnAttrSet, RetAttrSet, ArgAttrSets)
627
 
628
__OMP_RTL_ATTRS(__kmpc_barrier, BarrierAttrs, AttributeSet(),
629
                ParamAttrs(ReadOnlyPtrAttrs, SExt))
630
__OMP_RTL_ATTRS(__kmpc_barrier_simple_spmd, BarrierAttrs, AttributeSet(),
631
                ParamAttrs(ReadOnlyPtrAttrs, SExt))
632
__OMP_RTL_ATTRS(__kmpc_barrier_simple_generic, BarrierAttrs, AttributeSet(),
633
                ParamAttrs(ReadOnlyPtrAttrs, SExt))
634
__OMP_RTL_ATTRS(__kmpc_warp_active_thread_mask, BarrierAttrs, AttributeSet(),
635
                ParamAttrs())
636
__OMP_RTL_ATTRS(__kmpc_syncwarp, BarrierAttrs, AttributeSet(), ParamAttrs())
637
__OMP_RTL_ATTRS(__kmpc_cancel, InaccessibleArgOnlyAttrs, SExt,
638
                ParamAttrs(ReadOnlyPtrAttrs, SExt, SExt))
639
__OMP_RTL_ATTRS(__kmpc_cancel_barrier, BarrierAttrs, SExt,
640
                ParamAttrs(ReadOnlyPtrAttrs, SExt))
641
__OMP_RTL_ATTRS(__kmpc_error, AttributeSet(), AttributeSet(),
642
                ParamAttrs(AttributeSet(), SExt))
643
__OMP_RTL_ATTRS(__kmpc_flush, BarrierAttrs, AttributeSet(),
644
                ParamAttrs(ReadOnlyPtrAttrs))
645
__OMP_RTL_ATTRS(__kmpc_global_thread_num, GetterAttrs, SExt,
646
                ParamAttrs(ReadOnlyPtrAttrs))
647
__OMP_RTL_ATTRS(__kmpc_get_hardware_thread_id_in_block, GetterAttrs, ZExt,
648
                ParamAttrs())
649
__OMP_RTL_ATTRS(__kmpc_fork_call, ForkAttrs, AttributeSet(),
650
                ParamAttrs(ReadOnlyPtrAttrs, SExt, ReadOnlyPtrAttrs))
651
__OMP_RTL_ATTRS(__kmpc_fork_call_if, AttributeSet(), AttributeSet(),
652
                ParamAttrs(ReadOnlyPtrAttrs, SExt, ReadOnlyPtrAttrs, SExt))
653
__OMP_RTL_ATTRS(__kmpc_omp_taskwait, BarrierAttrs, SExt,
654
                ParamAttrs(ReadOnlyPtrAttrs, SExt))
655
__OMP_RTL_ATTRS(__kmpc_omp_taskyield, InaccessibleArgOnlyAttrs, SExt,
656
                ParamAttrs(ReadOnlyPtrAttrs, SExt, SExt))
657
__OMP_RTL_ATTRS(__kmpc_push_num_threads, InaccessibleArgOnlyAttrs,
658
                AttributeSet(), ParamAttrs(ReadOnlyPtrAttrs, SExt, SExt))
659
__OMP_RTL_ATTRS(__kmpc_push_proc_bind, InaccessibleArgOnlyAttrs, AttributeSet(),
660
                ParamAttrs(ReadOnlyPtrAttrs, SExt, SExt))
661
__OMP_RTL_ATTRS(__kmpc_omp_reg_task_with_affinity, DefaultAttrs, SExt,
662
                ParamAttrs(ReadOnlyPtrAttrs, SExt, ReadOnlyPtrAttrs,
663
                           SExt, ReadOnlyPtrAttrs))
664
 
665
__OMP_RTL_ATTRS(__kmpc_get_hardware_num_blocks, GetterAttrs, ZExt, ParamAttrs())
666
__OMP_RTL_ATTRS(__kmpc_get_hardware_num_threads_in_block, GetterAttrs, ZExt, ParamAttrs())
667
__OMP_RTL_ATTRS(__kmpc_get_warp_size, GetterAttrs, ZExt, ParamAttrs())
668
 
669
__OMP_RTL_ATTRS(omp_get_thread_num, GetterAttrs, SExt, ParamAttrs())
670
__OMP_RTL_ATTRS(omp_get_num_threads, GetterAttrs, SExt, ParamAttrs())
671
__OMP_RTL_ATTRS(omp_get_max_threads, GetterAttrs, SExt, ParamAttrs())
672
__OMP_RTL_ATTRS(omp_in_parallel, GetterAttrs, SExt, ParamAttrs())
673
__OMP_RTL_ATTRS(omp_get_dynamic, GetterAttrs, SExt, ParamAttrs())
674
__OMP_RTL_ATTRS(omp_get_cancellation, GetterAttrs, SExt, ParamAttrs())
675
__OMP_RTL_ATTRS(omp_get_nested, GetterAttrs, SExt, ParamAttrs())
676
__OMP_RTL_ATTRS(
677
    omp_get_schedule, GetterArgWriteAttrs, AttributeSet(),
678
    ParamAttrs(AttributeSet(EnumAttr(NoCapture), EnumAttr(WriteOnly)),
679
               AttributeSet(EnumAttr(NoCapture), EnumAttr(WriteOnly))))
680
__OMP_RTL_ATTRS(omp_get_thread_limit, GetterAttrs, SExt, ParamAttrs())
681
__OMP_RTL_ATTRS(omp_get_supported_active_levels, GetterAttrs, SExt, ParamAttrs())
682
__OMP_RTL_ATTRS(omp_get_max_active_levels, GetterAttrs, SExt, ParamAttrs())
683
__OMP_RTL_ATTRS(omp_get_level, GetterAttrs, SExt, ParamAttrs())
684
__OMP_RTL_ATTRS(omp_get_ancestor_thread_num, GetterAttrs, SExt, ParamAttrs(SExt))
685
__OMP_RTL_ATTRS(omp_get_team_size, GetterAttrs, SExt, ParamAttrs(SExt))
686
__OMP_RTL_ATTRS(omp_get_active_level, GetterAttrs, SExt, ParamAttrs())
687
__OMP_RTL_ATTRS(omp_in_final, GetterAttrs, SExt, ParamAttrs())
688
__OMP_RTL_ATTRS(omp_get_proc_bind, GetterAttrs, SExt, ParamAttrs())
689
__OMP_RTL_ATTRS(omp_get_num_places, GetterAttrs, SExt, ParamAttrs())
690
__OMP_RTL_ATTRS(omp_get_num_procs, GetterAttrs, SExt, ParamAttrs())
691
__OMP_RTL_ATTRS(omp_get_place_proc_ids, GetterArgWriteAttrs, AttributeSet(),
692
                ParamAttrs(SExt, AttributeSet(EnumAttr(NoCapture),
693
                                              EnumAttr(WriteOnly))))
694
__OMP_RTL_ATTRS(omp_get_place_num, GetterAttrs, SExt, ParamAttrs())
695
__OMP_RTL_ATTRS(omp_get_partition_num_places, GetterAttrs, SExt, ParamAttrs())
696
__OMP_RTL_ATTRS(omp_get_partition_place_nums, GetterAttrs, AttributeSet(),
697
                ParamAttrs())
698
__OMP_RTL_ATTRS(omp_get_wtime, GetterArgWriteAttrs, AttributeSet(), ParamAttrs())
699
 
700
__OMP_RTL_ATTRS(omp_set_num_threads, SetterAttrs, AttributeSet(),
701
                ParamAttrs(SExt))
702
__OMP_RTL_ATTRS(omp_set_dynamic, SetterAttrs, AttributeSet(), ParamAttrs(SExt))
703
__OMP_RTL_ATTRS(omp_set_nested, SetterAttrs, AttributeSet(), ParamAttrs(SExt))
704
__OMP_RTL_ATTRS(omp_set_schedule, SetterAttrs, AttributeSet(),
705
                ParamAttrs(SExt, SExt))
706
__OMP_RTL_ATTRS(omp_set_max_active_levels, SetterAttrs, AttributeSet(),
707
                ParamAttrs(SExt))
708
 
709
__OMP_RTL_ATTRS(__kmpc_master, InaccessibleArgOnlyAttrs, SExt,
710
                ParamAttrs(ReadOnlyPtrAttrs, SExt))
711
__OMP_RTL_ATTRS(__kmpc_end_master, InaccessibleArgOnlyAttrs, AttributeSet(),
712
                ParamAttrs(ReadOnlyPtrAttrs, SExt))
713
__OMP_RTL_ATTRS(__kmpc_masked, InaccessibleArgOnlyAttrs, SExt,
714
                ParamAttrs(ReadOnlyPtrAttrs, SExt, SExt))
715
__OMP_RTL_ATTRS(__kmpc_end_masked, InaccessibleArgOnlyAttrs, AttributeSet(),
716
                ParamAttrs(ReadOnlyPtrAttrs, SExt))
717
__OMP_RTL_ATTRS(__kmpc_critical, BarrierAttrs, AttributeSet(),
718
                ParamAttrs(ReadOnlyPtrAttrs, SExt, AttributeSet()))
719
__OMP_RTL_ATTRS(__kmpc_critical_with_hint, BarrierAttrs, AttributeSet(),
720
                ParamAttrs(ReadOnlyPtrAttrs, SExt, AttributeSet(), ZExt))
721
__OMP_RTL_ATTRS(__kmpc_end_critical, BarrierAttrs, AttributeSet(),
722
                ParamAttrs(ReadOnlyPtrAttrs, SExt, AttributeSet()))
723
 
724
__OMP_RTL_ATTRS(__kmpc_begin, DefaultAttrs, AttributeSet(),
725
                ParamAttrs(ReadOnlyPtrAttrs, SExt))
726
__OMP_RTL_ATTRS(__kmpc_end, DefaultAttrs, AttributeSet(),
727
                ParamAttrs(ReadOnlyPtrAttrs))
728
 
729
__OMP_RTL_ATTRS(__kmpc_reduce, BarrierAttrs, SExt,
730
                ParamAttrs(ReadOnlyPtrAttrs, SExt, SExt, SizeTyExt,
731
                           ReadOnlyPtrAttrs, AttributeSet()))
732
__OMP_RTL_ATTRS(__kmpc_reduce_nowait, BarrierAttrs, SExt,
733
                ParamAttrs(ReadOnlyPtrAttrs, SExt, SExt, SizeTyExt,
734
                           ReadOnlyPtrAttrs, AttributeSet()))
735
__OMP_RTL_ATTRS(__kmpc_end_reduce, BarrierAttrs, AttributeSet(),
736
                ParamAttrs(ReadOnlyPtrAttrs, SExt, AttributeSet()))
737
__OMP_RTL_ATTRS(__kmpc_end_reduce_nowait, BarrierAttrs, AttributeSet(),
738
                ParamAttrs(ReadOnlyPtrAttrs, SExt, AttributeSet()))
739
 
740
__OMP_RTL_ATTRS(__kmpc_ordered, BarrierAttrs, AttributeSet(),
741
                ParamAttrs(ReadOnlyPtrAttrs, SExt))
742
__OMP_RTL_ATTRS(__kmpc_end_ordered, BarrierAttrs, AttributeSet(),
743
                ParamAttrs(ReadOnlyPtrAttrs, SExt))
744
 
745
__OMP_RTL_ATTRS(__kmpc_for_static_init_4, GetterArgWriteAttrs, AttributeSet(),
746
                ParamAttrs(ReadOnlyPtrAttrs, SExt, SExt, ArgPtrAttrs,
747
                           ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs, SExt, SExt))
748
__OMP_RTL_ATTRS(__kmpc_for_static_init_4u, GetterArgWriteAttrs, AttributeSet(),
749
                ParamAttrs(ReadOnlyPtrAttrs, SExt, SExt, ArgPtrAttrs,
750
                           ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs, SExt, SExt))
751
__OMP_RTL_ATTRS(__kmpc_for_static_init_8, GetterArgWriteAttrs, AttributeSet(),
752
                ParamAttrs(ReadOnlyPtrAttrs, SExt, SExt, ArgPtrAttrs,
753
                           ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs,
754
                           AttributeSet(), AttributeSet()))
755
__OMP_RTL_ATTRS(__kmpc_for_static_init_8u, GetterArgWriteAttrs, AttributeSet(),
756
                ParamAttrs(ReadOnlyPtrAttrs, SExt, SExt, ArgPtrAttrs,
757
                           ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs,
758
                           AttributeSet(), AttributeSet()))
759
__OMP_RTL_ATTRS(__kmpc_for_static_fini, InaccessibleArgOnlyAttrs,
760
                AttributeSet(), ParamAttrs(ReadOnlyPtrAttrs, SExt))
761
__OMP_RTL_ATTRS(__kmpc_distribute_static_init_4, GetterArgWriteAttrs,
762
                AttributeSet(),
763
                ParamAttrs(ReadOnlyPtrAttrs, SExt, SExt, ArgPtrAttrs,
764
                           ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs, SExt, SExt))
765
__OMP_RTL_ATTRS(__kmpc_distribute_static_init_4u, GetterArgWriteAttrs,
766
                AttributeSet(),
767
                ParamAttrs(ReadOnlyPtrAttrs, SExt, SExt, ArgPtrAttrs,
768
                           ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs, SExt, SExt))
769
__OMP_RTL_ATTRS(__kmpc_distribute_static_init_8, GetterArgWriteAttrs,
770
                AttributeSet(),
771
                ParamAttrs(ReadOnlyPtrAttrs, SExt, SExt, ArgPtrAttrs,
772
                           ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs,
773
                           AttributeSet(), AttributeSet()))
774
__OMP_RTL_ATTRS(__kmpc_distribute_static_init_8u, GetterArgWriteAttrs,
775
                AttributeSet(),
776
                ParamAttrs(ReadOnlyPtrAttrs, SExt, SExt, ArgPtrAttrs,
777
                           ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs,
778
                           AttributeSet(), AttributeSet()))
779
__OMP_RTL_ATTRS(__kmpc_distribute_static_fini, InaccessibleArgOnlyAttrs,
780
                AttributeSet(), ParamAttrs(ReadOnlyPtrAttrs, SExt))
781
__OMP_RTL_ATTRS(__kmpc_dist_dispatch_init_4, GetterArgWriteAttrs,
782
                AttributeSet(),
783
                ParamAttrs(ReadOnlyPtrAttrs, SExt, SExt, ArgPtrAttrs, SExt,
784
                           SExt, SExt, SExt))
785
__OMP_RTL_ATTRS(__kmpc_dist_dispatch_init_4u, GetterArgWriteAttrs,
786
                AttributeSet(),
787
                ParamAttrs(ReadOnlyPtrAttrs, SExt, SExt, ArgPtrAttrs, ZExt,
788
                           ZExt, SExt, SExt))
789
__OMP_RTL_ATTRS(__kmpc_dist_dispatch_init_8, GetterArgWriteAttrs,
790
                AttributeSet(),
791
                ParamAttrs(ReadOnlyPtrAttrs, SExt, SExt, ArgPtrAttrs))
792
__OMP_RTL_ATTRS(__kmpc_dist_dispatch_init_8u, GetterArgWriteAttrs,
793
                AttributeSet(),
794
                ParamAttrs(ReadOnlyPtrAttrs, SExt, SExt, ArgPtrAttrs))
795
__OMP_RTL_ATTRS(__kmpc_dispatch_init_4, GetterArgWriteAttrs, AttributeSet(),
796
                ParamAttrs(ReadOnlyPtrAttrs, SExt, SExt, SExt, SExt, SExt, SExt))
797
__OMP_RTL_ATTRS(__kmpc_dispatch_init_4u, GetterArgWriteAttrs, AttributeSet(),
798
                ParamAttrs(ReadOnlyPtrAttrs, SExt, SExt, ZExt, ZExt, SExt, SExt))
799
__OMP_RTL_ATTRS(__kmpc_dispatch_init_8, GetterArgWriteAttrs, AttributeSet(),
800
                ParamAttrs(ReadOnlyPtrAttrs, SExt, SExt))
801
__OMP_RTL_ATTRS(__kmpc_dispatch_init_8u, GetterArgWriteAttrs, AttributeSet(),
802
                ParamAttrs(ReadOnlyPtrAttrs, SExt, SExt))
803
__OMP_RTL_ATTRS(__kmpc_dispatch_next_4, GetterArgWriteAttrs, SExt,
804
                ParamAttrs(ReadOnlyPtrAttrs, SExt, ArgPtrAttrs, ArgPtrAttrs,
805
                           ArgPtrAttrs, ArgPtrAttrs))
806
__OMP_RTL_ATTRS(__kmpc_dispatch_next_4u, GetterArgWriteAttrs, SExt,
807
                ParamAttrs(ReadOnlyPtrAttrs, SExt, ArgPtrAttrs, ArgPtrAttrs,
808
                           ArgPtrAttrs, ArgPtrAttrs))
809
__OMP_RTL_ATTRS(__kmpc_dispatch_next_8, GetterArgWriteAttrs, SExt,
810
                ParamAttrs(ReadOnlyPtrAttrs, SExt, ArgPtrAttrs, ArgPtrAttrs,
811
                           ArgPtrAttrs, ArgPtrAttrs))
812
__OMP_RTL_ATTRS(__kmpc_dispatch_next_8u, GetterArgWriteAttrs, SExt,
813
                ParamAttrs(ReadOnlyPtrAttrs, SExt, ArgPtrAttrs, ArgPtrAttrs,
814
                           ArgPtrAttrs, ArgPtrAttrs))
815
__OMP_RTL_ATTRS(__kmpc_dispatch_fini_4, InaccessibleArgOnlyAttrs,
816
                AttributeSet(), ParamAttrs(ReadOnlyPtrAttrs, SExt))
817
__OMP_RTL_ATTRS(__kmpc_dispatch_fini_4u, InaccessibleArgOnlyAttrs,
818
                AttributeSet(), ParamAttrs(ReadOnlyPtrAttrs, SExt))
819
__OMP_RTL_ATTRS(__kmpc_dispatch_fini_8, InaccessibleArgOnlyAttrs,
820
                AttributeSet(), ParamAttrs(ReadOnlyPtrAttrs, SExt))
821
__OMP_RTL_ATTRS(__kmpc_dispatch_fini_8u, InaccessibleArgOnlyAttrs,
822
                AttributeSet(), ParamAttrs(ReadOnlyPtrAttrs, SExt))
823
__OMP_RTL_ATTRS(__kmpc_team_static_init_4, GetterArgWriteAttrs, AttributeSet(),
824
                ParamAttrs(ReadOnlyPtrAttrs, SExt, ArgPtrAttrs, ArgPtrAttrs,
825
                           ArgPtrAttrs, ArgPtrAttrs, SExt, SExt))
826
__OMP_RTL_ATTRS(__kmpc_team_static_init_4u, GetterArgWriteAttrs, AttributeSet(),
827
                ParamAttrs(ReadOnlyPtrAttrs, SExt, ArgPtrAttrs, ArgPtrAttrs,
828
                           ArgPtrAttrs, ArgPtrAttrs, SExt, SExt))
829
__OMP_RTL_ATTRS(__kmpc_team_static_init_8, GetterArgWriteAttrs, AttributeSet(),
830
                ParamAttrs(ReadOnlyPtrAttrs, SExt, ArgPtrAttrs, ArgPtrAttrs,
831
                           ArgPtrAttrs, ArgPtrAttrs))
832
__OMP_RTL_ATTRS(__kmpc_team_static_init_8u, GetterArgWriteAttrs, AttributeSet(),
833
                ParamAttrs(ReadOnlyPtrAttrs, SExt, ArgPtrAttrs, ArgPtrAttrs,
834
                           ArgPtrAttrs, ArgPtrAttrs))
835
__OMP_RTL_ATTRS(__kmpc_dist_for_static_init_4, GetterArgWriteAttrs,
836
                AttributeSet(),
837
                ParamAttrs(ReadOnlyPtrAttrs, SExt, SExt, ArgPtrAttrs,
838
                           ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs,
839
                           ArgPtrAttrs, SExt, SExt))
840
__OMP_RTL_ATTRS(__kmpc_dist_for_static_init_4u, GetterArgWriteAttrs,
841
                AttributeSet(),
842
                ParamAttrs(ReadOnlyPtrAttrs, SExt, SExt, ArgPtrAttrs,
843
                           ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs,
844
                           ArgPtrAttrs, SExt, SExt))
845
__OMP_RTL_ATTRS(__kmpc_dist_for_static_init_8, GetterArgWriteAttrs,
846
                AttributeSet(),
847
                ParamAttrs(ReadOnlyPtrAttrs, SExt, SExt, ArgPtrAttrs,
848
                           ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs))
849
__OMP_RTL_ATTRS(__kmpc_dist_for_static_init_8u, GetterArgWriteAttrs,
850
                AttributeSet(),
851
                ParamAttrs(ReadOnlyPtrAttrs, SExt, SExt, ArgPtrAttrs,
852
                           ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs))
853
 
854
__OMP_RTL_ATTRS(__kmpc_single, BarrierAttrs, SExt,
855
                ParamAttrs(ReadOnlyPtrAttrs, SExt))
856
__OMP_RTL_ATTRS(__kmpc_end_single, BarrierAttrs, AttributeSet(),
857
                ParamAttrs(ReadOnlyPtrAttrs, SExt))
858
 
859
__OMP_RTL_ATTRS(__kmpc_omp_task_alloc, DefaultAttrs, ReturnPtrAttrs,
860
                ParamAttrs(ReadOnlyPtrAttrs, SExt, SExt, SizeTyExt, SizeTyExt,
861
                           ReadOnlyPtrAttrs))
862
__OMP_RTL_ATTRS(__kmpc_omp_task, DefaultAttrs, SExt,
863
                ParamAttrs(ReadOnlyPtrAttrs, SExt, AttributeSet()))
864
__OMP_RTL_ATTRS(__kmpc_end_taskgroup, BarrierAttrs, AttributeSet(),
865
                ParamAttrs(ReadOnlyPtrAttrs, SExt))
866
__OMP_RTL_ATTRS(__kmpc_taskgroup, BarrierAttrs, AttributeSet(),
867
                ParamAttrs(ReadOnlyPtrAttrs, SExt))
868
__OMP_RTL_ATTRS(__kmpc_omp_task_begin_if0, DefaultAttrs, AttributeSet(),
869
                ParamAttrs(ReadOnlyPtrAttrs, SExt))
870
__OMP_RTL_ATTRS(__kmpc_omp_task_complete_if0, DefaultAttrs, AttributeSet(),
871
                ParamAttrs(ReadOnlyPtrAttrs, SExt))
872
__OMP_RTL_ATTRS(__kmpc_omp_task_with_deps, DefaultAttrs, SExt,
873
                ParamAttrs(ReadOnlyPtrAttrs, SExt, AttributeSet(), SExt,
874
                           ReadOnlyPtrAttrs, SExt, ReadOnlyPtrAttrs))
875
__OMP_RTL_ATTRS(__kmpc_taskloop, DefaultAttrs, AttributeSet(),
876
                ParamAttrs(ReadOnlyPtrAttrs, SExt, AttributeSet(), SExt,
877
                           ArgPtrAttrs, ArgPtrAttrs, AttributeSet(), SExt, SExt))
878
__OMP_RTL_ATTRS(__kmpc_omp_target_task_alloc, DefaultAttrs, ReturnPtrAttrs,
879
                ParamAttrs(ReadOnlyPtrAttrs, SExt, SExt, SizeTyExt, SizeTyExt,
880
                           ReadOnlyPtrAttrs, AttributeSet()))
881
__OMP_RTL_ATTRS(__kmpc_taskred_modifier_init, DefaultAttrs, ReturnPtrAttrs,
882
                ParamAttrs(ReadOnlyPtrAttrs, SExt, SExt, SExt))
883
__OMP_RTL_ATTRS(__kmpc_taskred_init, DefaultAttrs, AttributeSet(),
884
                ParamAttrs(SExt, SExt))
885
__OMP_RTL_ATTRS(__kmpc_task_reduction_modifier_fini, BarrierAttrs,
886
                AttributeSet(), ParamAttrs(ReadOnlyPtrAttrs, SExt, SExt))
887
__OMP_RTL_ATTRS(__kmpc_task_reduction_get_th_data, DefaultAttrs, ReturnPtrAttrs,
888
                ParamAttrs(SExt))
889
__OMP_RTL_ATTRS(__kmpc_task_reduction_init, DefaultAttrs, ReturnPtrAttrs,
890
                ParamAttrs(SExt, SExt))
891
__OMP_RTL_ATTRS(__kmpc_task_reduction_modifier_init, DefaultAttrs,
892
                ReturnPtrAttrs, ParamAttrs(AttributeSet(), SExt, SExt, SExt))
893
__OMP_RTL_ATTRS(__kmpc_proxy_task_completed_ooo, DefaultAttrs, AttributeSet(),
894
                ParamAttrs())
895
 
896
__OMP_RTL_ATTRS(__kmpc_omp_wait_deps, BarrierAttrs, AttributeSet(),
897
                ParamAttrs(ReadOnlyPtrAttrs, SExt, SExt, ReadOnlyPtrAttrs, SExt))
898
__OMP_RTL_ATTRS(__kmpc_omp_taskwait_deps_51, BarrierAttrs, AttributeSet(),
899
                ParamAttrs(ReadOnlyPtrAttrs, SExt, SExt, ReadOnlyPtrAttrs))
900
__OMP_RTL_ATTRS(__kmpc_cancellationpoint, DefaultAttrs, SExt,
901
                ParamAttrs(ReadOnlyPtrAttrs, SExt, SExt))
902
 
903
__OMP_RTL_ATTRS(__kmpc_fork_teams, ForkAttrs, AttributeSet(),
904
                ParamAttrs(ReadOnlyPtrAttrs, SExt, ReadOnlyPtrAttrs))
905
__OMP_RTL_ATTRS(__kmpc_push_num_teams, InaccessibleArgOnlyAttrs, AttributeSet(),
906
                ParamAttrs(ReadOnlyPtrAttrs, SExt, SExt, SExt))
907
 
908
__OMP_RTL_ATTRS(__kmpc_copyprivate, DefaultAttrs, AttributeSet(),
909
                ParamAttrs(ReadOnlyPtrAttrs, SExt, SizeTyExt,
910
                           ReadOnlyPtrAttrs, AttributeSet(), SExt))
911
__OMP_RTL_ATTRS(__kmpc_threadprivate_cached, DefaultAttrs, ReturnPtrAttrs,
912
                ParamAttrs(ReadOnlyPtrAttrs, SExt, AttributeSet(), SizeTyExt))
913
__OMP_RTL_ATTRS(__kmpc_threadprivate_register, DefaultAttrs, AttributeSet(),
914
                ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), ReadOnlyPtrAttrs,
915
                           ReadOnlyPtrAttrs, ReadOnlyPtrAttrs))
916
 
917
__OMP_RTL_ATTRS(__kmpc_doacross_init, BarrierAttrs, AttributeSet(),
918
                ParamAttrs(ReadOnlyPtrAttrs, SExt, SExt))
919
__OMP_RTL_ATTRS(__kmpc_doacross_post, BarrierAttrs, AttributeSet(),
920
                ParamAttrs(ReadOnlyPtrAttrs, SExt, ReadOnlyPtrAttrs))
921
__OMP_RTL_ATTRS(__kmpc_doacross_wait, BarrierAttrs, AttributeSet(),
922
                ParamAttrs(ReadOnlyPtrAttrs, SExt, ReadOnlyPtrAttrs))
923
__OMP_RTL_ATTRS(__kmpc_doacross_fini, BarrierAttrs, AttributeSet(),
924
                ParamAttrs(ReadOnlyPtrAttrs, SExt))
925
 
926
__OMP_RTL_ATTRS(__kmpc_alloc_shared,
927
                AttributeSet(EnumAttr(NoUnwind), EnumAttr(NoSync),
928
                             AllocSizeAttr(0, std::nullopt)),
929
                ReturnPtrAttrs, ParamAttrs(SizeTyExt))
930
__OMP_RTL_ATTRS(__kmpc_free_shared, DeviceAllocAttrs, AttributeSet(),
931
                ParamAttrs(AttributeSet(EnumAttr(NoCapture),
932
                                        EnumAttr(AllocatedPointer)),
933
                           SizeTyExt))
934
__OMP_RTL_ATTRS(__kmpc_begin_sharing_variables, AttributeSet(), AttributeSet(),
935
                ParamAttrs(AttributeSet(), SizeTyExt))
936
 
937
__OMP_RTL_ATTRS(__kmpc_alloc, DefaultAttrs, ReturnPtrAttrs,
938
                ParamAttrs(SExt, SizeTyExt))
939
__OMP_RTL_ATTRS(__kmpc_aligned_alloc, DefaultAttrs, ReturnPtrAttrs,
940
                ParamAttrs(SExt, SizeTyExt, SizeTyExt))
941
__OMP_RTL_ATTRS(__kmpc_free, AllocAttrs, AttributeSet(),
942
                ParamAttrs(SExt))
943
 
944
__OMP_RTL_ATTRS(__tgt_interop_init, AttributeSet(), AttributeSet(),
945
                ParamAttrs(AttributeSet(), SExt, AttributeSet(), SExt,
946
                           SExt, AttributeSet(), AttributeSet(), SExt))
947
__OMP_RTL_ATTRS(__tgt_interop_destroy, AttributeSet(), AttributeSet(),
948
                ParamAttrs(AttributeSet(), SExt, AttributeSet(), SExt, SExt,
949
                           AttributeSet(), SExt))
950
__OMP_RTL_ATTRS(__tgt_interop_use, AttributeSet(), AttributeSet(),
951
                ParamAttrs(AttributeSet(), SExt, AttributeSet(), SExt, SExt,
952
                           AttributeSet(), SExt))
953
 
954
__OMP_RTL_ATTRS(__kmpc_init_allocator, DefaultAttrs, ReturnPtrAttrs,
955
                ParamAttrs(SExt, AttributeSet(), SExt))
956
__OMP_RTL_ATTRS(__kmpc_destroy_allocator, AllocAttrs, AttributeSet(),
957
                ParamAttrs(SExt))
958
 
959
__OMP_RTL_ATTRS(__kmpc_push_target_tripcount_mapper, SetterAttrs,
960
                AttributeSet(), ParamAttrs())
961
__OMP_RTL_ATTRS(__tgt_target_mapper, ForkAttrs, SExt,
962
                ParamAttrs(AttributeSet(),AttributeSet(),AttributeSet(), SExt))
963
__OMP_RTL_ATTRS(__tgt_target_nowait_mapper, ForkAttrs, SExt,
964
                ParamAttrs(AttributeSet(), AttributeSet(), AttributeSet(), SExt,
965
                           AttributeSet(), AttributeSet(), AttributeSet(),
966
                           AttributeSet(), AttributeSet(), AttributeSet(),
967
                           SExt, AttributeSet(), SExt))
968
__OMP_RTL_ATTRS(__tgt_target_teams_mapper, ForkAttrs, SExt,
969
                ParamAttrs(AttributeSet(), AttributeSet(), AttributeSet(), SExt,
970
                           AttributeSet(), AttributeSet(), AttributeSet(),
971
                           AttributeSet(), AttributeSet(), AttributeSet(), SExt,
972
                           SExt))
973
__OMP_RTL_ATTRS(__tgt_target_teams_nowait_mapper, ForkAttrs, SExt,
974
                ParamAttrs(AttributeSet(), AttributeSet(), AttributeSet(), SExt,
975
                           AttributeSet(), AttributeSet(), AttributeSet(),
976
                           AttributeSet(), AttributeSet(), AttributeSet(),
977
                           SExt, SExt, SExt, AttributeSet(), SExt))
978
__OMP_RTL_ATTRS(__tgt_target_kernel, ForkAttrs, SExt,
979
                ParamAttrs(AttributeSet(), AttributeSet(), SExt, SExt))
980
__OMP_RTL_ATTRS(__tgt_target_kernel_nowait, ForkAttrs, SExt,
981
                ParamAttrs(AttributeSet(), AttributeSet(), SExt, SExt,
982
                           AttributeSet(), AttributeSet(), SExt, AttributeSet(),
983
                           SExt))
984
__OMP_RTL_ATTRS(__tgt_register_requires, ForkAttrs, AttributeSet(),
985
                ParamAttrs())
986
__OMP_RTL_ATTRS(__tgt_target_data_begin_mapper, ForkAttrs, AttributeSet(),
987
                ParamAttrs(AttributeSet(), AttributeSet(), SExt))
988
__OMP_RTL_ATTRS(__tgt_target_data_begin_nowait_mapper, ForkAttrs, AttributeSet(),
989
                ParamAttrs(AttributeSet(), AttributeSet(), SExt, AttributeSet(),
990
                           AttributeSet(), AttributeSet(), AttributeSet(),
991
                           AttributeSet(), AttributeSet()))
992
__OMP_RTL_ATTRS(__tgt_target_data_begin_mapper_issue, AttributeSet(),
993
                AttributeSet(),
994
                ParamAttrs(AttributeSet(), AttributeSet(), SExt))
995
__OMP_RTL_ATTRS(__tgt_target_data_end_mapper, ForkAttrs, AttributeSet(),
996
                ParamAttrs(AttributeSet(), AttributeSet(), SExt))
997
__OMP_RTL_ATTRS(__tgt_target_data_end_nowait_mapper, ForkAttrs, AttributeSet(),
998
                ParamAttrs(AttributeSet(), AttributeSet(), SExt, AttributeSet(),
999
                           AttributeSet(), AttributeSet(), AttributeSet(),
1000
                           AttributeSet(), AttributeSet()))
1001
__OMP_RTL_ATTRS(__tgt_target_data_update_mapper, ForkAttrs, AttributeSet(),
1002
                ParamAttrs(AttributeSet(), AttributeSet(), SExt))
1003
__OMP_RTL_ATTRS(__tgt_target_data_update_nowait_mapper, ForkAttrs, AttributeSet(),
1004
                ParamAttrs(AttributeSet(), AttributeSet(), SExt, AttributeSet(),
1005
                           AttributeSet(), AttributeSet(), AttributeSet(),
1006
                           AttributeSet(), AttributeSet()))
1007
__OMP_RTL_ATTRS(__tgt_mapper_num_components, ForkAttrs, AttributeSet(),
1008
                ParamAttrs())
1009
__OMP_RTL_ATTRS(__tgt_push_mapper_component, ForkAttrs, AttributeSet(),
1010
                ParamAttrs())
1011
__OMP_RTL_ATTRS(__kmpc_task_allow_completion_event, DefaultAttrs,
1012
                ReturnPtrAttrs, ParamAttrs(ReadOnlyPtrAttrs, SExt))
1013
 
1014
__OMP_RTL_ATTRS(__kmpc_target_init, AttributeSet(), SExt,
1015
                ParamAttrs(AttributeSet(), SExt, SExt))
1016
__OMP_RTL_ATTRS(__kmpc_target_deinit, AttributeSet(), AttributeSet(),
1017
                ParamAttrs(AttributeSet(), SExt))
1018
__OMP_RTL_ATTRS(__kmpc_parallel_51, AlwaysInlineAttrs, AttributeSet(),
1019
                ParamAttrs(AttributeSet(), SExt, SExt, SExt, SExt,
1020
                           AttributeSet(), AttributeSet(), AttributeSet(),
1021
                           SizeTyExt))
1022
__OMP_RTL_ATTRS(__kmpc_serialized_parallel, InaccessibleArgOnlyAttrs,
1023
                AttributeSet(), ParamAttrs(ReadOnlyPtrAttrs, SExt))
1024
__OMP_RTL_ATTRS(__kmpc_end_serialized_parallel, InaccessibleArgOnlyAttrs,
1025
                AttributeSet(), ParamAttrs(ReadOnlyPtrAttrs, SExt))
1026
__OMP_RTL_ATTRS(__kmpc_shuffle_int32, AttributeSet(), SExt,
1027
                ParamAttrs(SExt, SExt, SExt))
1028
__OMP_RTL_ATTRS(__kmpc_nvptx_parallel_reduce_nowait_v2, AttributeSet(), SExt,
1029
                ParamAttrs(AttributeSet(), SExt, SExt, SizeTyExt))
1030
__OMP_RTL_ATTRS(__kmpc_nvptx_end_reduce_nowait, AttributeSet(), AttributeSet(),
1031
                ParamAttrs(SExt))
1032
__OMP_RTL_ATTRS(__kmpc_nvptx_teams_reduce_nowait_v2, AttributeSet(), SExt,
1033
                ParamAttrs(AttributeSet(), SExt, AttributeSet(), ZExt))
1034
 
1035
__OMP_RTL_ATTRS(__kmpc_shuffle_int64, AttributeSet(), AttributeSet(),
1036
                ParamAttrs(AttributeSet(), SExt, SExt))
1037
 
1038
__OMP_RTL_ATTRS(__kmpc_is_spmd_exec_mode, AttributeSet(), SExt, ParamAttrs())
1039
 
1040
#undef __OMP_RTL_ATTRS
1041
#undef OMP_RTL_ATTRS
1042
#undef AttributeSet
1043
#undef EnumAttr
1044
#undef EnumAttrInt
1045
#undef ParamAttrs
1046
#undef AllocSizeAttr
1047
 
1048
///}
1049
 
1050
/// KMP ident_t bit flags
1051
///
1052
/// In accordance with the values in `openmp/runtime/src/kmp.h`.
1053
///
1054
///{
1055
 
1056
#ifndef OMP_IDENT_FLAG
1057
#define OMP_IDENT_FLAG(Enum, Str, Value)
1058
#endif
1059
 
1060
#define __OMP_IDENT_FLAG(Name, Value)                                          \
1061
  OMP_IDENT_FLAG(OMP_IDENT_FLAG_##Name, #Name, Value)
1062
 
1063
__OMP_IDENT_FLAG(KMPC, 0x02)
1064
__OMP_IDENT_FLAG(ATOMIC_REDUCE, 0x10)
1065
__OMP_IDENT_FLAG(BARRIER_EXPL, 0x20)
1066
__OMP_IDENT_FLAG(BARRIER_IMPL, 0x0040)
1067
__OMP_IDENT_FLAG(BARRIER_IMPL_MASK, 0x01C0)
1068
__OMP_IDENT_FLAG(BARRIER_IMPL_FOR, 0x0040)
1069
__OMP_IDENT_FLAG(BARRIER_IMPL_SECTIONS, 0x00C0)
1070
__OMP_IDENT_FLAG(BARRIER_IMPL_SINGLE, 0x0140)
1071
__OMP_IDENT_FLAG(BARRIER_IMPL_WORKSHARE, 0x01C0)
1072
 
1073
#undef __OMP_IDENT_FLAG
1074
#undef OMP_IDENT_FLAG
1075
 
1076
///}
1077
 
1078
/// KMP cancel kind
1079
///
1080
///{
1081
 
1082
#ifndef OMP_CANCEL_KIND
1083
#define OMP_CANCEL_KIND(Enum, Str, DirectiveEnum, Value)
1084
#endif
1085
 
1086
#define __OMP_CANCEL_KIND(Name, Value)                                         \
1087
  OMP_CANCEL_KIND(OMP_CANCEL_KIND_##Name, #Name, OMPD_##Name, Value)
1088
 
1089
__OMP_CANCEL_KIND(parallel, 1)
1090
__OMP_CANCEL_KIND(for, 2)
1091
__OMP_CANCEL_KIND(sections, 3)
1092
__OMP_CANCEL_KIND(taskgroup, 4)
1093
 
1094
#undef __OMP_CANCEL_KIND
1095
#undef OMP_CANCEL_KIND
1096
 
1097
///}
1098
 
1099
/// Default kinds
1100
///
1101
///{
1102
 
1103
#ifndef OMP_DEFAULT_KIND
1104
#define OMP_DEFAULT_KIND(Enum, Str)
1105
#endif
1106
 
1107
#define __OMP_DEFAULT_KIND(Name) OMP_DEFAULT_KIND(OMP_DEFAULT_##Name, #Name)
1108
 
1109
__OMP_DEFAULT_KIND(none)
1110
__OMP_DEFAULT_KIND(shared)
1111
__OMP_DEFAULT_KIND(private)
1112
__OMP_DEFAULT_KIND(firstprivate)
1113
__OMP_DEFAULT_KIND(unknown)
1114
 
1115
#undef __OMP_DEFAULT_KIND
1116
#undef OMP_DEFAULT_KIND
1117
 
1118
///}
1119
 
1120
/// Proc bind kinds
1121
///
1122
///{
1123
 
1124
#ifndef OMP_PROC_BIND_KIND
1125
#define OMP_PROC_BIND_KIND(Enum, Str, Value)
1126
#endif
1127
 
1128
#define __OMP_PROC_BIND_KIND(Name, Value)                                      \
1129
  OMP_PROC_BIND_KIND(OMP_PROC_BIND_##Name, #Name, Value)
1130
 
1131
__OMP_PROC_BIND_KIND(master, 2)
1132
__OMP_PROC_BIND_KIND(close, 3)
1133
__OMP_PROC_BIND_KIND(spread, 4)
1134
__OMP_PROC_BIND_KIND(primary, 5)
1135
__OMP_PROC_BIND_KIND(default, 6)
1136
__OMP_PROC_BIND_KIND(unknown, 7)
1137
 
1138
#undef __OMP_PROC_BIND_KIND
1139
#undef OMP_PROC_BIND_KIND
1140
 
1141
///}
1142
 
1143
/// OpenMP context related definitions:
1144
///  - trait set selector
1145
///  - trait selector
1146
///  - trait property
1147
///
1148
///{
1149
 
1150
#ifndef OMP_TRAIT_SET
1151
#define OMP_TRAIT_SET(Enum, Str)
1152
#endif
1153
#ifndef OMP_TRAIT_SELECTOR
1154
#define OMP_TRAIT_SELECTOR(Enum, TraitSetEnum, Str, RequiresProperty)
1155
#endif
1156
#ifndef OMP_TRAIT_PROPERTY
1157
#define OMP_TRAIT_PROPERTY(Enum, TraitSetEnum, TraitSelectorEnum, Str)
1158
#endif
1159
#ifndef OMP_LAST_TRAIT_PROPERTY
1160
#define OMP_LAST_TRAIT_PROPERTY(Enum)
1161
#endif
1162
 
1163
#define __OMP_TRAIT_SET(Name) OMP_TRAIT_SET(Name, #Name)
1164
#define __OMP_TRAIT_SELECTOR(TraitSet, Name, RequiresProperty)                 \
1165
  OMP_TRAIT_SELECTOR(TraitSet##_##Name, TraitSet, #Name, RequiresProperty)
1166
#define __OMP_TRAIT_SELECTOR_AND_PROPERTY(TraitSet, Name)                      \
1167
  OMP_TRAIT_SELECTOR(TraitSet##_##Name, TraitSet, #Name, false)                \
1168
  OMP_TRAIT_PROPERTY(TraitSet##_##Name##_##Name, TraitSet, TraitSet##_##Name,  \
1169
                     #Name)
1170
#define __OMP_TRAIT_PROPERTY(TraitSet, TraitSelector, Name)                    \
1171
  OMP_TRAIT_PROPERTY(TraitSet##_##TraitSelector##_##Name, TraitSet,            \
1172
                     TraitSet##_##TraitSelector, #Name)
1173
 
1174
// "invalid" must go first.
1175
OMP_TRAIT_SET(invalid, "invalid")
1176
OMP_TRAIT_SELECTOR(invalid, invalid, "invalid", false)
1177
OMP_TRAIT_PROPERTY(invalid, invalid, invalid, "invalid")
1178
 
1179
__OMP_TRAIT_SET(construct)
1180
__OMP_TRAIT_SELECTOR_AND_PROPERTY(construct, target)
1181
__OMP_TRAIT_SELECTOR_AND_PROPERTY(construct, teams)
1182
__OMP_TRAIT_SELECTOR_AND_PROPERTY(construct, parallel)
1183
__OMP_TRAIT_SELECTOR_AND_PROPERTY(construct, for)
1184
__OMP_TRAIT_SELECTOR_AND_PROPERTY(construct, simd)
1185
 
1186
__OMP_TRAIT_SET(device)
1187
 
1188
__OMP_TRAIT_SELECTOR(device, kind, true)
1189
 
1190
__OMP_TRAIT_PROPERTY(device, kind, host)
1191
__OMP_TRAIT_PROPERTY(device, kind, nohost)
1192
__OMP_TRAIT_PROPERTY(device, kind, cpu)
1193
__OMP_TRAIT_PROPERTY(device, kind, gpu)
1194
__OMP_TRAIT_PROPERTY(device, kind, fpga)
1195
__OMP_TRAIT_PROPERTY(device, kind, any)
1196
 
1197
__OMP_TRAIT_SELECTOR(device, arch, true)
1198
 
1199
__OMP_TRAIT_PROPERTY(device, arch, arm)
1200
__OMP_TRAIT_PROPERTY(device, arch, armeb)
1201
__OMP_TRAIT_PROPERTY(device, arch, aarch64)
1202
__OMP_TRAIT_PROPERTY(device, arch, aarch64_be)
1203
__OMP_TRAIT_PROPERTY(device, arch, aarch64_32)
1204
__OMP_TRAIT_PROPERTY(device, arch, ppc)
1205
__OMP_TRAIT_PROPERTY(device, arch, ppcle)
1206
__OMP_TRAIT_PROPERTY(device, arch, ppc64)
1207
__OMP_TRAIT_PROPERTY(device, arch, ppc64le)
1208
__OMP_TRAIT_PROPERTY(device, arch, x86)
1209
__OMP_TRAIT_PROPERTY(device, arch, x86_64)
1210
__OMP_TRAIT_PROPERTY(device, arch, amdgcn)
1211
__OMP_TRAIT_PROPERTY(device, arch, nvptx)
1212
__OMP_TRAIT_PROPERTY(device, arch, nvptx64)
1213
 
1214
__OMP_TRAIT_SET(implementation)
1215
 
1216
__OMP_TRAIT_SELECTOR(implementation, vendor, true)
1217
 
1218
__OMP_TRAIT_PROPERTY(implementation, vendor, amd)
1219
__OMP_TRAIT_PROPERTY(implementation, vendor, arm)
1220
__OMP_TRAIT_PROPERTY(implementation, vendor, bsc)
1221
__OMP_TRAIT_PROPERTY(implementation, vendor, cray)
1222
__OMP_TRAIT_PROPERTY(implementation, vendor, fujitsu)
1223
__OMP_TRAIT_PROPERTY(implementation, vendor, gnu)
1224
__OMP_TRAIT_PROPERTY(implementation, vendor, ibm)
1225
__OMP_TRAIT_PROPERTY(implementation, vendor, intel)
1226
__OMP_TRAIT_PROPERTY(implementation, vendor, llvm)
1227
__OMP_TRAIT_PROPERTY(implementation, vendor, nec)
1228
__OMP_TRAIT_PROPERTY(implementation, vendor, nvidia)
1229
__OMP_TRAIT_PROPERTY(implementation, vendor, pgi)
1230
__OMP_TRAIT_PROPERTY(implementation, vendor, ti)
1231
__OMP_TRAIT_PROPERTY(implementation, vendor, unknown)
1232
 
1233
__OMP_TRAIT_SELECTOR(implementation, extension, true)
1234
__OMP_TRAIT_PROPERTY(implementation, extension, match_all)
1235
__OMP_TRAIT_PROPERTY(implementation, extension, match_any)
1236
__OMP_TRAIT_PROPERTY(implementation, extension, match_none)
1237
__OMP_TRAIT_PROPERTY(implementation, extension, disable_implicit_base)
1238
__OMP_TRAIT_PROPERTY(implementation, extension, allow_templates)
1239
__OMP_TRAIT_PROPERTY(implementation, extension, bind_to_declaration)
1240
 
1241
__OMP_TRAIT_SET(user)
1242
 
1243
__OMP_TRAIT_SELECTOR(user, condition, true)
1244
 
1245
__OMP_TRAIT_PROPERTY(user, condition, true)
1246
__OMP_TRAIT_PROPERTY(user, condition, false)
1247
__OMP_TRAIT_PROPERTY(user, condition, unknown)
1248
 
1249
__OMP_TRAIT_SELECTOR_AND_PROPERTY(construct, dispatch)
1250
 
1251
// Note that we put isa last so that the other conditions are checked first.
1252
// This allows us to issue warnings wrt. isa only if we match otherwise.
1253
__OMP_TRAIT_SELECTOR(device, isa, true)
1254
 
1255
// We use "__ANY" as a placeholder in the isa property to denote the
1256
// conceptual "any", not the literal `any` used in kind. The string we
1257
// we use is not important except that it will show up in diagnostics.
1258
OMP_TRAIT_PROPERTY(device_isa___ANY, device, device_isa,
1259
                   "<any, entirely target dependent>")
1260
 
1261
 
1262
#undef OMP_TRAIT_SET
1263
#undef __OMP_TRAIT_SET
1264
///}
1265
 
1266
/// Traits for the requires directive
1267
///
1268
/// These will (potentially) become trait selectors for the OpenMP context if
1269
/// the OMP_REQUIRES_TRAIT macro is not defined.
1270
///
1271
///{
1272
 
1273
#ifdef OMP_REQUIRES_TRAIT
1274
#define __OMP_REQUIRES_TRAIT(Name)                                             \
1275
  OMP_REQUIRES_TRAIT(OMP_REQUIRES_TRAIT_##Name, #Name)
1276
#else
1277
#define __OMP_REQUIRES_TRAIT(Name)                                             \
1278
  __OMP_TRAIT_SELECTOR_AND_PROPERTY(implementation, Name)
1279
#endif
1280
 
1281
__OMP_REQUIRES_TRAIT(unified_address)
1282
__OMP_REQUIRES_TRAIT(unified_shared_memory)
1283
__OMP_REQUIRES_TRAIT(reverse_offload)
1284
__OMP_REQUIRES_TRAIT(dynamic_allocators)
1285
__OMP_REQUIRES_TRAIT(atomic_default_mem_order)
1286
 
1287
OMP_LAST_TRAIT_PROPERTY(
1288
    implementation_atomic_default_mem_order_atomic_default_mem_order)
1289
 
1290
#undef __OMP_TRAIT_SELECTOR_AND_PROPERTY
1291
#undef OMP_TRAIT_SELECTOR
1292
#undef __OMP_TRAIT_SELECTOR
1293
#undef OMP_TRAIT_PROPERTY
1294
#undef OMP_LAST_TRAIT_PROPERTY
1295
#undef __OMP_TRAIT_PROPERTY
1296
#undef __OMP_REQUIRES_TRAIT
1297
#undef OMP_REQUIRES_TRAIT
1298
///}
1299
 
1300
 
1301
/// Assumption clauses
1302
///
1303
///{
1304
 
1305
#ifdef OMP_ASSUME_CLAUSE
1306
#define __OMP_ASSUME_CLAUSE(Identifier, StartsWith, HasDirectiveList, HasExpression) \
1307
OMP_ASSUME_CLAUSE(Identifier, StartsWith, HasDirectiveList, HasExpression)
1308
#else
1309
#define __OMP_ASSUME_CLAUSE(...)
1310
#endif
1311
 
1312
__OMP_ASSUME_CLAUSE(llvm::StringLiteral("ext_"), true, false, false)
1313
__OMP_ASSUME_CLAUSE(llvm::StringLiteral("absent"), false, true, false)
1314
__OMP_ASSUME_CLAUSE(llvm::StringLiteral("contains"), false, true, false)
1315
__OMP_ASSUME_CLAUSE(llvm::StringLiteral("holds"), false, false, true)
1316
__OMP_ASSUME_CLAUSE(llvm::StringLiteral("no_openmp"), false, false, false)
1317
__OMP_ASSUME_CLAUSE(llvm::StringLiteral("no_openmp_routines"), false, false, false)
1318
__OMP_ASSUME_CLAUSE(llvm::StringLiteral("no_parallelism"), false, false, false)
1319
 
1320
#undef __OMP_ASSUME_CLAUSE
1321
#undef OMP_ASSUME_CLAUSE
1322
///}