15#include "mlir/Dialect/OpenMP/OpenMPDialect.h"
17#include "llvm/Frontend/OpenMP/OMPConstants.h"
24 return mlir::failure();
29 return mlir::failure();
33 mlir::LogicalResult res = mlir::success();
36 mlir::Location begin =
getLoc(
s.getBeginLoc());
37 mlir::Location end =
getLoc(
s.getEndLoc());
40 mlir::omp::ParallelOp::create(builder, begin, retTy, operands);
41 emitOpenMPClauses(parallelOp,
s.clauses());
44 mlir::Block &block = parallelOp.getRegion().emplaceBlock();
45 mlir::OpBuilder::InsertionGuard guardCase(builder);
46 builder.setInsertionPointToEnd(&block);
48 LexicalScope ls{*
this, begin, builder.getInsertionBlock()};
52 "OpenMP Parallel with Cancel");
53 if (
s.getTaskReductionRefExpr())
55 "OpenMP Parallel with Task Reduction");
60 const CapturedStmt *cs =
s.getCapturedStmt(llvm::omp::OMPD_parallel);
63 mlir::omp::TerminatorOp::create(builder, end);
71 return mlir::failure();
76 "OpenMP OMPTaskyieldDirective");
77 return mlir::failure();
81 mlir::omp::BarrierOp::create(builder,
getLoc(
s.getBeginLoc()));
82 assert(
s.clauses().empty() &&
"omp barrier doesn't support clauses");
83 return mlir::success();
88 return mlir::failure();
93 return mlir::failure();
98 return mlir::failure();
103 return mlir::failure();
108 return mlir::failure();
113 return mlir::failure();
118 return mlir::failure();
123 return mlir::failure();
128 return mlir::failure();
133 return mlir::failure();
138 return mlir::failure();
143 return mlir::failure();
148 return mlir::failure();
153 "OpenMP OMPParallelForDirective");
154 return mlir::failure();
157 const OMPParallelForSimdDirective &
s) {
159 "OpenMP OMPParallelForSimdDirective");
160 return mlir::failure();
163 const OMPParallelMasterDirective &
s) {
165 "OpenMP OMPParallelMasterDirective");
166 return mlir::failure();
169 const OMPParallelSectionsDirective &
s) {
171 "OpenMP OMPParallelSectionsDirective");
172 return mlir::failure();
177 return mlir::failure();
182 "OpenMP OMPTaskgroupDirective");
183 return mlir::failure();
188 return mlir::failure();
193 return mlir::failure();
198 return mlir::failure();
203 return mlir::failure();
208 return mlir::failure();
213 return mlir::failure();
218 return mlir::failure();
223 "OpenMP OMPCancellationPointDirective");
224 return mlir::failure();
229 return mlir::failure();
234 "OpenMP OMPTargetDataDirective");
235 return mlir::failure();
240 "OpenMP OMPTargetEnterDataDirective");
241 return mlir::failure();
246 "OpenMP OMPTargetExitDataDirective");
247 return mlir::failure();
252 "OpenMP OMPTargetParallelDirective");
253 return mlir::failure();
258 "OpenMP OMPTargetParallelForDirective");
259 return mlir::failure();
264 return mlir::failure();
269 "OpenMP OMPTaskLoopSimdDirective");
270 return mlir::failure();
275 "OpenMP OMPMaskedTaskLoopDirective");
276 return mlir::failure();
281 "OpenMP OMPMaskedTaskLoopSimdDirective");
282 return mlir::failure();
287 "OpenMP OMPMasterTaskLoopDirective");
288 return mlir::failure();
293 "OpenMP OMPMasterTaskLoopSimdDirective");
294 return mlir::failure();
299 "OpenMP OMPParallelGenericLoopDirective");
300 return mlir::failure();
303 const OMPParallelMaskedDirective &
s) {
305 "OpenMP OMPParallelMaskedDirective");
306 return mlir::failure();
311 "OpenMP OMPParallelMaskedTaskLoopDirective");
312 return mlir::failure();
317 "OpenMP OMPParallelMaskedTaskLoopSimdDirective");
318 return mlir::failure();
323 "OpenMP OMPParallelMasterTaskLoopDirective");
324 return mlir::failure();
329 "OpenMP OMPParallelMasterTaskLoopSimdDirective");
330 return mlir::failure();
335 "OpenMP OMPDistributeDirective");
336 return mlir::failure();
341 "OpenMP OMPDistributeParallelForDirective");
342 return mlir::failure();
347 "OpenMP OMPDistributeParallelForSimdDirective");
348 return mlir::failure();
353 "OpenMP OMPDistributeSimdDirective");
354 return mlir::failure();
359 "OpenMP OMPTargetParallelGenericLoopDirective");
360 return mlir::failure();
365 "OpenMP OMPTargetParallelForSimdDirective");
366 return mlir::failure();
371 "OpenMP OMPTargetSimdDirective");
372 return mlir::failure();
377 "OpenMP OMPTargetTeamsGenericLoopDirective");
378 return mlir::failure();
383 "OpenMP OMPTargetUpdateDirective");
384 return mlir::failure();
389 "OpenMP OMPTeamsDistributeDirective");
390 return mlir::failure();
395 "OpenMP OMPTeamsDistributeSimdDirective");
396 return mlir::failure();
402 s.getSourceRange(),
"OpenMP OMPTeamsDistributeParallelForSimdDirective");
403 return mlir::failure();
408 "OpenMP OMPTeamsDistributeParallelForDirective");
409 return mlir::failure();
414 "OpenMP OMPTeamsGenericLoopDirective");
415 return mlir::failure();
420 "OpenMP OMPTargetTeamsDirective");
421 return mlir::failure();
426 "OpenMP OMPTargetTeamsDistributeDirective");
427 return mlir::failure();
434 "OpenMP OMPTargetTeamsDistributeParallelForDirective");
435 return mlir::failure();
442 "OpenMP OMPTargetTeamsDistributeParallelForSimdDirective");
443 return mlir::failure();
448 "OpenMP OMPTargetTeamsDistributeSimdDirective");
449 return mlir::failure();
454 return mlir::failure();
459 return mlir::failure();
464 "OpenMP OMPGenericLoopDirective");
465 return mlir::failure();
470 return mlir::failure();
475 "OpenMP OMPInterchangeDirective");
476 return mlir::failure();
481 return mlir::failure();
486 return mlir::failure();
491 return mlir::failure();
This file defines OpenMP AST classes for executable directives and clauses.
__device__ __2f16 float __ockl_bool s
This represents 'pragma omp cancel' directive.
This represents 'pragma omp cancellation point' 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.
Represents the 'pragma omp interchange' loop transformation directive.
This represents 'pragma omp interop' directive.
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 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.
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 the 'pragma omp tile' loop transformation directive.
This represents the 'pragma omp unroll' loop transformation directive.
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)
mlir::LogicalResult emitOMPTargetDirective(const OMPTargetDirective &s)
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)
mlir::LogicalResult emitOMPParallelGenericLoopDirective(const OMPParallelGenericLoopDirective &s)
mlir::LogicalResult emitOMPMaskedDirective(const OMPMaskedDirective &s)
CIRGenModule & getCIRGenModule()
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.
This captures a statement into a function.
Stmt * getCapturedStmt()
Retrieve the statement being captured.
Stmt - This represents one statement.
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...