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
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.emitIf(clauseOps, llvm::omp::Directive::OMPD_parallel);
42 ce.emitProcBind(clauseOps);
43 ce.emitNYI</*supported=*/OMPIfClause, OMPProcBindClause>(
45 OMPDefaultClause, OMPFirstprivateClause,
46 OMPNumThreadsClause, OMPPrivateClause,
47 OMPReductionClause, OMPSharedClause>{},
48 llvm::omp::Directive::OMPD_parallel);
49
50 auto parallelOp = mlir::omp::ParallelOp::create(builder, begin, clauseOps);
51
52 {
53 mlir::Block &block = parallelOp.getRegion().emplaceBlock();
54 mlir::OpBuilder::InsertionGuard guardCase(builder);
55 builder.setInsertionPointToEnd(&block);
56
57 LexicalScope ls{*this, begin, builder.getInsertionBlock()};
58
59 if (s.hasCancel())
60 getCIRGenModule().errorNYI(s.getBeginLoc(),
61 "OpenMP Parallel with Cancel");
62 if (s.getTaskReductionRefExpr())
63 getCIRGenModule().errorNYI(s.getBeginLoc(),
64 "OpenMP Parallel with Task Reduction");
65 // Don't lower the captured statement directly since this will be
66 // special-cased depending on the kind of OpenMP directive that is the
67 // parent, also the non-OpenMP context captured statements lowering does
68 // not apply directly.
69 const CapturedStmt *cs = s.getCapturedStmt(llvm::omp::OMPD_parallel);
70 const Stmt *bodyStmt = cs->getCapturedStmt();
71 res = emitStmt(bodyStmt, /*useCurrentScope=*/true);
72 mlir::omp::TerminatorOp::create(builder, end);
73 }
74 return res;
75}
76
77mlir::LogicalResult
79 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPTaskwaitDirective");
80 return mlir::failure();
81}
82mlir::LogicalResult
84 getCIRGenModule().errorNYI(s.getSourceRange(),
85 "OpenMP OMPTaskyieldDirective");
86 return mlir::failure();
87}
88mlir::LogicalResult
90 mlir::omp::BarrierOp::create(builder, getLoc(s.getBeginLoc()));
91 assert(s.clauses().empty() && "omp barrier doesn't support clauses");
92 return mlir::success();
93}
94mlir::LogicalResult
96 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPMetaDirective");
97 return mlir::failure();
98}
99mlir::LogicalResult
100CIRGenFunction::emitOMPCanonicalLoop(const OMPCanonicalLoop &s) {
101 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPCanonicalLoop");
102 return mlir::failure();
103}
104mlir::LogicalResult
106 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPSimdDirective");
107 return mlir::failure();
108}
109mlir::LogicalResult
111 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPTileDirective");
112 return mlir::failure();
113}
114mlir::LogicalResult
116 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPUnrollDirective");
117 return mlir::failure();
118}
119mlir::LogicalResult
121 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPFuseDirective");
122 return mlir::failure();
123}
124mlir::LogicalResult
126 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPForDirective");
127 return mlir::failure();
128}
129mlir::LogicalResult
131 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPForSimdDirective");
132 return mlir::failure();
133}
134mlir::LogicalResult
136 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPSectionsDirective");
137 return mlir::failure();
138}
139mlir::LogicalResult
141 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPSectionDirective");
142 return mlir::failure();
143}
144mlir::LogicalResult
146 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPSingleDirective");
147 return mlir::failure();
148}
149mlir::LogicalResult
151 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPMasterDirective");
152 return mlir::failure();
153}
154mlir::LogicalResult
156 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPCriticalDirective");
157 return mlir::failure();
158}
159mlir::LogicalResult
161 getCIRGenModule().errorNYI(s.getSourceRange(),
162 "OpenMP OMPParallelForDirective");
163 return mlir::failure();
164}
167 getCIRGenModule().errorNYI(s.getSourceRange(),
168 "OpenMP OMPParallelForSimdDirective");
169 return mlir::failure();
170}
173 getCIRGenModule().errorNYI(s.getSourceRange(),
174 "OpenMP OMPParallelMasterDirective");
175 return mlir::failure();
176}
179 getCIRGenModule().errorNYI(s.getSourceRange(),
180 "OpenMP OMPParallelSectionsDirective");
181 return mlir::failure();
182}
183mlir::LogicalResult
185 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPTaskDirective");
186 return mlir::failure();
187}
188mlir::LogicalResult
190 getCIRGenModule().errorNYI(s.getSourceRange(),
191 "OpenMP OMPTaskgroupDirective");
192 return mlir::failure();
193}
194mlir::LogicalResult
196 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPFlushDirective");
197 return mlir::failure();
198}
199mlir::LogicalResult
201 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPDepobjDirective");
202 return mlir::failure();
203}
204mlir::LogicalResult
206 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPScanDirective");
207 return mlir::failure();
208}
211 getCIRGenModule().errorNYI(s.getSourceRange(),
212 "OpenMP OMPOrderedStandaloneDirective");
213 return mlir::failure();
214}
217 getCIRGenModule().errorNYI(s.getSourceRange(),
218 "OpenMP OMPOrderedBlockAssocDirective");
219 return mlir::failure();
220}
221mlir::LogicalResult
223 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPAtomicDirective");
224 return mlir::failure();
225}
226
227/// Check for unsupported implicit captures in a target region.
228static void
231 const CapturedStmt *cs = s.getCapturedStmt(llvm::omp::OMPD_target);
232 for (const auto &capture : cs->captures()) {
233 if (capture.capturesThis()) {
234 cgf.getCIRGenModule().errorNYI(s.getBeginLoc(),
235 "OpenMP target capture of 'this' pointer");
236 continue;
237 }
238 if (capture.capturesVariableByCopy()) {
239 cgf.getCIRGenModule().errorNYI(s.getBeginLoc(),
240 "OpenMP target capture by copy");
241 continue;
242 }
243 if (capture.capturesVariableArrayType()) {
245 s.getBeginLoc(),
246 "OpenMP target capture of variable-length array type");
247 continue;
248 }
249 if (capture.capturesVariable()) {
250 const VarDecl *vd = capture.getCapturedVar();
251 if (llvm::is_contained(mapSyms, vd))
252 continue;
253
254 cgf.getCIRGenModule().errorNYI(s.getBeginLoc(),
255 "OpenMP target implicit by-ref capture");
256 }
257 }
258}
259
260/// Emit the body of an omp.target region, remapping mapped variables to the
261/// block arguments of the target op's region.
262static mlir::LogicalResult
264 mlir::omp::TargetOp targetOp,
266 llvm::ArrayRef<const VarDecl *> mappedVarDecls,
267 mlir::Location begin, mlir::Location end) {
268 mlir::Block &block = targetOp.getRegion().emplaceBlock();
269
270 for (mlir::Value mapVar : mapVars)
271 block.addArgument(mapVar.getType(), begin);
272
273 mlir::OpBuilder::InsertionGuard guard(cgf.getBuilder());
274 cgf.getBuilder().setInsertionPointToEnd(&block);
275
276 CIRGenFunction::LexicalScope ls{cgf, begin,
277 cgf.getBuilder().getInsertionBlock()};
278
280 for (auto [idx, vd] : llvm::enumerate(mappedVarDecls)) {
281 Address origAddr = cgf.getAddrOfLocalVar(vd);
282 savedAddrs.push_back({vd, origAddr});
283 mlir::Value blockArg = block.getArgument(idx);
284 cgf.replaceAddrOfLocalVar(vd, Address(blockArg, origAddr.getAlignment()));
285 }
286
287 const CapturedStmt *cs = s.getCapturedStmt(llvm::omp::OMPD_target);
288 mlir::LogicalResult res =
289 cgf.emitStmt(cs->getCapturedStmt(), /*useCurrentScope=*/true);
290
291 mlir::omp::TerminatorOp::create(cgf.getBuilder(), end);
292
293 for (auto &[vd, addr] : savedAddrs)
294 cgf.replaceAddrOfLocalVar(vd, addr);
295
296 return res;
297}
298
299mlir::LogicalResult
301 mlir::Location begin = getLoc(s.getBeginLoc());
302 mlir::Location end = getLoc(s.getEndLoc());
303
304 mlir::omp::TargetExtOperands clauseOps;
306
307 OpenMPClauseEmitter ce(*this, getCIRGenModule(), builder, begin, s.clauses());
308 ce.emitMap(clauseOps, &mapSyms);
309 ce.emitNYI</*supported=*/OMPMapClause>(
310 /*nyi=*/OpenMPNYIClauseList<
312 OMPDependClause, OMPDeviceClause, OMPFirstprivateClause,
313 OMPHasDeviceAddrClause, OMPIfClause, OMPInReductionClause,
314 OMPIsDevicePtrClause, OMPNowaitClause, OMPPrivateClause,
316 llvm::omp::Directive::OMPD_target);
317
318 emitOMPTargetImplicitCaptures(*this, s, mapSyms);
319
320 // Use generic for now.
321 clauseOps.kernelType = mlir::omp::TargetExecModeAttr::get(
322 &getMLIRContext(), mlir::omp::TargetExecMode::generic);
323
324 auto targetOp = mlir::omp::TargetOp::create(builder, begin, clauseOps);
325
326 return emitOMPTargetBody(*this, s, targetOp, clauseOps.mapVars, mapSyms,
327 begin, end);
328}
329mlir::LogicalResult
331 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPTeamsDirective");
332 return mlir::failure();
333}
336 getCIRGenModule().errorNYI(s.getSourceRange(),
337 "OpenMP OMPCancellationPointDirective");
338 return mlir::failure();
339}
340mlir::LogicalResult
342 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPCancelDirective");
343 return mlir::failure();
344}
345mlir::LogicalResult
347 getCIRGenModule().errorNYI(s.getSourceRange(),
348 "OpenMP OMPTargetDataDirective");
349 return mlir::failure();
350}
353 getCIRGenModule().errorNYI(s.getSourceRange(),
354 "OpenMP OMPTargetEnterDataDirective");
355 return mlir::failure();
356}
359 getCIRGenModule().errorNYI(s.getSourceRange(),
360 "OpenMP OMPTargetExitDataDirective");
361 return mlir::failure();
362}
365 getCIRGenModule().errorNYI(s.getSourceRange(),
366 "OpenMP OMPTargetParallelDirective");
367 return mlir::failure();
368}
371 getCIRGenModule().errorNYI(s.getSourceRange(),
372 "OpenMP OMPTargetParallelForDirective");
373 return mlir::failure();
374}
375mlir::LogicalResult
377 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPTaskLoopDirective");
378 return mlir::failure();
379}
381 const OMPTaskLoopSimdDirective &s) {
382 getCIRGenModule().errorNYI(s.getSourceRange(),
383 "OpenMP OMPTaskLoopSimdDirective");
384 return mlir::failure();
385}
388 getCIRGenModule().errorNYI(s.getSourceRange(),
389 "OpenMP OMPMaskedTaskLoopDirective");
390 return mlir::failure();
391}
394 getCIRGenModule().errorNYI(s.getSourceRange(),
395 "OpenMP OMPMaskedTaskLoopSimdDirective");
396 return mlir::failure();
397}
400 getCIRGenModule().errorNYI(s.getSourceRange(),
401 "OpenMP OMPMasterTaskLoopDirective");
402 return mlir::failure();
403}
406 getCIRGenModule().errorNYI(s.getSourceRange(),
407 "OpenMP OMPMasterTaskLoopSimdDirective");
408 return mlir::failure();
409}
412 getCIRGenModule().errorNYI(s.getSourceRange(),
413 "OpenMP OMPParallelGenericLoopDirective");
414 return mlir::failure();
415}
418 getCIRGenModule().errorNYI(s.getSourceRange(),
419 "OpenMP OMPParallelMaskedDirective");
420 return mlir::failure();
421}
424 getCIRGenModule().errorNYI(s.getSourceRange(),
425 "OpenMP OMPParallelMaskedTaskLoopDirective");
426 return mlir::failure();
427}
430 getCIRGenModule().errorNYI(s.getSourceRange(),
431 "OpenMP OMPParallelMaskedTaskLoopSimdDirective");
432 return mlir::failure();
433}
436 getCIRGenModule().errorNYI(s.getSourceRange(),
437 "OpenMP OMPParallelMasterTaskLoopDirective");
438 return mlir::failure();
439}
442 getCIRGenModule().errorNYI(s.getSourceRange(),
443 "OpenMP OMPParallelMasterTaskLoopSimdDirective");
444 return mlir::failure();
445}
446mlir::LogicalResult
448 getCIRGenModule().errorNYI(s.getSourceRange(),
449 "OpenMP OMPDistributeDirective");
450 return mlir::failure();
451}
454 getCIRGenModule().errorNYI(s.getSourceRange(),
455 "OpenMP OMPDistributeParallelForDirective");
456 return mlir::failure();
457}
460 getCIRGenModule().errorNYI(s.getSourceRange(),
461 "OpenMP OMPDistributeParallelForSimdDirective");
462 return mlir::failure();
463}
466 getCIRGenModule().errorNYI(s.getSourceRange(),
467 "OpenMP OMPDistributeSimdDirective");
468 return mlir::failure();
469}
472 getCIRGenModule().errorNYI(s.getSourceRange(),
473 "OpenMP OMPTargetParallelGenericLoopDirective");
474 return mlir::failure();
475}
478 getCIRGenModule().errorNYI(s.getSourceRange(),
479 "OpenMP OMPTargetParallelForSimdDirective");
480 return mlir::failure();
481}
482mlir::LogicalResult
484 getCIRGenModule().errorNYI(s.getSourceRange(),
485 "OpenMP OMPTargetSimdDirective");
486 return mlir::failure();
487}
490 getCIRGenModule().errorNYI(s.getSourceRange(),
491 "OpenMP OMPTargetTeamsGenericLoopDirective");
492 return mlir::failure();
493}
495 const OMPTargetUpdateDirective &s) {
496 getCIRGenModule().errorNYI(s.getSourceRange(),
497 "OpenMP OMPTargetUpdateDirective");
498 return mlir::failure();
499}
502 getCIRGenModule().errorNYI(s.getSourceRange(),
503 "OpenMP OMPTeamsDistributeDirective");
504 return mlir::failure();
505}
508 getCIRGenModule().errorNYI(s.getSourceRange(),
509 "OpenMP OMPTeamsDistributeSimdDirective");
510 return mlir::failure();
511}
512mlir::LogicalResult
516 s.getSourceRange(), "OpenMP OMPTeamsDistributeParallelForSimdDirective");
517 return mlir::failure();
518}
521 getCIRGenModule().errorNYI(s.getSourceRange(),
522 "OpenMP OMPTeamsDistributeParallelForDirective");
523 return mlir::failure();
524}
527 getCIRGenModule().errorNYI(s.getSourceRange(),
528 "OpenMP OMPTeamsGenericLoopDirective");
529 return mlir::failure();
530}
531mlir::LogicalResult
533 getCIRGenModule().errorNYI(s.getSourceRange(),
534 "OpenMP OMPTargetTeamsDirective");
535 return mlir::failure();
536}
539 getCIRGenModule().errorNYI(s.getSourceRange(),
540 "OpenMP OMPTargetTeamsDistributeDirective");
541 return mlir::failure();
542}
543mlir::LogicalResult
547 s.getSourceRange(),
548 "OpenMP OMPTargetTeamsDistributeParallelForDirective");
549 return mlir::failure();
550}
551mlir::LogicalResult
555 s.getSourceRange(),
556 "OpenMP OMPTargetTeamsDistributeParallelForSimdDirective");
557 return mlir::failure();
558}
561 getCIRGenModule().errorNYI(s.getSourceRange(),
562 "OpenMP OMPTargetTeamsDistributeSimdDirective");
563 return mlir::failure();
564}
565mlir::LogicalResult
567 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPInteropDirective");
568 return mlir::failure();
569}
570mlir::LogicalResult
572 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPDispatchDirective");
573 return mlir::failure();
574}
575mlir::LogicalResult
577 getCIRGenModule().errorNYI(s.getSourceRange(),
578 "OpenMP OMPGenericLoopDirective");
579 return mlir::failure();
580}
581mlir::LogicalResult
583 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPReverseDirective");
584 return mlir::failure();
585}
586mlir::LogicalResult
588 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPSplitDirective");
589 return mlir::failure();
590}
591mlir::LogicalResult
593 getCIRGenModule().errorNYI(s.getSourceRange(),
594 "OpenMP OMPInterchangeDirective");
595 return mlir::failure();
596}
597mlir::LogicalResult
599 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPFlattenDirective");
600 return mlir::failure();
601}
602mlir::LogicalResult
604 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPAssumeDirective");
605 return mlir::failure();
606}
607mlir::LogicalResult
609 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPMaskedDirective");
610 return mlir::failure();
611}
612mlir::LogicalResult
614 getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPStripeDirective");
615 return mlir::failure();
616}
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 atomic' directive.
This represents 'pragma omp barrier' directive.
This represents 'pragma omp cancel' directive.
This represents 'pragma omp cancellation point' directive.
This represents clause 'copyin' in the 'pragma omp ...' directives.
This represents 'pragma omp critical' directive.
This represents 'defaultmap' clause in the 'pragma omp ...' directive.
This represents implicit clause 'depend' for the 'pragma omp task' directive.
This represents 'pragma omp depobj' 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 flatten' loop transformation directive.
This represents 'pragma omp flush' directive.
This represents 'pragma omp for' directive.
This represents 'pragma omp for simd' 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' directive.
This represents 'pragma omp master taskloop' directive.
This represents 'pragma omp master taskloop simd' directive.
This represents 'pragma omp metadirective' directive.
This represents block-associated 'pragma omp ordered' directive.
This represents standalone 'pragma omp ordered' directive.
This represents 'pragma omp parallel for' directive.
This represents 'pragma omp parallel for simd' directive.
This represents 'pragma omp parallel loop' directive.
This represents 'pragma omp parallel masked' directive.
This represents 'pragma omp parallel masked taskloop' directive.
This represents 'pragma omp parallel masked taskloop simd' directive.
This represents 'pragma omp parallel master' directive.
This represents 'pragma omp parallel master taskloop' directive.
This represents 'pragma omp parallel master taskloop simd' directive.
This represents 'pragma omp parallel sections' directive.
Represents the 'pragma omp reverse' loop transformation directive.
This represents 'pragma omp scan' directive.
This represents 'pragma omp scope' directive.
This represents 'pragma omp section' directive.
This represents 'pragma omp sections' directive.
This represents 'pragma omp simd' directive.
This represents 'pragma omp single' 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 task' directive.
This represents 'pragma omp taskloop' directive.
This represents 'pragma omp taskloop simd' directive.
This represents 'pragma omp taskgroup' directive.
This represents 'pragma omp taskwait' directive.
This represents 'pragma omp taskyield' 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 emitOMPFlattenDirective(const OMPFlattenDirective &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.
bool emitIf(mlir::omp::IfClauseOps &result, llvm::omp::Directive directiveName) const
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:3949
Stmt * getCapturedStmt()
Retrieve the statement being captured.
Definition Stmt.h:4053
capture_range captures()
Definition Stmt.h:4087
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:933
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.