clang 23.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}
208mlir::LogicalResult
209CIRGenFunction::emitOMPOrderedDirective(const OMPOrderedDirective &s) {
210 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPOrderedDirective");
211 return mlir::failure();
212}
213mlir::LogicalResult
214CIRGenFunction::emitOMPAtomicDirective(const OMPAtomicDirective &s) {
215 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPAtomicDirective");
216 return mlir::failure();
217}
218
219/// Check for unsupported implicit captures in a target region.
220static void
223 const CapturedStmt *cs = s.getCapturedStmt(llvm::omp::OMPD_target);
224 for (const auto &capture : cs->captures()) {
225 if (capture.capturesThis()) {
226 cgf.getCIRGenModule().errorNYI(s.getBeginLoc(),
227 "OpenMP target capture of 'this' pointer");
228 continue;
229 }
230 if (capture.capturesVariableByCopy()) {
231 cgf.getCIRGenModule().errorNYI(s.getBeginLoc(),
232 "OpenMP target capture by copy");
233 continue;
234 }
235 if (capture.capturesVariableArrayType()) {
237 s.getBeginLoc(),
238 "OpenMP target capture of variable-length array type");
239 continue;
240 }
241 if (capture.capturesVariable()) {
242 const VarDecl *vd = capture.getCapturedVar();
243 if (llvm::is_contained(mapSyms, vd))
244 continue;
245
246 cgf.getCIRGenModule().errorNYI(s.getBeginLoc(),
247 "OpenMP target implicit by-ref capture");
248 }
249 }
250}
251
252/// Emit the body of an omp.target region, remapping mapped variables to the
253/// block arguments of the target op's region.
254static mlir::LogicalResult
256 mlir::omp::TargetOp targetOp,
258 llvm::ArrayRef<const VarDecl *> mappedVarDecls,
259 mlir::Location begin, mlir::Location end) {
260 mlir::Block &block = targetOp.getRegion().emplaceBlock();
261
262 for (mlir::Value mapVar : mapVars)
263 block.addArgument(mapVar.getType(), begin);
264
265 mlir::OpBuilder::InsertionGuard guard(cgf.getBuilder());
266 cgf.getBuilder().setInsertionPointToEnd(&block);
267
268 CIRGenFunction::LexicalScope ls{cgf, begin,
269 cgf.getBuilder().getInsertionBlock()};
270
272 for (auto [idx, vd] : llvm::enumerate(mappedVarDecls)) {
273 Address origAddr = cgf.getAddrOfLocalVar(vd);
274 savedAddrs.push_back({vd, origAddr});
275 mlir::Value blockArg = block.getArgument(idx);
276 cgf.replaceAddrOfLocalVar(vd, Address(blockArg, origAddr.getAlignment()));
277 }
278
279 const CapturedStmt *cs = s.getCapturedStmt(llvm::omp::OMPD_target);
280 mlir::LogicalResult res =
281 cgf.emitStmt(cs->getCapturedStmt(), /*useCurrentScope=*/true);
282
283 mlir::omp::TerminatorOp::create(cgf.getBuilder(), end);
284
285 for (auto &[vd, addr] : savedAddrs)
286 cgf.replaceAddrOfLocalVar(vd, addr);
287
288 return res;
289}
290
291mlir::LogicalResult
293 mlir::Location begin = getLoc(s.getBeginLoc());
294 mlir::Location end = getLoc(s.getEndLoc());
295
296 mlir::omp::TargetExtOperands clauseOps;
298
299 OpenMPClauseEmitter ce(*this, getCIRGenModule(), builder, begin, s.clauses());
300 ce.emitMap(clauseOps, &mapSyms);
301 ce.emitNYI</*supported=*/OMPMapClause>(
302 /*nyi=*/OpenMPNYIClauseList<
304 OMPDependClause, OMPDeviceClause, OMPFirstprivateClause,
305 OMPHasDeviceAddrClause, OMPIfClause, OMPInReductionClause,
306 OMPIsDevicePtrClause, OMPNowaitClause, OMPPrivateClause,
308 llvm::omp::Directive::OMPD_target);
309
310 emitOMPTargetImplicitCaptures(*this, s, mapSyms);
311
312 // Use generic for now.
313 clauseOps.kernelType = mlir::omp::TargetExecModeAttr::get(
314 &getMLIRContext(), mlir::omp::TargetExecMode::generic);
315
316 auto targetOp = mlir::omp::TargetOp::create(builder, begin, clauseOps);
317
318 return emitOMPTargetBody(*this, s, targetOp, clauseOps.mapVars, mapSyms,
319 begin, end);
320}
321mlir::LogicalResult
323 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPTeamsDirective");
324 return mlir::failure();
325}
328 getCIRGenModule().errorNYI(s.getSourceRange(),
329 "OpenMP OMPCancellationPointDirective");
330 return mlir::failure();
331}
332mlir::LogicalResult
334 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPCancelDirective");
335 return mlir::failure();
336}
337mlir::LogicalResult
339 getCIRGenModule().errorNYI(s.getSourceRange(),
340 "OpenMP OMPTargetDataDirective");
341 return mlir::failure();
342}
345 getCIRGenModule().errorNYI(s.getSourceRange(),
346 "OpenMP OMPTargetEnterDataDirective");
347 return mlir::failure();
348}
351 getCIRGenModule().errorNYI(s.getSourceRange(),
352 "OpenMP OMPTargetExitDataDirective");
353 return mlir::failure();
354}
357 getCIRGenModule().errorNYI(s.getSourceRange(),
358 "OpenMP OMPTargetParallelDirective");
359 return mlir::failure();
360}
363 getCIRGenModule().errorNYI(s.getSourceRange(),
364 "OpenMP OMPTargetParallelForDirective");
365 return mlir::failure();
366}
367mlir::LogicalResult
369 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPTaskLoopDirective");
370 return mlir::failure();
371}
373 const OMPTaskLoopSimdDirective &s) {
374 getCIRGenModule().errorNYI(s.getSourceRange(),
375 "OpenMP OMPTaskLoopSimdDirective");
376 return mlir::failure();
377}
380 getCIRGenModule().errorNYI(s.getSourceRange(),
381 "OpenMP OMPMaskedTaskLoopDirective");
382 return mlir::failure();
383}
386 getCIRGenModule().errorNYI(s.getSourceRange(),
387 "OpenMP OMPMaskedTaskLoopSimdDirective");
388 return mlir::failure();
389}
392 getCIRGenModule().errorNYI(s.getSourceRange(),
393 "OpenMP OMPMasterTaskLoopDirective");
394 return mlir::failure();
395}
398 getCIRGenModule().errorNYI(s.getSourceRange(),
399 "OpenMP OMPMasterTaskLoopSimdDirective");
400 return mlir::failure();
401}
404 getCIRGenModule().errorNYI(s.getSourceRange(),
405 "OpenMP OMPParallelGenericLoopDirective");
406 return mlir::failure();
407}
409 const OMPParallelMaskedDirective &s) {
410 getCIRGenModule().errorNYI(s.getSourceRange(),
411 "OpenMP OMPParallelMaskedDirective");
412 return mlir::failure();
413}
416 getCIRGenModule().errorNYI(s.getSourceRange(),
417 "OpenMP OMPParallelMaskedTaskLoopDirective");
418 return mlir::failure();
419}
422 getCIRGenModule().errorNYI(s.getSourceRange(),
423 "OpenMP OMPParallelMaskedTaskLoopSimdDirective");
424 return mlir::failure();
425}
428 getCIRGenModule().errorNYI(s.getSourceRange(),
429 "OpenMP OMPParallelMasterTaskLoopDirective");
430 return mlir::failure();
431}
434 getCIRGenModule().errorNYI(s.getSourceRange(),
435 "OpenMP OMPParallelMasterTaskLoopSimdDirective");
436 return mlir::failure();
437}
438mlir::LogicalResult
440 getCIRGenModule().errorNYI(s.getSourceRange(),
441 "OpenMP OMPDistributeDirective");
442 return mlir::failure();
443}
446 getCIRGenModule().errorNYI(s.getSourceRange(),
447 "OpenMP OMPDistributeParallelForDirective");
448 return mlir::failure();
449}
452 getCIRGenModule().errorNYI(s.getSourceRange(),
453 "OpenMP OMPDistributeParallelForSimdDirective");
454 return mlir::failure();
455}
458 getCIRGenModule().errorNYI(s.getSourceRange(),
459 "OpenMP OMPDistributeSimdDirective");
460 return mlir::failure();
461}
464 getCIRGenModule().errorNYI(s.getSourceRange(),
465 "OpenMP OMPTargetParallelGenericLoopDirective");
466 return mlir::failure();
467}
470 getCIRGenModule().errorNYI(s.getSourceRange(),
471 "OpenMP OMPTargetParallelForSimdDirective");
472 return mlir::failure();
473}
474mlir::LogicalResult
476 getCIRGenModule().errorNYI(s.getSourceRange(),
477 "OpenMP OMPTargetSimdDirective");
478 return mlir::failure();
479}
482 getCIRGenModule().errorNYI(s.getSourceRange(),
483 "OpenMP OMPTargetTeamsGenericLoopDirective");
484 return mlir::failure();
485}
487 const OMPTargetUpdateDirective &s) {
488 getCIRGenModule().errorNYI(s.getSourceRange(),
489 "OpenMP OMPTargetUpdateDirective");
490 return mlir::failure();
491}
494 getCIRGenModule().errorNYI(s.getSourceRange(),
495 "OpenMP OMPTeamsDistributeDirective");
496 return mlir::failure();
497}
500 getCIRGenModule().errorNYI(s.getSourceRange(),
501 "OpenMP OMPTeamsDistributeSimdDirective");
502 return mlir::failure();
503}
504mlir::LogicalResult
508 s.getSourceRange(), "OpenMP OMPTeamsDistributeParallelForSimdDirective");
509 return mlir::failure();
510}
513 getCIRGenModule().errorNYI(s.getSourceRange(),
514 "OpenMP OMPTeamsDistributeParallelForDirective");
515 return mlir::failure();
516}
519 getCIRGenModule().errorNYI(s.getSourceRange(),
520 "OpenMP OMPTeamsGenericLoopDirective");
521 return mlir::failure();
522}
523mlir::LogicalResult
525 getCIRGenModule().errorNYI(s.getSourceRange(),
526 "OpenMP OMPTargetTeamsDirective");
527 return mlir::failure();
528}
531 getCIRGenModule().errorNYI(s.getSourceRange(),
532 "OpenMP OMPTargetTeamsDistributeDirective");
533 return mlir::failure();
534}
535mlir::LogicalResult
539 s.getSourceRange(),
540 "OpenMP OMPTargetTeamsDistributeParallelForDirective");
541 return mlir::failure();
542}
543mlir::LogicalResult
547 s.getSourceRange(),
548 "OpenMP OMPTargetTeamsDistributeParallelForSimdDirective");
549 return mlir::failure();
550}
553 getCIRGenModule().errorNYI(s.getSourceRange(),
554 "OpenMP OMPTargetTeamsDistributeSimdDirective");
555 return mlir::failure();
556}
557mlir::LogicalResult
559 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPInteropDirective");
560 return mlir::failure();
561}
562mlir::LogicalResult
564 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPDispatchDirective");
565 return mlir::failure();
566}
567mlir::LogicalResult
569 getCIRGenModule().errorNYI(s.getSourceRange(),
570 "OpenMP OMPGenericLoopDirective");
571 return mlir::failure();
572}
573mlir::LogicalResult
575 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPReverseDirective");
576 return mlir::failure();
577}
578mlir::LogicalResult
580 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPSplitDirective");
581 return mlir::failure();
582}
583mlir::LogicalResult
585 getCIRGenModule().errorNYI(s.getSourceRange(),
586 "OpenMP OMPInterchangeDirective");
587 return mlir::failure();
588}
589mlir::LogicalResult
591 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPAssumeDirective");
592 return mlir::failure();
593}
594mlir::LogicalResult
596 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPMaskedDirective");
597 return mlir::failure();
598}
599mlir::LogicalResult
601 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPStripeDirective");
602 return mlir::failure();
603}
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 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 emitOMPOrderedDirective(const OMPOrderedDirective &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 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:3947
Stmt * getCapturedStmt()
Retrieve the statement being captured.
Definition Stmt.h:4051
capture_range captures()
Definition Stmt.h:4085
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:86
Represents a variable declaration or definition.
Definition Decl.h:932
The JSON file list parser is used to communicate input to InstallAPI.
Represents a scope, including function bodies, compound statements, and the substatements of if/while...
A type-only list of OpenMP clause AST node types.