15#include "mlir/Dialect/OpenMP/OpenMPDialect.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");
57 res =
emitStmt(
s.getAssociatedStmt(),
true);
59 mlir::omp::TerminatorOp::create(builder, end);
67 return mlir::failure();
72 "OpenMP OMPTaskyieldDirective");
73 return mlir::failure();
77 mlir::omp::BarrierOp::create(builder,
getLoc(
s.getBeginLoc()));
78 assert(
s.clauses().empty() &&
"omp barrier doesn't support clauses");
79 return mlir::success();
84 return mlir::failure();
89 return mlir::failure();
94 return mlir::failure();
99 return mlir::failure();
104 return mlir::failure();
109 return mlir::failure();
114 return mlir::failure();
119 return mlir::failure();
124 return mlir::failure();
129 return mlir::failure();
134 return mlir::failure();
139 return mlir::failure();
144 return mlir::failure();
149 "OpenMP OMPParallelForDirective");
150 return mlir::failure();
153 const OMPParallelForSimdDirective &
s) {
155 "OpenMP OMPParallelForSimdDirective");
156 return mlir::failure();
159 const OMPParallelMasterDirective &
s) {
161 "OpenMP OMPParallelMasterDirective");
162 return mlir::failure();
165 const OMPParallelSectionsDirective &
s) {
167 "OpenMP OMPParallelSectionsDirective");
168 return mlir::failure();
173 return mlir::failure();
178 "OpenMP OMPTaskgroupDirective");
179 return mlir::failure();
184 return mlir::failure();
189 return mlir::failure();
194 return mlir::failure();
199 return mlir::failure();
204 return mlir::failure();
209 return mlir::failure();
214 return mlir::failure();
219 "OpenMP OMPCancellationPointDirective");
220 return mlir::failure();
225 return mlir::failure();
230 "OpenMP OMPTargetDataDirective");
231 return mlir::failure();
236 "OpenMP OMPTargetEnterDataDirective");
237 return mlir::failure();
242 "OpenMP OMPTargetExitDataDirective");
243 return mlir::failure();
248 "OpenMP OMPTargetParallelDirective");
249 return mlir::failure();
254 "OpenMP OMPTargetParallelForDirective");
255 return mlir::failure();
260 return mlir::failure();
265 "OpenMP OMPTaskLoopSimdDirective");
266 return mlir::failure();
271 "OpenMP OMPMaskedTaskLoopDirective");
272 return mlir::failure();
277 "OpenMP OMPMaskedTaskLoopSimdDirective");
278 return mlir::failure();
283 "OpenMP OMPMasterTaskLoopDirective");
284 return mlir::failure();
289 "OpenMP OMPMasterTaskLoopSimdDirective");
290 return mlir::failure();
295 "OpenMP OMPParallelGenericLoopDirective");
296 return mlir::failure();
299 const OMPParallelMaskedDirective &
s) {
301 "OpenMP OMPParallelMaskedDirective");
302 return mlir::failure();
307 "OpenMP OMPParallelMaskedTaskLoopDirective");
308 return mlir::failure();
313 "OpenMP OMPParallelMaskedTaskLoopSimdDirective");
314 return mlir::failure();
319 "OpenMP OMPParallelMasterTaskLoopDirective");
320 return mlir::failure();
325 "OpenMP OMPParallelMasterTaskLoopSimdDirective");
326 return mlir::failure();
331 "OpenMP OMPDistributeDirective");
332 return mlir::failure();
337 "OpenMP OMPDistributeParallelForDirective");
338 return mlir::failure();
343 "OpenMP OMPDistributeParallelForSimdDirective");
344 return mlir::failure();
349 "OpenMP OMPDistributeSimdDirective");
350 return mlir::failure();
355 "OpenMP OMPTargetParallelGenericLoopDirective");
356 return mlir::failure();
361 "OpenMP OMPTargetParallelForSimdDirective");
362 return mlir::failure();
367 "OpenMP OMPTargetSimdDirective");
368 return mlir::failure();
373 "OpenMP OMPTargetTeamsGenericLoopDirective");
374 return mlir::failure();
379 "OpenMP OMPTargetUpdateDirective");
380 return mlir::failure();
385 "OpenMP OMPTeamsDistributeDirective");
386 return mlir::failure();
391 "OpenMP OMPTeamsDistributeSimdDirective");
392 return mlir::failure();
398 s.getSourceRange(),
"OpenMP OMPTeamsDistributeParallelForSimdDirective");
399 return mlir::failure();
404 "OpenMP OMPTeamsDistributeParallelForDirective");
405 return mlir::failure();
410 "OpenMP OMPTeamsGenericLoopDirective");
411 return mlir::failure();
416 "OpenMP OMPTargetTeamsDirective");
417 return mlir::failure();
422 "OpenMP OMPTargetTeamsDistributeDirective");
423 return mlir::failure();
430 "OpenMP OMPTargetTeamsDistributeParallelForDirective");
431 return mlir::failure();
438 "OpenMP OMPTargetTeamsDistributeParallelForSimdDirective");
439 return mlir::failure();
444 "OpenMP OMPTargetTeamsDistributeSimdDirective");
445 return mlir::failure();
450 return mlir::failure();
455 return mlir::failure();
460 "OpenMP OMPGenericLoopDirective");
461 return mlir::failure();
466 return mlir::failure();
471 "OpenMP OMPInterchangeDirective");
472 return mlir::failure();
477 return mlir::failure();
482 return mlir::failure();
487 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.
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...