MLIR
20.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/BuiltinAttributes.h"
#include "mlir/IR/DialectImplementation.h"
#include "mlir/IR/OpImplementation.h"
#include "mlir/IR/OperationSupport.h"
#include "mlir/Interfaces/FoldInterfaces.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/BitVector.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/STLForwardCompat.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 <iterator>
#include <optional>
#include <variant>
#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 ArrayAttr | makeArrayAttr (MLIRContext *context, llvm::ArrayRef< Attribute > attrs) |
static DenseBoolArrayAttr | makeDenseBoolArrayAttr (MLIRContext *ctx, const ArrayRef< bool > boolArray) |
static ParseResult | parseAllocateAndAllocator (OpAsmParser &parser, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &allocateVars, SmallVectorImpl< Type > &allocateTypes, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &allocatorVars, SmallVectorImpl< Type > &allocatorTypes) |
Parse an allocate clause with allocators and a list of operands with types. More... | |
static void | printAllocateAndAllocator (OpAsmPrinter &p, Operation *op, OperandRange allocateVars, TypeRange allocateTypes, OperandRange allocatorVars, TypeRange allocatorTypes) |
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 > &linearVars, SmallVectorImpl< Type > &linearTypes, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &linearStepVars) |
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 linearTypes, ValueRange linearStepVars) |
Print Linear Clause. More... | |
static LogicalResult | verifyNontemporalClause (Operation *op, OperandRange nontemporalVars) |
static LogicalResult | verifyAlignedClause (Operation *op, std::optional< ArrayAttr > alignments, OperandRange alignedVars) |
static ParseResult | parseAlignedClause (OpAsmParser &parser, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &alignedVars, SmallVectorImpl< Type > &alignedTypes, ArrayAttr &alignmentsAttr) |
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 alignedTypes, std::optional< ArrayAttr > alignments) |
Print Aligned Clause. More... | |
static ParseResult | verifyScheduleModifiers (OpAsmParser &parser, SmallVectorImpl< SmallString< 12 >> &modifiers) |
static ParseResult | parseScheduleClause (OpAsmParser &parser, ClauseScheduleKindAttr &scheduleAttr, ScheduleModifierAttr &scheduleMod, UnitAttr &scheduleSimd, 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 scheduleKind, ScheduleModifierAttr scheduleMod, UnitAttr scheduleSimd, Value scheduleChunk, Type scheduleChunkType) |
Print schedule clause. More... | |
static ParseResult | parseOrderClause (OpAsmParser &parser, ClauseOrderKindAttr &order, OrderModifierAttr &orderMod) |
static void | printOrderClause (OpAsmPrinter &p, Operation *op, ClauseOrderKindAttr order, OrderModifierAttr orderMod) |
static ParseResult | parseClauseWithRegionArgs (OpAsmParser &parser, Region ®ion, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &operands, SmallVectorImpl< Type > &types, DenseBoolArrayAttr &byref, ArrayAttr &symbols, SmallVectorImpl< OpAsmParser::Argument > ®ionPrivateArgs) |
static void | printClauseWithRegionArgs (OpAsmPrinter &p, Operation *op, ValueRange argsSubrange, StringRef clauseName, ValueRange operands, TypeRange types, DenseBoolArrayAttr byref, ArrayAttr symbols) |
static ParseResult | parseParallelRegion (OpAsmParser &parser, Region ®ion, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &reductionVars, SmallVectorImpl< Type > &reductionTypes, DenseBoolArrayAttr &reductionByref, ArrayAttr &reductionSyms, llvm::SmallVectorImpl< OpAsmParser::UnresolvedOperand > &privateVars, llvm::SmallVectorImpl< Type > &privateTypes, ArrayAttr &privateSyms) |
static void | printParallelRegion (OpAsmPrinter &p, Operation *op, Region ®ion, ValueRange reductionVars, TypeRange reductionTypes, DenseBoolArrayAttr reductionByref, ArrayAttr reductionSyms, ValueRange privateVars, TypeRange privateTypes, ArrayAttr privateSyms) |
static ParseResult | parseReductionVarList (OpAsmParser &parser, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &reductionVars, SmallVectorImpl< Type > &reductionTypes, DenseBoolArrayAttr &reductionByref, ArrayAttr &reductionSyms) |
reduction-entry-list ::= reduction-entry | reduction-entry-list , reduction-entry reduction-entry ::= (byref )? symbol-ref -> ssa-id : type More... | |
static void | printReductionVarList (OpAsmPrinter &p, Operation *op, OperandRange reductionVars, TypeRange reductionTypes, std::optional< DenseBoolArrayAttr > reductionByref, std::optional< ArrayAttr > reductionSyms) |
Print Reduction clause. More... | |
static LogicalResult | verifyReductionVarList (Operation *op, std::optional< ArrayAttr > reductionSyms, OperandRange reductionVars, std::optional< ArrayRef< bool >> reductionByref) |
Verifies Reduction Clause. More... | |
static ParseResult | parseCopyprivate (OpAsmParser &parser, SmallVectorImpl< OpAsmParser::UnresolvedOperand > ©privateVars, SmallVectorImpl< Type > ©privateTypes, ArrayAttr ©privateSyms) |
copyprivate-entry-list ::= copyprivate-entry | copyprivate-entry-list , copyprivate-entry copyprivate-entry ::= ssa-id -> symbol-ref : type More... | |
static void | printCopyprivate (OpAsmPrinter &p, Operation *op, OperandRange copyprivateVars, TypeRange copyprivateTypes, std::optional< ArrayAttr > copyprivateSyms) |
Print Copyprivate clause. More... | |
static LogicalResult | verifyCopyprivateVarList (Operation *op, OperandRange copyprivateVars, std::optional< ArrayAttr > copyprivateSyms) |
Verifies CopyPrivate Clause. More... | |
static ParseResult | parseDependVarList (OpAsmParser &parser, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &dependVars, SmallVectorImpl< Type > &dependTypes, ArrayAttr &dependKinds) |
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 > dependKinds) |
Print Depend clause. More... | |
static LogicalResult | verifyDependVarList (Operation *op, std::optional< ArrayAttr > dependKinds, 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 ParseResult | parseMembersIndex (OpAsmParser &parser, DenseIntElementsAttr &membersIdx) |
static void | printMembersIndex (OpAsmPrinter &p, MapInfoOp op, DenseIntElementsAttr membersIdx) |
static ParseResult | parseMapEntries (OpAsmParser &parser, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &mapVars, SmallVectorImpl< Type > &mapTypes) |
static void | printMapEntries (OpAsmPrinter &p, Operation *op, OperandRange mapVars, TypeRange mapTypes) |
static ParseResult | parsePrivateList (OpAsmParser &parser, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &privateVars, SmallVectorImpl< Type > &privateTypes, ArrayAttr &privateSyms) |
static void | printPrivateList (OpAsmPrinter &p, Operation *op, ValueRange privateVars, TypeRange privateTypes, ArrayAttr privateSyms) |
static void | printCaptureType (OpAsmPrinter &p, Operation *op, VariableCaptureKindAttr mapCaptureType) |
static ParseResult | parseCaptureType (OpAsmParser &parser, VariableCaptureKindAttr &mapCaptureType) |
static LogicalResult | verifyMapClause (Operation *op, OperandRange mapVars) |
template<typename OpType > | |
static LogicalResult | verifyPrivateVarList (OpType &op) |
static bool | opInGlobalImplicitParallelRegion (Operation *op) |
ParseResult | parseWsloop (OpAsmParser &parser, Region ®ion, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &reductionOperands, SmallVectorImpl< Type > &reductionTypes, DenseBoolArrayAttr &reductionByRef, ArrayAttr &reductionSymbols) |
void | printWsloop (OpAsmPrinter &p, Operation *op, Region ®ion, ValueRange reductionOperands, TypeRange reductionTypes, DenseBoolArrayAttr isByRef, ArrayAttr reductionSymbols) |
static LogicalResult | verifyLoopWrapperInterface (Operation *op) |
static LogicalResult | verifyOrderedParent (Operation &op) |
#define GET_ATTRDEF_CLASSES |
Definition at line 2629 of file OpenMPDialect.cpp.
#define GET_ATTRDEF_LIST |
#define GET_OP_CLASSES |
Definition at line 2632 of file OpenMPDialect.cpp.
#define GET_OP_LIST |
#define GET_TYPEDEF_CLASSES |
Definition at line 2635 of file OpenMPDialect.cpp.
#define GET_TYPEDEF_LIST |
|
static |
Definition at line 46 of file OpenMPDialect.cpp.
References mlir::get().
|
static |
Definition at line 52 of file OpenMPDialect.cpp.
References mlir::detail::DenseArrayAttrImpl< T >::get().
Referenced by parseClauseWithRegionArgs(), and parseReductionVarList().
uint64_t mapTypeToBitFlag | ( | uint64_t | value, |
llvm::omp::OpenMPOffloadMappingFlags | flag | ||
) |
Definition at line 950 of file OpenMPDialect.cpp.
|
static |
Definition at line 1579 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 279 of file OpenMPDialect.cpp.
References mlir::AsmParser::parseCommaSeparatedList().
|
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 118 of file OpenMPDialect.cpp.
References mlir::AsmParser::parseArrow(), mlir::AsmParser::parseColonType(), mlir::AsmParser::parseCommaSeparatedList(), and mlir::OpAsmParser::parseOperand().
|
static |
Definition at line 1264 of file OpenMPDialect.cpp.
References mlir::get(), mlir::AsmParser::getContext(), and mlir::AsmParser::parseKeyword().
|
static |
Definition at line 161 of file OpenMPDialect.cpp.
References mlir::AsmParser::emitError(), mlir::get(), mlir::AsmParser::getContext(), mlir::AsmParser::getCurrentLocation(), and mlir::AsmParser::parseKeyword().
|
static |
Definition at line 475 of file OpenMPDialect.cpp.
References mlir::get(), mlir::AsmParser::getContext(), makeDenseBoolArrayAttr(), mlir::AsmParser::Paren, and mlir::AsmParser::parseCommaSeparatedList().
Referenced by parseParallelRegion(), and parseWsloop().
|
static |
copyprivate-entry-list ::= copyprivate-entry | copyprivate-entry-list ,
copyprivate-entry copyprivate-entry ::= ssa-id ->
symbol-ref :
type
Definition at line 696 of file OpenMPDialect.cpp.
References mlir::get(), mlir::AsmParser::getContext(), and mlir::AsmParser::parseCommaSeparatedList().
|
static |
depend-entry-list ::= depend-entry | depend-entry-list ,
depend-entry depend-entry ::= depend-kind ->
ssa-id :
type
Definition at line 800 of file OpenMPDialect.cpp.
References mlir::get(), mlir::AsmParser::getContext(), and mlir::AsmParser::parseCommaSeparatedList().
|
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 186 of file OpenMPDialect.cpp.
References mlir::AsmParser::parseColonType(), mlir::AsmParser::parseCommaSeparatedList(), mlir::AsmParser::parseEqual(), and mlir::OpAsmParser::parseOperand().
|
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 960 of file OpenMPDialect.cpp.
References mlir::AsmParser::getBuilder(), mlir::Builder::getIntegerAttr(), mlir::Builder::getIntegerType(), mlir::AsmParser::parseCommaSeparatedList(), and mlir::AsmParser::parseKeyword().
|
static |
Definition at line 1139 of file OpenMPDialect.cpp.
References mlir::AsmParser::parseColon(), mlir::AsmParser::parseCommaSeparatedList(), mlir::OpAsmParser::parseOperand(), mlir::AsmParser::parseOptionalArrow(), and mlir::AsmParser::parseType().
|
static |
Definition at line 1066 of file OpenMPDialect.cpp.
References mlir::DenseIntElementsAttr::get(), mlir::get(), mlir::AsmParser::getContext(), mlir::AsmParser::parseCommaSeparatedList(), mlir::AsmParser::parseInteger(), mlir::AsmParser::parseLSquare(), mlir::AsmParser::parseOptionalComma(), and mlir::AsmParser::parseRSquare().
|
static |
Definition at line 438 of file OpenMPDialect.cpp.
References mlir::AsmParser::emitError(), mlir::get(), mlir::AsmParser::getContext(), mlir::AsmParser::getCurrentLocation(), mlir::AsmParser::parseKeyword(), and mlir::AsmParser::parseOptionalColon().
|
static |
Definition at line 530 of file OpenMPDialect.cpp.
References mlir::AsmParser::emitError(), mlir::detail::DenseArrayAttrImpl< T >::get(), mlir::AsmParser::getContext(), mlir::AsmParser::getCurrentLocation(), parseClauseWithRegionArgs(), mlir::AsmParser::parseOptionalKeyword(), and mlir::OpAsmParser::parseRegion().
|
static |
Definition at line 1203 of file OpenMPDialect.cpp.
References mlir::get(), mlir::AsmParser::getContext(), and mlir::AsmParser::parseCommaSeparatedList().
|
static |
reduction-entry-list ::= reduction-entry | reduction-entry-list ,
reduction-entry reduction-entry ::= (byref
)? symbol-ref ->
ssa-id :
type
Definition at line 596 of file OpenMPDialect.cpp.
References mlir::get(), mlir::AsmParser::getContext(), makeDenseBoolArrayAttr(), and mlir::AsmParser::parseCommaSeparatedList().
|
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 357 of file OpenMPDialect.cpp.
References mlir::AsmParser::emitError(), mlir::get(), mlir::AsmParser::getBuilder(), mlir::Builder::getContext(), mlir::AsmParser::getContext(), mlir::AsmParser::getCurrentLocation(), mlir::AsmParser::getNameLoc(), mlir::AsmParser::parseColonType(), mlir::AsmParser::parseKeyword(), mlir::OpAsmParser::parseOperand(), mlir::AsmParser::parseOptionalComma(), mlir::AsmParser::parseOptionalEqual(), 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 864 of file OpenMPDialect.cpp.
References mlir::AsmParser::emitError(), mlir::get(), mlir::AsmParser::getBuilder(), mlir::AsmParser::getCurrentLocation(), mlir::Builder::getI64Type(), mlir::AsmParser::parseCommaSeparatedList(), mlir::AsmParser::parseKeyword(), and mlir::AsmParser::parseOptionalKeyword().
ParseResult parseWsloop | ( | OpAsmParser & | parser, |
Region & | region, | ||
SmallVectorImpl< OpAsmParser::UnresolvedOperand > & | reductionOperands, | ||
SmallVectorImpl< Type > & | reductionTypes, | ||
DenseBoolArrayAttr & | reductionByRef, | ||
ArrayAttr & | reductionSymbols | ||
) |
Definition at line 1694 of file OpenMPDialect.cpp.
References parseClauseWithRegionArgs(), mlir::AsmParser::parseOptionalKeyword(), and mlir::OpAsmParser::parseRegion().
|
static |
Print Aligned Clause.
Definition at line 300 of file OpenMPDialect.cpp.
|
static |
Print allocate clause.
Definition at line 144 of file OpenMPDialect.cpp.
|
static |
Definition at line 1249 of file OpenMPDialect.cpp.
void printClauseAttr | ( | OpAsmPrinter & | p, |
Operation * | op, | ||
ClauseAttr | attr | ||
) |
Definition at line 175 of file OpenMPDialect.cpp.
|
static |
Definition at line 510 of file OpenMPDialect.cpp.
|
static |
Print Copyprivate clause.
Definition at line 716 of file OpenMPDialect.cpp.
|
static |
Print Depend clause.
Definition at line 825 of file OpenMPDialect.cpp.
|
static |
Print Linear Clause.
Definition at line 207 of file OpenMPDialect.cpp.
|
static |
Prints a map_entries map type from its numeric value out into its string format.
Definition at line 1011 of file OpenMPDialect.cpp.
|
static |
Definition at line 1173 of file OpenMPDialect.cpp.
|
static |
Definition at line 1115 of file OpenMPDialect.cpp.
|
static |
Definition at line 462 of file OpenMPDialect.cpp.
|
static |
Definition at line 563 of file OpenMPDialect.cpp.
|
static |
Definition at line 1227 of file OpenMPDialect.cpp.
|
static |
Print Reduction clause.
Definition at line 622 of file OpenMPDialect.cpp.
|
static |
Print schedule clause.
Definition at line 418 of file OpenMPDialect.cpp.
|
static |
Prints a Synchronization Hint clause.
Definition at line 895 of file OpenMPDialect.cpp.
void printWsloop | ( | OpAsmPrinter & | p, |
Operation * | op, | ||
Region & | region, | ||
ValueRange | reductionOperands, | ||
TypeRange | reductionTypes, | ||
DenseBoolArrayAttr | isByRef, | ||
ArrayAttr | reductionSymbols | ||
) |
Definition at line 1709 of file OpenMPDialect.cpp.
|
static |
Definition at line 239 of file OpenMPDialect.cpp.
|
static |
Verifies CopyPrivate Clause.
Definition at line 732 of file OpenMPDialect.cpp.
|
static |
Verifies Depend clause.
Definition at line 840 of file OpenMPDialect.cpp.
|
static |
Definition at line 1721 of file OpenMPDialect.cpp.
|
static |
Definition at line 1286 of file OpenMPDialect.cpp.
|
static |
Definition at line 224 of file OpenMPDialect.cpp.
|
static |
Definition at line 2231 of file OpenMPDialect.cpp.
|
static |
Definition at line 1500 of file OpenMPDialect.cpp.
|
static |
Verifies Reduction Clause.
Definition at line 645 of file OpenMPDialect.cpp.
|
static |
Definition at line 316 of file OpenMPDialect.cpp.
References mlir::AsmParser::emitError(), and mlir::AsmParser::getNameLoc().
Referenced by parseScheduleClause().
|
static |
Verifies a synchronization hint clause.
Definition at line 926 of file OpenMPDialect.cpp.