MLIR
18.0.0git
|
#include "mlir/Dialect/OpenMP/OpenMPDialect.h"
#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/Dialect/LLVMIR/LLVMTypes.h"
#include "mlir/Dialect/OpenACCMPCommon/Interfaces/AtomicInterfaces.h"
#include "mlir/IR/Attributes.h"
#include "mlir/IR/DialectImplementation.h"
#include "mlir/IR/OpImplementation.h"
#include "mlir/IR/OperationSupport.h"
#include "mlir/Interfaces/FoldInterfaces.h"
#include "llvm/ADT/BitVector.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/TypeSwitch.h"
#include "llvm/Frontend/OpenMP/OMPConstants.h"
#include <cstddef>
#include <optional>
#include "mlir/Dialect/OpenMP/OpenMPOpsDialect.cpp.inc"
#include "mlir/Dialect/OpenMP/OpenMPOpsEnums.cpp.inc"
#include "mlir/Dialect/OpenMP/OpenMPOpsInterfaces.cpp.inc"
#include "mlir/Dialect/OpenMP/OpenMPTypeInterfaces.cpp.inc"
#include "mlir/Dialect/OpenMP/OpenMPOps.cpp.inc"
#include "mlir/Dialect/OpenMP/OpenMPOpsAttributes.cpp.inc"
#include "mlir/Dialect/OpenMP/OpenMPOpsTypes.cpp.inc"
Go to the source code of this file.
Macros | |
#define | GET_OP_LIST |
#define | GET_ATTRDEF_LIST |
#define | GET_TYPEDEF_LIST |
#define | GET_ATTRDEF_CLASSES |
#define | GET_OP_CLASSES |
#define | GET_TYPEDEF_CLASSES |
Functions | |
static ParseResult | parseAllocateAndAllocator (OpAsmParser &parser, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &operandsAllocate, SmallVectorImpl< Type > &typesAllocate, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &operandsAllocator, SmallVectorImpl< Type > &typesAllocator) |
Parse an allocate clause with allocators and a list of operands with types. More... | |
static void | printAllocateAndAllocator (OpAsmPrinter &p, Operation *op, OperandRange varsAllocate, TypeRange typesAllocate, OperandRange varsAllocator, TypeRange typesAllocator) |
Print allocate clause. More... | |
template<typename ClauseAttr > | |
static ParseResult | parseClauseAttr (AsmParser &parser, ClauseAttr &attr) |
template<typename ClauseAttr > | |
void | printClauseAttr (OpAsmPrinter &p, Operation *op, ClauseAttr attr) |
static ParseResult | parseLinearClause (OpAsmParser &parser, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &vars, SmallVectorImpl< Type > &types, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &stepVars) |
linear ::= linear ( linear-list ) linear-list := linear-val | linear-val linear-list linear-val := ssa-id-and-type = ssa-id-and-type More... | |
static void | printLinearClause (OpAsmPrinter &p, Operation *op, ValueRange linearVars, TypeRange linearVarTypes, ValueRange linearStepVars) |
Print Linear Clause. More... | |
static LogicalResult | verifyNontemporalClause (Operation *op, OperandRange nontemporalVariables) |
static LogicalResult | verifyAlignedClause (Operation *op, std::optional< ArrayAttr > alignmentValues, OperandRange alignedVariables) |
static ParseResult | parseAlignedClause (OpAsmParser &parser, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &alignedItems, SmallVectorImpl< Type > &types, ArrayAttr &alignmentValues) |
aligned ::= aligned ( aligned-list ) aligned-list := aligned-val | aligned-val aligned-list aligned-val := ssa-id-and-type -> alignment More... | |
static void | printAlignedClause (OpAsmPrinter &p, Operation *op, ValueRange alignedVars, TypeRange alignedVarTypes, std::optional< ArrayAttr > alignmentValues) |
Print Aligned Clause. More... | |
static ParseResult | verifyScheduleModifiers (OpAsmParser &parser, SmallVectorImpl< SmallString< 12 >> &modifiers) |
static ParseResult | parseScheduleClause (OpAsmParser &parser, ClauseScheduleKindAttr &scheduleAttr, ScheduleModifierAttr &scheduleModifier, UnitAttr &simdModifier, std::optional< OpAsmParser::UnresolvedOperand > &chunkSize, Type &chunkType) |
schedule ::= schedule ( sched-list ) sched-list ::= sched-val | sched-val sched-list | sched-val , sched-modifier sched-val ::= sched-with-chunk | sched-wo-chunk sched-with-chunk ::= sched-with-chunk-types (= ssa-id-and-type)? sched-with-chunk-types ::= static | dynamic | guided sched-wo-chunk ::= auto | runtime sched-modifier ::= sched-mod-val | sched-mod-val , sched-mod-val sched-mod-val ::= monotonic | nonmonotonic | simd | none More... | |
static void | printScheduleClause (OpAsmPrinter &p, Operation *op, ClauseScheduleKindAttr schedAttr, ScheduleModifierAttr modifier, UnitAttr simd, Value scheduleChunkVar, Type scheduleChunkType) |
Print schedule clause. More... | |
static ParseResult | parseReductionVarList (OpAsmParser &parser, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &operands, SmallVectorImpl< Type > &types, ArrayAttr &redcuctionSymbols) |
reduction-entry-list ::= reduction-entry | reduction-entry-list , reduction-entry reduction-entry ::= symbol-ref -> ssa-id : type More... | |
static void | printReductionVarList (OpAsmPrinter &p, Operation *op, OperandRange reductionVars, TypeRange reductionTypes, std::optional< ArrayAttr > reductions) |
Print Reduction clause. More... | |
static LogicalResult | verifyReductionVarList (Operation *op, std::optional< ArrayAttr > reductions, OperandRange reductionVars) |
Verifies Reduction Clause. More... | |
static ParseResult | parseDependVarList (OpAsmParser &parser, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &operands, SmallVectorImpl< Type > &types, ArrayAttr &dependsArray) |
depend-entry-list ::= depend-entry | depend-entry-list , depend-entry depend-entry ::= depend-kind -> ssa-id : type More... | |
static void | printDependVarList (OpAsmPrinter &p, Operation *op, OperandRange dependVars, TypeRange dependTypes, std::optional< ArrayAttr > depends) |
Print Depend clause. More... | |
static LogicalResult | verifyDependVarList (Operation *op, std::optional< ArrayAttr > depends, OperandRange dependVars) |
Verifies Depend clause. More... | |
static ParseResult | parseSynchronizationHint (OpAsmParser &parser, IntegerAttr &hintAttr) |
Parses a Synchronization Hint clause. More... | |
static void | printSynchronizationHint (OpAsmPrinter &p, Operation *op, IntegerAttr hintAttr) |
Prints a Synchronization Hint clause. More... | |
static LogicalResult | verifySynchronizationHint (Operation *op, uint64_t hint) |
Verifies a synchronization hint clause. More... | |
uint64_t | mapTypeToBitFlag (uint64_t value, llvm::omp::OpenMPOffloadMappingFlags flag) |
static ParseResult | parseMapClause (OpAsmParser &parser, IntegerAttr &mapType) |
Parses a map_entries map type from a string format back into its numeric value. More... | |
static void | printMapClause (OpAsmPrinter &p, Operation *op, IntegerAttr mapType) |
Prints a map_entries map type from its numeric value out into its string format. More... | |
static void | printCaptureType (OpAsmPrinter &p, Operation *op, VariableCaptureKindAttr mapCaptureType) |
static ParseResult | parseCaptureType (OpAsmParser &parser, VariableCaptureKindAttr &mapCapture) |
static LogicalResult | verifyMapClause (Operation *op, OperandRange mapOperands) |
static bool | opInGlobalImplicitParallelRegion (Operation *op) |
ParseResult | parseLoopControl (OpAsmParser &parser, Region ®ion, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &lowerBound, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &upperBound, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &steps, SmallVectorImpl< Type > &loopVarTypes, UnitAttr &inclusive) |
loop-control ::= ( ssa-id-list ) : type = loop-bounds loop-bounds := ( ssa-id-list ) to ( ssa-id-list ) inclusive? steps steps := step ( ssa-id-list) More... | |
void | printLoopControl (OpAsmPrinter &p, Operation *op, Region ®ion, ValueRange lowerBound, ValueRange upperBound, ValueRange steps, TypeRange loopVarTypes, UnitAttr inclusive) |
static ParseResult | parseAtomicReductionRegion (OpAsmParser &parser, Region ®ion) |
static void | printAtomicReductionRegion (OpAsmPrinter &printer, ReductionDeclareOp op, Region ®ion) |
#define GET_ATTRDEF_CLASSES |
Definition at line 1483 of file OpenMPDialect.cpp.
#define GET_ATTRDEF_LIST |
#define GET_OP_CLASSES |
Definition at line 1486 of file OpenMPDialect.cpp.
#define GET_OP_LIST |
#define GET_TYPEDEF_CLASSES |
Definition at line 1489 of file OpenMPDialect.cpp.
#define GET_TYPEDEF_LIST |
uint64_t mapTypeToBitFlag | ( | uint64_t | value, |
llvm::omp::OpenMPOffloadMappingFlags | flag | ||
) |
Definition at line 669 of file OpenMPDialect.cpp.
|
static |
Definition at line 908 of file OpenMPDialect.cpp.
|
static |
aligned ::= aligned
(
aligned-list )
aligned-list := aligned-val | aligned-val aligned-list aligned-val := ssa-id-and-type ->
alignment
Definition at line 276 of file OpenMPDialect.cpp.
References mlir::failed(), mlir::AsmParser::parseCommaSeparatedList(), and mlir::success().
|
static |
Parse an allocate clause with allocators and a list of operands with types.
allocate-operand-list :: = allocate-operand | allocator-operand ,
allocate-operand-list allocate-operand :: = ssa-id-and-type -> ssa-id-and-type ssa-id-and-type ::= ssa-id :
type
Definition at line 116 of file OpenMPDialect.cpp.
References mlir::failure(), mlir::AsmParser::parseArrow(), mlir::AsmParser::parseColonType(), mlir::AsmParser::parseCommaSeparatedList(), mlir::OpAsmParser::parseOperand(), and mlir::success().
|
static |
Definition at line 1060 of file OpenMPDialect.cpp.
References mlir::AsmParser::parseOptionalKeyword(), mlir::OpAsmParser::parseRegion(), and mlir::success().
|
static |
Definition at line 798 of file OpenMPDialect.cpp.
References mlir::failure(), mlir::get(), mlir::AsmParser::getContext(), mlir::AsmParser::parseKeyword(), and mlir::success().
|
static |
Definition at line 159 of file OpenMPDialect.cpp.
References mlir::AsmParser::emitError(), mlir::failure(), mlir::get(), mlir::AsmParser::getContext(), mlir::AsmParser::getCurrentLocation(), mlir::AsmParser::parseKeyword(), and mlir::success().
|
static |
depend-entry-list ::= depend-entry | depend-entry-list ,
depend-entry depend-entry ::= depend-kind ->
ssa-id :
type
Definition at line 519 of file OpenMPDialect.cpp.
References mlir::failed(), mlir::failure(), mlir::get(), mlir::AsmParser::getContext(), mlir::AsmParser::parseCommaSeparatedList(), and mlir::success().
|
static |
linear ::= linear
(
linear-list )
linear-list := linear-val | linear-val linear-list linear-val := ssa-id-and-type =
ssa-id-and-type
Definition at line 185 of file OpenMPDialect.cpp.
References mlir::failure(), mlir::AsmParser::parseColonType(), mlir::AsmParser::parseCommaSeparatedList(), mlir::AsmParser::parseEqual(), mlir::OpAsmParser::parseOperand(), and mlir::success().
ParseResult parseLoopControl | ( | OpAsmParser & | parser, |
Region & | region, | ||
SmallVectorImpl< OpAsmParser::UnresolvedOperand > & | lowerBound, | ||
SmallVectorImpl< OpAsmParser::UnresolvedOperand > & | upperBound, | ||
SmallVectorImpl< OpAsmParser::UnresolvedOperand > & | steps, | ||
SmallVectorImpl< Type > & | loopVarTypes, | ||
UnitAttr & | inclusive | ||
) |
loop-control ::= (
ssa-id-list )
:
type =
loop-bounds loop-bounds := (
ssa-id-list )
to (
ssa-id-list )
inclusive? steps steps := step
(
ssa-id-list)
Definition at line 986 of file OpenMPDialect.cpp.
References mlir::failure(), mlir::get(), mlir::AsmParser::getBuilder(), mlir::Builder::getContext(), mlir::AsmParser::Paren, mlir::OpAsmParser::parseArgumentList(), mlir::AsmParser::parseColonType(), mlir::AsmParser::parseEqual(), mlir::AsmParser::parseKeyword(), mlir::OpAsmParser::parseOperandList(), mlir::AsmParser::parseOptionalKeyword(), mlir::OpAsmParser::parseRegion(), and mlir::succeeded().
|
static |
Parses a map_entries map type from a string format back into its numeric value.
map-clause = map_clauses ( (
(always, ?
close, ?
present, ? (
to|
from|
delete))+
)` )
Definition at line 682 of file OpenMPDialect.cpp.
References mlir::failure(), mlir::AsmParser::getBuilder(), mlir::Builder::getIntegerAttr(), mlir::Builder::getIntegerType(), mlir::AsmParser::parseCommaSeparatedList(), mlir::AsmParser::parseKeyword(), and mlir::success().
|
static |
reduction-entry-list ::= reduction-entry | reduction-entry-list ,
reduction-entry reduction-entry ::= symbol-ref ->
ssa-id :
type
Definition at line 437 of file OpenMPDialect.cpp.
References mlir::failed(), mlir::failure(), mlir::get(), mlir::AsmParser::getContext(), mlir::AsmParser::parseCommaSeparatedList(), and mlir::success().
|
static |
schedule ::= schedule
(
sched-list )
sched-list ::= sched-val | sched-val sched-list | sched-val ,
sched-modifier sched-val ::= sched-with-chunk | sched-wo-chunk sched-with-chunk ::= sched-with-chunk-types (=
ssa-id-and-type)? sched-with-chunk-types ::= static
| dynamic
| guided
sched-wo-chunk ::= auto
| runtime
sched-modifier ::= sched-mod-val | sched-mod-val ,
sched-mod-val sched-mod-val ::= monotonic
| nonmonotonic
| simd
| none
Definition at line 354 of file OpenMPDialect.cpp.
References mlir::AsmParser::emitError(), mlir::failure(), mlir::get(), mlir::AsmParser::getBuilder(), mlir::Builder::getContext(), mlir::AsmParser::getContext(), mlir::AsmParser::getCurrentLocation(), mlir::AsmParser::getNameLoc(), mlir::mod(), mlir::AsmParser::parseColonType(), mlir::AsmParser::parseKeyword(), mlir::OpAsmParser::parseOperand(), mlir::AsmParser::parseOptionalComma(), mlir::AsmParser::parseOptionalEqual(), mlir::succeeded(), mlir::success(), and verifyScheduleModifiers().
|
static |
Parses a Synchronization Hint clause.
The value of hint is an integer which is a combination of different hints from omp_sync_hint_t
.
hint-clause = hint
(
hint-value )
Definition at line 583 of file OpenMPDialect.cpp.
References mlir::AsmParser::emitError(), mlir::failed(), mlir::failure(), mlir::get(), mlir::AsmParser::getBuilder(), mlir::AsmParser::getCurrentLocation(), mlir::Builder::getI64Type(), mlir::AsmParser::parseCommaSeparatedList(), mlir::AsmParser::parseKeyword(), mlir::AsmParser::parseOptionalKeyword(), mlir::succeeded(), and mlir::success().
|
static |
Print Aligned Clause.
Definition at line 297 of file OpenMPDialect.cpp.
|
static |
Print allocate clause.
Definition at line 142 of file OpenMPDialect.cpp.
|
static |
Definition at line 1067 of file OpenMPDialect.cpp.
|
static |
Definition at line 783 of file OpenMPDialect.cpp.
void printClauseAttr | ( | OpAsmPrinter & | p, |
Operation * | op, | ||
ClauseAttr | attr | ||
) |
Definition at line 173 of file OpenMPDialect.cpp.
|
static |
Print Depend clause.
Definition at line 544 of file OpenMPDialect.cpp.
|
static |
Print Linear Clause.
Definition at line 205 of file OpenMPDialect.cpp.
void printLoopControl | ( | OpAsmPrinter & | p, |
Operation * | op, | ||
Region & | region, | ||
ValueRange | lowerBound, | ||
ValueRange | upperBound, | ||
ValueRange | steps, | ||
TypeRange | loopVarTypes, | ||
UnitAttr | inclusive | ||
) |
Definition at line 1020 of file OpenMPDialect.cpp.
|
static |
Prints a map_entries map type from its numeric value out into its string format.
Definition at line 731 of file OpenMPDialect.cpp.
|
static |
Print Reduction clause.
Definition at line 457 of file OpenMPDialect.cpp.
|
static |
Print schedule clause.
Definition at line 415 of file OpenMPDialect.cpp.
|
static |
Prints a Synchronization Hint clause.
Definition at line 614 of file OpenMPDialect.cpp.
|
static |
Definition at line 238 of file OpenMPDialect.cpp.
|
static |
Verifies Depend clause.
Definition at line 559 of file OpenMPDialect.cpp.
|
static |
Definition at line 820 of file OpenMPDialect.cpp.
|
static |
Definition at line 223 of file OpenMPDialect.cpp.
|
static |
Verifies Reduction Clause.
Definition at line 470 of file OpenMPDialect.cpp.
|
static |
Definition at line 314 of file OpenMPDialect.cpp.
References mlir::AsmParser::emitError(), mlir::AsmParser::getNameLoc(), mlir::mod(), and mlir::success().
Referenced by parseScheduleClause().
|
static |
Verifies a synchronization hint clause.
Definition at line 645 of file OpenMPDialect.cpp.