clang 24.0.0git
CIRGenStmtOpenMP.cpp
Go to the documentation of this file.
1//===----------------------------------------------------------------------===//
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//
9// Emit OpenMP Stmt nodes as CIR code.
10//
11//===----------------------------------------------------------------------===//
12
13#include "CIRGenBuilder.h"
14#include "CIRGenFunction.h"
15#include "CIRGenOpenMPClause.h"
16#include "mlir/Dialect/OpenMP/OpenMPDialect.h"
19#include "llvm/Frontend/OpenMP/OMPConstants.h"
20using namespace clang;
21using namespace clang::CIRGen;
22
23mlir::LogicalResult
24CIRGenFunction::emitOMPScopeDirective(const OMPScopeDirective &s) {
25 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPScopeDirective");
26 return mlir::failure();
27}
28mlir::LogicalResult
30 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPErrorDirective");
31 return mlir::failure();
32}
33mlir::LogicalResult
34CIRGenFunction::emitOMPParallelDirective(const OMPParallelDirective &s) {
35 mlir::LogicalResult res = mlir::success();
36 mlir::Location begin = getLoc(s.getBeginLoc());
37 mlir::Location end = getLoc(s.getEndLoc());
38
39 mlir::omp::ParallelOperands clauseOps;
40 OpenMPClauseEmitter ce(*this, getCIRGenModule(), builder, begin, s.clauses());
41 ce.emitProcBind(clauseOps);
42 ce.emitNYI</*supported=*/OMPProcBindClause>(
43 /*nyi=*/OpenMPNYIClauseList<
45 OMPFirstprivateClause, OMPIfClause, OMPNumThreadsClause,
46 OMPPrivateClause, OMPReductionClause, OMPSharedClause>{},
47 llvm::omp::Directive::OMPD_parallel);
48
49 auto parallelOp = mlir::omp::ParallelOp::create(builder, begin, clauseOps);
50
51 {
52 mlir::Block &block = parallelOp.getRegion().emplaceBlock();
53 mlir::OpBuilder::InsertionGuard guardCase(builder);
54 builder.setInsertionPointToEnd(&block);
55
56 LexicalScope ls{*this, begin, builder.getInsertionBlock()};
57
58 if (s.hasCancel())
59 getCIRGenModule().errorNYI(s.getBeginLoc(),
60 "OpenMP Parallel with Cancel");
61 if (s.getTaskReductionRefExpr())
62 getCIRGenModule().errorNYI(s.getBeginLoc(),
63 "OpenMP Parallel with Task Reduction");
64 // Don't lower the captured statement directly since this will be
65 // special-cased depending on the kind of OpenMP directive that is the
66 // parent, also the non-OpenMP context captured statements lowering does
67 // not apply directly.
68 const CapturedStmt *cs = s.getCapturedStmt(llvm::omp::OMPD_parallel);
69 const Stmt *bodyStmt = cs->getCapturedStmt();
70 res = emitStmt(bodyStmt, /*useCurrentScope=*/true);
71 mlir::omp::TerminatorOp::create(builder, end);
72 }
73 return res;
74}
75
76mlir::LogicalResult
77CIRGenFunction::emitOMPTaskwaitDirective(const OMPTaskwaitDirective &s) {
78 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPTaskwaitDirective");
79 return mlir::failure();
80}
81mlir::LogicalResult
82CIRGenFunction::emitOMPTaskyieldDirective(const OMPTaskyieldDirective &s) {
83 getCIRGenModule().errorNYI(s.getSourceRange(),
84 "OpenMP OMPTaskyieldDirective");
85 return mlir::failure();
86}
87mlir::LogicalResult
88CIRGenFunction::emitOMPBarrierDirective(const OMPBarrierDirective &s) {
89 mlir::omp::BarrierOp::create(builder, getLoc(s.getBeginLoc()));
90 assert(s.clauses().empty() && "omp barrier doesn't support clauses");
91 return mlir::success();
92}
93mlir::LogicalResult
95 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPMetaDirective");
96 return mlir::failure();
97}
98mlir::LogicalResult
99CIRGenFunction::emitOMPCanonicalLoop(const OMPCanonicalLoop &s) {
100 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPCanonicalLoop");
101 return mlir::failure();
102}
103mlir::LogicalResult
104CIRGenFunction::emitOMPSimdDirective(const OMPSimdDirective &s) {
105 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPSimdDirective");
106 return mlir::failure();
107}
108mlir::LogicalResult
110 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPTileDirective");
111 return mlir::failure();
112}
113mlir::LogicalResult
115 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPUnrollDirective");
116 return mlir::failure();
117}
118mlir::LogicalResult
120 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPFuseDirective");
121 return mlir::failure();
122}
123mlir::LogicalResult
124CIRGenFunction::emitOMPForDirective(const OMPForDirective &s) {
125 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPForDirective");
126 return mlir::failure();
127}
128mlir::LogicalResult
129CIRGenFunction::emitOMPForSimdDirective(const OMPForSimdDirective &s) {
130 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPForSimdDirective");
131 return mlir::failure();
132}
133mlir::LogicalResult
134CIRGenFunction::emitOMPSectionsDirective(const OMPSectionsDirective &s) {
135 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPSectionsDirective");
136 return mlir::failure();
137}
138mlir::LogicalResult
139CIRGenFunction::emitOMPSectionDirective(const OMPSectionDirective &s) {
140 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPSectionDirective");
141 return mlir::failure();
142}
143mlir::LogicalResult
144CIRGenFunction::emitOMPSingleDirective(const OMPSingleDirective &s) {
145 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPSingleDirective");
146 return mlir::failure();
147}
148mlir::LogicalResult
149CIRGenFunction::emitOMPMasterDirective(const OMPMasterDirective &s) {
150 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPMasterDirective");
151 return mlir::failure();
152}
153mlir::LogicalResult
154CIRGenFunction::emitOMPCriticalDirective(const OMPCriticalDirective &s) {
155 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPCriticalDirective");
156 return mlir::failure();
157}
158mlir::LogicalResult
159CIRGenFunction::emitOMPParallelForDirective(const OMPParallelForDirective &s) {
160 getCIRGenModule().errorNYI(s.getSourceRange(),
161 "OpenMP OMPParallelForDirective");
162 return mlir::failure();
163}
165 const OMPParallelForSimdDirective &s) {
166 getCIRGenModule().errorNYI(s.getSourceRange(),
167 "OpenMP OMPParallelForSimdDirective");
168 return mlir::failure();
169}
171 const OMPParallelMasterDirective &s) {
172 getCIRGenModule().errorNYI(s.getSourceRange(),
173 "OpenMP OMPParallelMasterDirective");
174 return mlir::failure();
175}
177 const OMPParallelSectionsDirective &s) {
178 getCIRGenModule().errorNYI(s.getSourceRange(),
179 "OpenMP OMPParallelSectionsDirective");
180 return mlir::failure();
181}
182mlir::LogicalResult
183CIRGenFunction::emitOMPTaskDirective(const OMPTaskDirective &s) {
184 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPTaskDirective");
185 return mlir::failure();
186}
187mlir::LogicalResult
188CIRGenFunction::emitOMPTaskgroupDirective(const OMPTaskgroupDirective &s) {
189 getCIRGenModule().errorNYI(s.getSourceRange(),
190 "OpenMP OMPTaskgroupDirective");
191 return mlir::failure();
192}
193mlir::LogicalResult
194CIRGenFunction::emitOMPFlushDirective(const OMPFlushDirective &s) {
195 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPFlushDirective");
196 return mlir::failure();
197}
198mlir::LogicalResult
199CIRGenFunction::emitOMPDepobjDirective(const OMPDepobjDirective &s) {
200 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPDepobjDirective");
201 return mlir::failure();
202}
203mlir::LogicalResult
205 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPScanDirective");
206 return mlir::failure();
207}
209 const OMPOrderedStandaloneDirective &s) {
210 getCIRGenModule().errorNYI(s.getSourceRange(),
211 "OpenMP OMPOrderedStandaloneDirective");
212 return mlir::failure();
213}
215 const OMPOrderedBlockAssocDirective &s) {
216 getCIRGenModule().errorNYI(s.getSourceRange(),
217 "OpenMP OMPOrderedBlockAssocDirective");
218 return mlir::failure();
219}
220mlir::LogicalResult
221CIRGenFunction::emitOMPAtomicDirective(const OMPAtomicDirective &s) {
222 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPAtomicDirective");
223 return mlir::failure();
224}
225
226/// Check for unsupported implicit captures in a target region.
227static void
230 const CapturedStmt *cs = s.getCapturedStmt(llvm::omp::OMPD_target);
231 for (const auto &capture : cs->captures()) {
232 if (capture.capturesThis()) {
233 cgf.getCIRGenModule().errorNYI(s.getBeginLoc(),
234 "OpenMP target capture of 'this' pointer");
235 continue;
236 }
237 if (capture.capturesVariableByCopy()) {
238 cgf.getCIRGenModule().errorNYI(s.getBeginLoc(),
239 "OpenMP target capture by copy");
240 continue;
241 }
242 if (capture.capturesVariableArrayType()) {
244 s.getBeginLoc(),
245 "OpenMP target capture of variable-length array type");
246 continue;
247 }
248 if (capture.capturesVariable()) {
249 const VarDecl *vd = capture.getCapturedVar();
250 if (llvm::is_contained(mapSyms, vd))
251 continue;
252
253 cgf.getCIRGenModule().errorNYI(s.getBeginLoc(),
254 "OpenMP target implicit by-ref capture");
255 }
256 }
257}
258
259/// Emit the body of an omp.target region, remapping mapped variables to the
260/// block arguments of the target op's region.
261static mlir::LogicalResult
263 mlir::omp::TargetOp targetOp,
265 llvm::ArrayRef<const VarDecl *> mappedVarDecls,
266 mlir::Location begin, mlir::Location end) {
267 mlir::Block &block = targetOp.getRegion().emplaceBlock();
268
269 for (mlir::Value mapVar : mapVars)
270 block.addArgument(mapVar.getType(), begin);
271
272 mlir::OpBuilder::InsertionGuard guard(cgf.getBuilder());
273 cgf.getBuilder().setInsertionPointToEnd(&block);
274
275 CIRGenFunction::LexicalScope ls{cgf, begin,
276 cgf.getBuilder().getInsertionBlock()};
277
279 for (auto [idx, vd] : llvm::enumerate(mappedVarDecls)) {
280 Address origAddr = cgf.getAddrOfLocalVar(vd);
281 savedAddrs.push_back({vd, origAddr});
282 mlir::Value blockArg = block.getArgument(idx);
283 cgf.replaceAddrOfLocalVar(vd, Address(blockArg, origAddr.getAlignment()));
284 }
285
286 const CapturedStmt *cs = s.getCapturedStmt(llvm::omp::OMPD_target);
287 mlir::LogicalResult res =
288 cgf.emitStmt(cs->getCapturedStmt(), /*useCurrentScope=*/true);
289
290 mlir::omp::TerminatorOp::create(cgf.getBuilder(), end);
291
292 for (auto &[vd, addr] : savedAddrs)
293 cgf.replaceAddrOfLocalVar(vd, addr);
294
295 return res;
296}
297
298mlir::LogicalResult
300 mlir::Location begin = getLoc(s.getBeginLoc());
301 mlir::Location end = getLoc(s.getEndLoc());
302
303 mlir::omp::TargetExtOperands clauseOps;
305
306 OpenMPClauseEmitter ce(*this, getCIRGenModule(), builder, begin, s.clauses());
307 ce.emitMap(clauseOps, &mapSyms);
308 ce.emitNYI</*supported=*/OMPMapClause>(
309 /*nyi=*/OpenMPNYIClauseList<
311 OMPDependClause, OMPDeviceClause, OMPFirstprivateClause,
312 OMPHasDeviceAddrClause, OMPIfClause, OMPInReductionClause,
313 OMPIsDevicePtrClause, OMPNowaitClause, OMPPrivateClause,
315 llvm::omp::Directive::OMPD_target);
316
317 emitOMPTargetImplicitCaptures(*this, s, mapSyms);
318
319 // Use generic for now.
320 clauseOps.kernelType = mlir::omp::TargetExecModeAttr::get(
321 &getMLIRContext(), mlir::omp::TargetExecMode::generic);
322
323 auto targetOp = mlir::omp::TargetOp::create(builder, begin, clauseOps);
324
325 return emitOMPTargetBody(*this, s, targetOp, clauseOps.mapVars, mapSyms,
326 begin, end);
327}
328mlir::LogicalResult
330 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPTeamsDirective");
331 return mlir::failure();
332}
335 getCIRGenModule().errorNYI(s.getSourceRange(),
336 "OpenMP OMPCancellationPointDirective");
337 return mlir::failure();
338}
339mlir::LogicalResult
341 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPCancelDirective");
342 return mlir::failure();
343}
344mlir::LogicalResult
346 getCIRGenModule().errorNYI(s.getSourceRange(),
347 "OpenMP OMPTargetDataDirective");
348 return mlir::failure();
349}
352 getCIRGenModule().errorNYI(s.getSourceRange(),
353 "OpenMP OMPTargetEnterDataDirective");
354 return mlir::failure();
355}
358 getCIRGenModule().errorNYI(s.getSourceRange(),
359 "OpenMP OMPTargetExitDataDirective");
360 return mlir::failure();
361}
364 getCIRGenModule().errorNYI(s.getSourceRange(),
365 "OpenMP OMPTargetParallelDirective");
366 return mlir::failure();
367}
370 getCIRGenModule().errorNYI(s.getSourceRange(),
371 "OpenMP OMPTargetParallelForDirective");
372 return mlir::failure();
373}
374mlir::LogicalResult
376 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPTaskLoopDirective");
377 return mlir::failure();
378}
380 const OMPTaskLoopSimdDirective &s) {
381 getCIRGenModule().errorNYI(s.getSourceRange(),
382 "OpenMP OMPTaskLoopSimdDirective");
383 return mlir::failure();
384}
387 getCIRGenModule().errorNYI(s.getSourceRange(),
388 "OpenMP OMPMaskedTaskLoopDirective");
389 return mlir::failure();
390}
393 getCIRGenModule().errorNYI(s.getSourceRange(),
394 "OpenMP OMPMaskedTaskLoopSimdDirective");
395 return mlir::failure();
396}
399 getCIRGenModule().errorNYI(s.getSourceRange(),
400 "OpenMP OMPMasterTaskLoopDirective");
401 return mlir::failure();
402}
405 getCIRGenModule().errorNYI(s.getSourceRange(),
406 "OpenMP OMPMasterTaskLoopSimdDirective");
407 return mlir::failure();
408}
411 getCIRGenModule().errorNYI(s.getSourceRange(),
412 "OpenMP OMPParallelGenericLoopDirective");
413 return mlir::failure();
414}
416 const OMPParallelMaskedDirective &s) {
417 getCIRGenModule().errorNYI(s.getSourceRange(),
418 "OpenMP OMPParallelMaskedDirective");
419 return mlir::failure();
420}
423 getCIRGenModule().errorNYI(s.getSourceRange(),
424 "OpenMP OMPParallelMaskedTaskLoopDirective");
425 return mlir::failure();
426}
429 getCIRGenModule().errorNYI(s.getSourceRange(),
430 "OpenMP OMPParallelMaskedTaskLoopSimdDirective");
431 return mlir::failure();
432}
435 getCIRGenModule().errorNYI(s.getSourceRange(),
436 "OpenMP OMPParallelMasterTaskLoopDirective");
437 return mlir::failure();
438}
441 getCIRGenModule().errorNYI(s.getSourceRange(),
442 "OpenMP OMPParallelMasterTaskLoopSimdDirective");
443 return mlir::failure();
444}
445mlir::LogicalResult
447 getCIRGenModule().errorNYI(s.getSourceRange(),
448 "OpenMP OMPDistributeDirective");
449 return mlir::failure();
450}
453 getCIRGenModule().errorNYI(s.getSourceRange(),
454 "OpenMP OMPDistributeParallelForDirective");
455 return mlir::failure();
456}
459 getCIRGenModule().errorNYI(s.getSourceRange(),
460 "OpenMP OMPDistributeParallelForSimdDirective");
461 return mlir::failure();
462}
465 getCIRGenModule().errorNYI(s.getSourceRange(),
466 "OpenMP OMPDistributeSimdDirective");
467 return mlir::failure();
468}
471 getCIRGenModule().errorNYI(s.getSourceRange(),
472 "OpenMP OMPTargetParallelGenericLoopDirective");
473 return mlir::failure();
474}
477 getCIRGenModule().errorNYI(s.getSourceRange(),
478 "OpenMP OMPTargetParallelForSimdDirective");
479 return mlir::failure();
480}
481mlir::LogicalResult
483 getCIRGenModule().errorNYI(s.getSourceRange(),
484 "OpenMP OMPTargetSimdDirective");
485 return mlir::failure();
486}
489 getCIRGenModule().errorNYI(s.getSourceRange(),
490 "OpenMP OMPTargetTeamsGenericLoopDirective");
491 return mlir::failure();
492}
494 const OMPTargetUpdateDirective &s) {
495 getCIRGenModule().errorNYI(s.getSourceRange(),
496 "OpenMP OMPTargetUpdateDirective");
497 return mlir::failure();
498}
501 getCIRGenModule().errorNYI(s.getSourceRange(),
502 "OpenMP OMPTeamsDistributeDirective");
503 return mlir::failure();
504}
507 getCIRGenModule().errorNYI(s.getSourceRange(),
508 "OpenMP OMPTeamsDistributeSimdDirective");
509 return mlir::failure();
510}
511mlir::LogicalResult
515 s.getSourceRange(), "OpenMP OMPTeamsDistributeParallelForSimdDirective");
516 return mlir::failure();
517}
520 getCIRGenModule().errorNYI(s.getSourceRange(),
521 "OpenMP OMPTeamsDistributeParallelForDirective");
522 return mlir::failure();
523}
526 getCIRGenModule().errorNYI(s.getSourceRange(),
527 "OpenMP OMPTeamsGenericLoopDirective");
528 return mlir::failure();
529}
530mlir::LogicalResult
532 getCIRGenModule().errorNYI(s.getSourceRange(),
533 "OpenMP OMPTargetTeamsDirective");
534 return mlir::failure();
535}
538 getCIRGenModule().errorNYI(s.getSourceRange(),
539 "OpenMP OMPTargetTeamsDistributeDirective");
540 return mlir::failure();
541}
542mlir::LogicalResult
546 s.getSourceRange(),
547 "OpenMP OMPTargetTeamsDistributeParallelForDirective");
548 return mlir::failure();
549}
550mlir::LogicalResult
554 s.getSourceRange(),
555 "OpenMP OMPTargetTeamsDistributeParallelForSimdDirective");
556 return mlir::failure();
557}
560 getCIRGenModule().errorNYI(s.getSourceRange(),
561 "OpenMP OMPTargetTeamsDistributeSimdDirective");
562 return mlir::failure();
563}
564mlir::LogicalResult
566 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPInteropDirective");
567 return mlir::failure();
568}
569mlir::LogicalResult
571 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPDispatchDirective");
572 return mlir::failure();
573}
574mlir::LogicalResult
576 getCIRGenModule().errorNYI(s.getSourceRange(),
577 "OpenMP OMPGenericLoopDirective");
578 return mlir::failure();
579}
580mlir::LogicalResult
582 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPReverseDirective");
583 return mlir::failure();
584}
585mlir::LogicalResult
587 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPSplitDirective");
588 return mlir::failure();
589}
590mlir::LogicalResult
592 getCIRGenModule().errorNYI(s.getSourceRange(),
593 "OpenMP OMPInterchangeDirective");
594 return mlir::failure();
595}
596mlir::LogicalResult
598 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPAssumeDirective");
599 return mlir::failure();
600}
601mlir::LogicalResult
603 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPMaskedDirective");
604 return mlir::failure();
605}
606mlir::LogicalResult
608 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPStripeDirective");
609 return mlir::failure();
610}
static mlir::LogicalResult emitOMPTargetBody(CIRGenFunction &cgf, const OMPTargetDirective &s, mlir::omp::TargetOp targetOp, llvm::ArrayRef< mlir::Value > mapVars, llvm::ArrayRef< const VarDecl * > mappedVarDecls, mlir::Location begin, mlir::Location end)
Emit the body of an omp.target region, remapping mapped variables to the block arguments of the targe...
static void emitOMPTargetImplicitCaptures(CIRGenFunction &cgf, const OMPTargetDirective &s, llvm::ArrayRef< const VarDecl * > mapSyms)
Check for unsupported implicit captures in a target region.
This file defines OpenMP AST classes for clauses.
This file defines OpenMP AST classes for executable directives and clauses.
This represents 'pragma omp cancel' directive.
This represents 'pragma omp cancellation point' directive.
This represents clause 'copyin' in the 'pragma omp ...' directives.
This represents 'defaultmap' clause in the 'pragma omp ...' directive.
This represents implicit clause 'depend' for the 'pragma omp task' directive.
This represents 'device' clause in the 'pragma omp ...' directive.
This represents 'pragma omp dispatch' directive.
This represents 'pragma omp distribute' directive.
This represents 'pragma omp distribute parallel for' composite directive.
This represents 'pragma omp distribute parallel for simd' composite directive.
This represents 'pragma omp distribute simd' composite directive.
This represents 'pragma omp error' directive.
Represents the 'pragma omp fuse' loop transformation directive.
This represents 'pragma omp loop' directive.
This represents clause 'has_device_ptr' in the 'pragma omp ...' directives.
Represents the 'pragma omp interchange' loop transformation directive.
This represents 'pragma omp interop' directive.
This represents clause 'is_device_ptr' in the 'pragma omp ...' directives.
This represents clause 'map' in the 'pragma omp ...' directives.
This represents 'pragma omp masked' directive.
This represents 'pragma omp masked taskloop' directive.
This represents 'pragma omp masked taskloop simd' directive.
This represents 'pragma omp master taskloop' directive.
This represents 'pragma omp master taskloop simd' directive.
This represents 'pragma omp metadirective' directive.
This represents 'pragma omp parallel loop' directive.
This represents 'pragma omp parallel masked taskloop' directive.
This represents 'pragma omp parallel masked taskloop simd' directive.
This represents 'pragma omp parallel master taskloop' directive.
This represents 'pragma omp parallel master taskloop simd' directive.
Represents the 'pragma omp reverse' loop transformation directive.
This represents 'pragma omp scan' directive.
Represents the 'pragma omp split' loop transformation directive.
This represents the 'pragma omp stripe' loop transformation directive.
This represents 'pragma omp target data' directive.
This represents 'pragma omp target' directive.
This represents 'pragma omp target enter data' directive.
This represents 'pragma omp target exit data' directive.
This represents 'pragma omp target parallel' directive.
This represents 'pragma omp target parallel for' directive.
This represents 'pragma omp target parallel for simd' directive.
This represents 'pragma omp target parallel loop' directive.
This represents 'pragma omp target simd' directive.
This represents 'pragma omp target teams' directive.
This represents 'pragma omp target teams distribute' combined directive.
This represents 'pragma omp target teams distribute parallel for' combined directive.
This represents 'pragma omp target teams distribute parallel for simd' combined directive.
This represents 'pragma omp target teams distribute simd' combined directive.
This represents 'pragma omp target teams loop' directive.
This represents 'pragma omp target update' directive.
This represents 'pragma omp taskloop' directive.
This represents 'pragma omp taskloop simd' directive.
This represents 'pragma omp teams' directive.
This represents 'pragma omp teams distribute' directive.
This represents 'pragma omp teams distribute parallel for' composite directive.
This represents 'pragma omp teams distribute parallel for simd' composite directive.
This represents 'pragma omp teams distribute simd' combined directive.
This represents 'pragma omp teams loop' directive.
This represents 'thread_limit' clause in the 'pragma omp ...' directive.
This represents the 'pragma omp tile' loop transformation directive.
This represents the 'pragma omp unroll' loop transformation directive.
This represents clause 'uses_allocators' in the 'pragma omp target'-based directives.
This represents 'ompx_bare' clause in the 'pragma omp target teams ...' directive.
clang::CharUnits getAlignment() const
Definition Address.h:138
mlir::LogicalResult emitOMPTargetParallelForDirective(const OMPTargetParallelForDirective &s)
mlir::LogicalResult emitOMPParallelMasterTaskLoopSimdDirective(const OMPParallelMasterTaskLoopSimdDirective &s)
mlir::LogicalResult emitOMPSimdDirective(const OMPSimdDirective &s)
mlir::LogicalResult emitOMPCriticalDirective(const OMPCriticalDirective &s)
mlir::LogicalResult emitOMPParallelMasterDirective(const OMPParallelMasterDirective &s)
mlir::LogicalResult emitOMPCancellationPointDirective(const OMPCancellationPointDirective &s)
mlir::LogicalResult emitOMPParallelMaskedTaskLoopDirective(const OMPParallelMaskedTaskLoopDirective &s)
mlir::LogicalResult emitOMPReverseDirective(const OMPReverseDirective &s)
mlir::LogicalResult emitOMPTileDirective(const OMPTileDirective &s)
mlir::LogicalResult emitOMPTargetTeamsDirective(const OMPTargetTeamsDirective &s)
mlir::LogicalResult emitOMPTeamsDistributeParallelForDirective(const OMPTeamsDistributeParallelForDirective &s)
mlir::LogicalResult emitOMPBarrierDirective(const OMPBarrierDirective &s)
mlir::LogicalResult emitOMPTargetParallelDirective(const OMPTargetParallelDirective &s)
void replaceAddrOfLocalVar(const clang::VarDecl *vd, Address addr)
mlir::LogicalResult emitOMPTargetDirective(const OMPTargetDirective &s)
Address getAddrOfLocalVar(const clang::VarDecl *vd)
Return the address of a local variable.
mlir::LogicalResult emitOMPScopeDirective(const OMPScopeDirective &s)
mlir::Location getLoc(clang::SourceLocation srcLoc)
Helpers to convert Clang's SourceLocation to a MLIR Location.
mlir::LogicalResult emitOMPDepobjDirective(const OMPDepobjDirective &s)
mlir::LogicalResult emitOMPDistributeParallelForSimdDirective(const OMPDistributeParallelForSimdDirective &s)
mlir::LogicalResult emitOMPUnrollDirective(const OMPUnrollDirective &s)
mlir::LogicalResult emitOMPTaskDirective(const OMPTaskDirective &s)
mlir::LogicalResult emitOMPTeamsGenericLoopDirective(const OMPTeamsGenericLoopDirective &s)
mlir::LogicalResult emitOMPCanonicalLoop(const OMPCanonicalLoop &s)
mlir::LogicalResult emitOMPTeamsDirective(const OMPTeamsDirective &s)
mlir::LogicalResult emitOMPMaskedTaskLoopDirective(const OMPMaskedTaskLoopDirective &s)
mlir::LogicalResult emitOMPFuseDirective(const OMPFuseDirective &s)
mlir::LogicalResult emitOMPSectionDirective(const OMPSectionDirective &s)
mlir::LogicalResult emitOMPParallelForSimdDirective(const OMPParallelForSimdDirective &s)
mlir::LogicalResult emitOMPDistributeParallelForDirective(const OMPDistributeParallelForDirective &s)
mlir::LogicalResult emitOMPOrderedStandaloneDirective(const OMPOrderedStandaloneDirective &s)
mlir::LogicalResult emitOMPMasterTaskLoopSimdDirective(const OMPMasterTaskLoopSimdDirective &s)
mlir::LogicalResult emitOMPTaskwaitDirective(const OMPTaskwaitDirective &s)
mlir::LogicalResult emitOMPFlushDirective(const OMPFlushDirective &s)
mlir::LogicalResult emitOMPGenericLoopDirective(const OMPGenericLoopDirective &s)
mlir::LogicalResult emitOMPTargetUpdateDirective(const OMPTargetUpdateDirective &s)
mlir::LogicalResult emitOMPTargetParallelForSimdDirective(const OMPTargetParallelForSimdDirective &s)
mlir::LogicalResult emitOMPInterchangeDirective(const OMPInterchangeDirective &s)
mlir::LogicalResult emitOMPDispatchDirective(const OMPDispatchDirective &s)
mlir::LogicalResult emitOMPParallelDirective(const OMPParallelDirective &s)
mlir::LogicalResult emitOMPForSimdDirective(const OMPForSimdDirective &s)
mlir::LogicalResult emitOMPTaskLoopDirective(const OMPTaskLoopDirective &s)
mlir::LogicalResult emitOMPTargetDataDirective(const OMPTargetDataDirective &s)
mlir::LogicalResult emitOMPTargetParallelGenericLoopDirective(const OMPTargetParallelGenericLoopDirective &s)
mlir::LogicalResult emitOMPParallelMaskedDirective(const OMPParallelMaskedDirective &s)
mlir::LogicalResult emitOMPMaskedTaskLoopSimdDirective(const OMPMaskedTaskLoopSimdDirective &s)
mlir::LogicalResult emitOMPAtomicDirective(const OMPAtomicDirective &s)
mlir::LogicalResult emitOMPTeamsDistributeParallelForSimdDirective(const OMPTeamsDistributeParallelForSimdDirective &s)
mlir::LogicalResult emitOMPTaskgroupDirective(const OMPTaskgroupDirective &s)
mlir::LogicalResult emitOMPParallelMaskedTaskLoopSimdDirective(const OMPParallelMaskedTaskLoopSimdDirective &s)
mlir::LogicalResult emitOMPTeamsDistributeDirective(const OMPTeamsDistributeDirective &s)
mlir::LogicalResult emitOMPInteropDirective(const OMPInteropDirective &s)
mlir::LogicalResult emitOMPErrorDirective(const OMPErrorDirective &s)
mlir::LogicalResult emitOMPSingleDirective(const OMPSingleDirective &s)
mlir::LogicalResult emitOMPTaskyieldDirective(const OMPTaskyieldDirective &s)
mlir::LogicalResult emitOMPTargetTeamsDistributeSimdDirective(const OMPTargetTeamsDistributeSimdDirective &s)
mlir::LogicalResult emitOMPScanDirective(const OMPScanDirective &s)
mlir::LogicalResult emitOMPTargetEnterDataDirective(const OMPTargetEnterDataDirective &s)
mlir::LogicalResult emitOMPMasterTaskLoopDirective(const OMPMasterTaskLoopDirective &s)
mlir::LogicalResult emitOMPForDirective(const OMPForDirective &s)
mlir::LogicalResult emitOMPMasterDirective(const OMPMasterDirective &s)
mlir::LogicalResult emitOMPMetaDirective(const OMPMetaDirective &s)
mlir::LogicalResult emitOMPDistributeSimdDirective(const OMPDistributeSimdDirective &s)
CIRGenBuilderTy & getBuilder()
mlir::LogicalResult emitOMPParallelGenericLoopDirective(const OMPParallelGenericLoopDirective &s)
mlir::LogicalResult emitOMPMaskedDirective(const OMPMaskedDirective &s)
mlir::LogicalResult emitOMPSplitDirective(const OMPSplitDirective &s)
mlir::MLIRContext & getMLIRContext()
mlir::LogicalResult emitOMPTargetExitDataDirective(const OMPTargetExitDataDirective &s)
mlir::LogicalResult emitOMPOrderedBlockAssocDirective(const OMPOrderedBlockAssocDirective &s)
mlir::LogicalResult emitOMPTargetTeamsDistributeParallelForDirective(const OMPTargetTeamsDistributeParallelForDirective &s)
mlir::LogicalResult emitOMPParallelForDirective(const OMPParallelForDirective &s)
mlir::LogicalResult emitOMPSectionsDirective(const OMPSectionsDirective &s)
mlir::LogicalResult emitOMPDistributeDirective(const OMPDistributeDirective &s)
mlir::LogicalResult emitOMPTargetTeamsDistributeParallelForSimdDirective(const OMPTargetTeamsDistributeParallelForSimdDirective &s)
mlir::LogicalResult emitOMPTargetTeamsGenericLoopDirective(const OMPTargetTeamsGenericLoopDirective &s)
mlir::LogicalResult emitOMPTeamsDistributeSimdDirective(const OMPTeamsDistributeSimdDirective &s)
mlir::LogicalResult emitOMPTaskLoopSimdDirective(const OMPTaskLoopSimdDirective &s)
mlir::LogicalResult emitOMPParallelMasterTaskLoopDirective(const OMPParallelMasterTaskLoopDirective &s)
mlir::LogicalResult emitStmt(const clang::Stmt *s, bool useCurrentScope, llvm::ArrayRef< const Attr * > attrs={})
mlir::LogicalResult emitOMPCancelDirective(const OMPCancelDirective &s)
mlir::LogicalResult emitOMPStripeDirective(const OMPStripeDirective &s)
mlir::LogicalResult emitOMPTargetTeamsDistributeDirective(const OMPTargetTeamsDistributeDirective &s)
mlir::LogicalResult emitOMPParallelSectionsDirective(const OMPParallelSectionsDirective &s)
mlir::LogicalResult emitOMPTargetSimdDirective(const OMPTargetSimdDirective &s)
mlir::LogicalResult emitOMPAssumeDirective(const OMPAssumeDirective &s)
DiagnosticBuilder errorNYI(SourceLocation, llvm::StringRef)
Helpers to emit "not yet implemented" error diagnostics.
Emits OpenMP clauses for a directive, writing results into the auto-generated ClauseOps from the OMP ...
bool emitMap(mlir::omp::MapClauseOps &result, llvm::SmallVectorImpl< const VarDecl * > *mapSyms=nullptr) const
Emit map clauses.
void emitNYI(OpenMPNYIClauseList< NYIClauses... > nyi, llvm::omp::Directive directive) const
Verify the clauses of a directive to make sure all legal cases are either implemented or give a NYI e...
bool emitProcBind(mlir::omp::ProcBindClauseOps &result) const
This captures a statement into a function.
Definition Stmt.h:3946
Stmt * getCapturedStmt()
Retrieve the statement being captured.
Definition Stmt.h:4050
capture_range captures()
Definition Stmt.h:4084
This represents clause 'allocate' in the 'pragma omp ...' directives.
This represents 'default' clause in the 'pragma omp ...' directive.
This represents 'if' clause in the 'pragma omp ...' directive.
This represents 'num_threads' clause in the 'pragma omp ...' directive.
Stmt - This represents one statement.
Definition Stmt.h:85
Represents a variable declaration or definition.
Definition Decl.h:932
Top level wrappers for InstallAPI frontend operations.
Represents a scope, including function bodies, compound statements, and the substatements of if/while...
A type-only list of OpenMP clause AST node types.