MLIR 24.0.0git
OpenMPDialect.cpp File Reference
#include "mlir/Dialect/OpenMP/OpenMPDialect.h"
#include "mlir/Conversion/ConvertToLLVM/ToLLVMInterface.h"
#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/Dialect/LLVMIR/LLVMModuleOps.h"
#include "mlir/Dialect/LLVMIR/LLVMTypes.h"
#include "mlir/Dialect/OpenMP/OpenMPClauseOperands.h"
#include "mlir/Dialect/OpenMP/OpenMPInterfaces.h"
#include "mlir/IR/Attributes.h"
#include "mlir/IR/BuiltinAttributes.h"
#include "mlir/IR/Matchers.h"
#include "mlir/IR/OpImplementation.h"
#include "mlir/IR/OperationSupport.h"
#include "mlir/IR/SymbolTable.h"
#include "mlir/IR/Value.h"
#include "mlir/Interfaces/ControlFlowInterfaces.h"
#include "mlir/Interfaces/FoldInterfaces.h"
#include "mlir/Interfaces/SideEffectInterfaces.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/PostOrderIterator.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/STLForwardCompat.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/TypeSwitch.h"
#include "llvm/ADT/bit.h"
#include "llvm/Support/InterleavedRange.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/Support/LLVM.h"
#include "mlir/Dialect/OpenMP/OpenMPOpsAttributes.cpp.inc"
#include "mlir/Dialect/OpenMP/OpenMPOps.cpp.inc"
#include "mlir/Dialect/OpenMP/OpenMPOpsTypes.cpp.inc"

Go to the source code of this file.

Macros

#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 DenseI64ArrayAttr makeDenseI64ArrayAttr (MLIRContext *ctx, const ArrayRef< int64_t > intArray)
static std::string generateLoopNestingName (StringRef prefix, CanonicalLoopOp op)
 Generate a name of a canonical loop nest of the format <prefix>(_r<idx>_s<idx>)*.
static LogicalResult verifyDeclareTargetAttr (Operation *op, Attribute attr)
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.
static void printAllocateAndAllocator (OpAsmPrinter &p, Operation *op, OperandRange allocateVars, TypeRange allocateTypes, OperandRange allocatorVars, TypeRange allocatorTypes)
 Print allocate clause.
template<typename ClauseAttr>
static ParseResult parseClauseAttr (AsmParser &parser, ClauseAttr &attr)
template<typename ClauseAttr>
static void printClauseAttr (OpAsmPrinter &p, Operation *op, ClauseAttr attr)
static ParseResult parseLinearClause (OpAsmParser &parser, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &linearVars, SmallVectorImpl< Type > &linearTypes, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &linearStepVars, SmallVectorImpl< Type > &linearStepTypes, ArrayAttr &linearModifiers, ArrayAttr &linearSyms)
 linear ::= linear ( linear-list ) linear-list := linear-val | linear-val linear-list linear-val := ssa-id-and-type = ssa-id-and-type | val ( ssa-id-and-type = ssa-id-and-type ) | ref ( ssa-id-and-type = ssa-id-and-type ) | uval ( ssa-id-and-type = ssa-id-and-type )
static void printLinearClause (OpAsmPrinter &p, Operation *op, ValueRange linearVars, TypeRange linearTypes, ValueRange linearStepVars, TypeRange stepVarTypes, ArrayAttr linearModifiers, ArrayAttr linearSyms)
 Print Linear Clause.
static LogicalResult verifyLinearModifiers (Operation *op, std::optional< ArrayAttr > linearModifiers, OperandRange linearVars, bool isDeclareSimd=false)
 OpenMP 5.2, Section 5.4.6: "A linear-modifier may be specified as ref or uval only on a declare simd directive.
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
static void printAlignedClause (OpAsmPrinter &p, Operation *op, ValueRange alignedVars, TypeRange alignedTypes, std::optional< ArrayAttr > alignments)
 Print Aligned Clause.
static LogicalResult verifyAllocateClause (Operation *op, ValueRange allocateVars, ValueRange allocatorVars, DenseI64ArrayAttr allocateAlignments, DenseI64ArrayAttr allocatePrivateIndices, ValueRange privateVars={}, ArrayAttr privateSyms=nullptr, bool requirePrivateIndices=false)
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)?
static void printScheduleClause (OpAsmPrinter &p, Operation *op, ClauseScheduleKindAttr scheduleKind, ScheduleModifierAttr scheduleMod, UnitAttr scheduleSimd, Value scheduleChunk, Type scheduleChunkType)
 Print schedule clause.
static ParseResult parseOrderClause (OpAsmParser &parser, ClauseOrderKindAttr &order, OrderModifierAttr &orderMod)
static void printOrderClause (OpAsmPrinter &p, Operation *op, ClauseOrderKindAttr order, OrderModifierAttr orderMod)
template<typename ClauseTypeAttr, typename ClauseType>
static ParseResult parseGranularityClause (OpAsmParser &parser, ClauseTypeAttr &prescriptiveness, std::optional< OpAsmParser::UnresolvedOperand > &operand, Type &operandType, std::optional< ClauseType >(*symbolizeClause)(StringRef), StringRef clauseName)
template<typename ClauseTypeAttr, typename ClauseType>
static void printGranularityClause (OpAsmPrinter &p, Operation *op, ClauseTypeAttr prescriptiveness, Value operand, mlir::Type operandType, StringRef(*stringifyClauseType)(ClauseType))
static ParseResult parseGrainsizeClause (OpAsmParser &parser, ClauseGrainsizeTypeAttr &grainsizeMod, std::optional< OpAsmParser::UnresolvedOperand > &grainsize, Type &grainsizeType)
static void printGrainsizeClause (OpAsmPrinter &p, Operation *op, ClauseGrainsizeTypeAttr grainsizeMod, Value grainsize, mlir::Type grainsizeType)
static ParseResult parseNumTasksClause (OpAsmParser &parser, ClauseNumTasksTypeAttr &numTasksMod, std::optional< OpAsmParser::UnresolvedOperand > &numTasks, Type &numTasksType)
static void printNumTasksClause (OpAsmPrinter &p, Operation *op, ClauseNumTasksTypeAttr numTasksMod, Value numTasks, mlir::Type numTasksType)
static ParseResult parseHeapAllocClause (OpAsmParser &parser, TypeAttr &inTypeAttr, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &typeparams, SmallVectorImpl< Type > &typeparamsTypes, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &shape, SmallVectorImpl< Type > &shapeTypes)
 operation ::= $in_type ( ( $typeparams ) )? ( , $shape )?
static void printHeapAllocClause (OpAsmPrinter &p, Operation *op, TypeAttr inType, ValueRange typeparams, TypeRange typeparamsTypes, ValueRange shape, TypeRange shapeTypes)
static LogicalResult verifyDynGroupprivateClause (Operation *op, AccessGroupModifierAttr accessGroup, FallbackModifierAttr fallback, Value dynGroupprivateSize)
static ParseResult parseDynGroupprivateClause (OpAsmParser &parser, AccessGroupModifierAttr &accessGroupAttr, FallbackModifierAttr &fallbackAttr, std::optional< OpAsmParser::UnresolvedOperand > &dynGroupprivateSize, Type &sizeType)
static void printDynGroupprivateClause (OpAsmPrinter &printer, Operation *op, AccessGroupModifierAttr modifierFirst, FallbackModifierAttr modifierSecond, Value dynGroupprivateSize, Type sizeType)
static ParseResult parseInReductionClause (OpAsmParser &parser, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &inReductionVars, SmallVectorImpl< Type > &inReductionTypes, DenseBoolArrayAttr &inReductionByref, ArrayAttr &inReductionSyms)
 Parses an in_reduction clause for an operation that does not give its list items entry block arguments (e.g.
static void printInReductionClause (OpAsmPrinter &p, Operation *op, ValueRange inReductionVars, TypeRange inReductionTypes, DenseBoolArrayAttr inReductionByref, ArrayAttr inReductionSyms)
 Prints an in_reduction clause for an operation that does not give its list items entry block arguments (e.g.
static constexpr StringRef getPrivateNeedsBarrierSpelling ()
static ParseResult parseClauseWithRegionArgs (OpAsmParser &parser, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &operands, SmallVectorImpl< Type > &types, SmallVectorImpl< OpAsmParser::Argument > &regionPrivateArgs, ArrayAttr *symbols=nullptr, DenseI64ArrayAttr *mapIndices=nullptr, DenseBoolArrayAttr *byref=nullptr, ArrayAttr *modifier=nullptr, UnitAttr *needsBarrier=nullptr)
static ParseResult parseBlockArgClause (OpAsmParser &parser, llvm::SmallVectorImpl< OpAsmParser::Argument > &entryBlockArgs, StringRef keyword, std::optional< MapParseArgs > mapArgs)
static ParseResult parseBlockArgClause (OpAsmParser &parser, llvm::SmallVectorImpl< OpAsmParser::Argument > &entryBlockArgs, StringRef keyword, std::optional< PrivateParseArgs > privateArgs)
static ParseResult parseBlockArgClause (OpAsmParser &parser, llvm::SmallVectorImpl< OpAsmParser::Argument > &entryBlockArgs, StringRef keyword, std::optional< ReductionParseArgs > reductionArgs)
static ParseResult parseBlockArgClause (OpAsmParser &parser, llvm::SmallVectorImpl< OpAsmParser::Argument > &entryBlockArgs, StringRef keyword, std::optional< LinearParseArgs > linearArgs)
 linear-entry := [modifier (] symbol ssa-id -> ssa-id : type = ssa-id : type [)]
static ParseResult parseBlockArgRegion (OpAsmParser &parser, Region &region, AllRegionParseArgs args)
static ParseResult parseTargetOpRegion (OpAsmParser &parser, Region &region, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &hasDeviceAddrVars, SmallVectorImpl< Type > &hasDeviceAddrTypes, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &hostEvalVars, SmallVectorImpl< Type > &hostEvalTypes, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &mapVars, SmallVectorImpl< Type > &mapTypes, llvm::SmallVectorImpl< OpAsmParser::UnresolvedOperand > &privateVars, llvm::SmallVectorImpl< Type > &privateTypes, ArrayAttr &privateSyms, UnitAttr &privateNeedsBarrier, DenseI64ArrayAttr &privateMaps)
static ParseResult parseInReductionPrivateRegion (OpAsmParser &parser, Region &region, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &inReductionVars, SmallVectorImpl< Type > &inReductionTypes, DenseBoolArrayAttr &inReductionByref, ArrayAttr &inReductionSyms, llvm::SmallVectorImpl< OpAsmParser::UnresolvedOperand > &privateVars, llvm::SmallVectorImpl< Type > &privateTypes, ArrayAttr &privateSyms, UnitAttr &privateNeedsBarrier)
static ParseResult parseInReductionPrivateReductionRegion (OpAsmParser &parser, Region &region, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &inReductionVars, SmallVectorImpl< Type > &inReductionTypes, DenseBoolArrayAttr &inReductionByref, ArrayAttr &inReductionSyms, llvm::SmallVectorImpl< OpAsmParser::UnresolvedOperand > &privateVars, llvm::SmallVectorImpl< Type > &privateTypes, ArrayAttr &privateSyms, UnitAttr &privateNeedsBarrier, ArrayAttr &reductionMods, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &reductionVars, SmallVectorImpl< Type > &reductionTypes, DenseBoolArrayAttr &reductionByref, ArrayAttr &reductionSyms)
static ParseResult parsePrivateRegion (OpAsmParser &parser, Region &region, llvm::SmallVectorImpl< OpAsmParser::UnresolvedOperand > &privateVars, llvm::SmallVectorImpl< Type > &privateTypes, ArrayAttr &privateSyms, UnitAttr &privateNeedsBarrier)
static ParseResult parsePrivateReductionRegion (OpAsmParser &parser, Region &region, llvm::SmallVectorImpl< OpAsmParser::UnresolvedOperand > &privateVars, llvm::SmallVectorImpl< Type > &privateTypes, ArrayAttr &privateSyms, UnitAttr &privateNeedsBarrier, ArrayAttr &reductionMods, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &reductionVars, SmallVectorImpl< Type > &reductionTypes, DenseBoolArrayAttr &reductionByref, ArrayAttr &reductionSyms)
static ParseResult parseLinearPrivateReductionRegion (OpAsmParser &parser, Region &region, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &linearVars, SmallVectorImpl< Type > &linearTypes, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &linearStepVars, SmallVectorImpl< Type > &linearStepTypes, ArrayAttr &linearVarTypes, ArrayAttr &linearModifiers, ArrayAttr &linearSyms, llvm::SmallVectorImpl< OpAsmParser::UnresolvedOperand > &privateVars, llvm::SmallVectorImpl< Type > &privateTypes, ArrayAttr &privateSyms, UnitAttr &privateNeedsBarrier, ArrayAttr &reductionMods, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &reductionVars, SmallVectorImpl< Type > &reductionTypes, DenseBoolArrayAttr &reductionByref, ArrayAttr &reductionSyms)
static ParseResult parseTaskReductionRegion (OpAsmParser &parser, Region &region, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &taskReductionVars, SmallVectorImpl< Type > &taskReductionTypes, DenseBoolArrayAttr &taskReductionByref, ArrayAttr &taskReductionSyms)
static ParseResult parseUseDeviceAddrUseDevicePtrRegion (OpAsmParser &parser, Region &region, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &useDeviceAddrVars, SmallVectorImpl< Type > &useDeviceAddrTypes, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &useDevicePtrVars, SmallVectorImpl< Type > &useDevicePtrTypes)
static void printClauseWithRegionArgs (OpAsmPrinter &p, MLIRContext *ctx, StringRef clauseName, ValueRange argsSubrange, ValueRange operands, TypeRange types, ArrayAttr symbols=nullptr, DenseI64ArrayAttr mapIndices=nullptr, DenseBoolArrayAttr byref=nullptr, ArrayAttr modifier=nullptr, UnitAttr needsBarrier=nullptr)
static void printBlockArgClause (OpAsmPrinter &p, MLIRContext *ctx, StringRef clauseName, ValueRange argsSubrange, std::optional< MapPrintArgs > mapArgs)
static void printBlockArgClause (OpAsmPrinter &p, MLIRContext *ctx, StringRef clauseName, ValueRange argsSubrange, std::optional< PrivatePrintArgs > privateArgs)
static void printBlockArgClause (OpAsmPrinter &p, MLIRContext *ctx, StringRef clauseName, ValueRange argsSubrange, std::optional< ReductionPrintArgs > reductionArgs)
static void printBlockArgClause (OpAsmPrinter &p, MLIRContext *ctx, StringRef clauseName, ValueRange argsSubrange, std::optional< LinearPrintArgs > linearArgs)
static void printBlockArgRegion (OpAsmPrinter &p, Operation *op, Region &region, const AllRegionPrintArgs &args)
static void printTargetOpRegion (OpAsmPrinter &p, Operation *op, Region &region, ValueRange hasDeviceAddrVars, TypeRange hasDeviceAddrTypes, ValueRange hostEvalVars, TypeRange hostEvalTypes, ValueRange mapVars, TypeRange mapTypes, ValueRange privateVars, TypeRange privateTypes, ArrayAttr privateSyms, UnitAttr privateNeedsBarrier, DenseI64ArrayAttr privateMaps)
static void printInReductionPrivateRegion (OpAsmPrinter &p, Operation *op, Region &region, ValueRange inReductionVars, TypeRange inReductionTypes, DenseBoolArrayAttr inReductionByref, ArrayAttr inReductionSyms, ValueRange privateVars, TypeRange privateTypes, ArrayAttr privateSyms, UnitAttr privateNeedsBarrier)
static void printInReductionPrivateReductionRegion (OpAsmPrinter &p, Operation *op, Region &region, ValueRange inReductionVars, TypeRange inReductionTypes, DenseBoolArrayAttr inReductionByref, ArrayAttr inReductionSyms, ValueRange privateVars, TypeRange privateTypes, ArrayAttr privateSyms, UnitAttr privateNeedsBarrier, ArrayAttr reductionMods, ValueRange reductionVars, TypeRange reductionTypes, DenseBoolArrayAttr reductionByref, ArrayAttr reductionSyms)
static void printPrivateRegion (OpAsmPrinter &p, Operation *op, Region &region, ValueRange privateVars, TypeRange privateTypes, ArrayAttr privateSyms, UnitAttr privateNeedsBarrier)
static void printPrivateReductionRegion (OpAsmPrinter &p, Operation *op, Region &region, ValueRange privateVars, TypeRange privateTypes, ArrayAttr privateSyms, UnitAttr privateNeedsBarrier, ArrayAttr reductionMods, ValueRange reductionVars, TypeRange reductionTypes, DenseBoolArrayAttr reductionByref, ArrayAttr reductionSyms)
static void printLinearPrivateReductionRegion (OpAsmPrinter &p, Operation *op, Region &region, ValueRange linearVars, TypeRange linearTypes, ValueRange linearStepVars, TypeRange linearStepTypes, ArrayAttr linearVarTypes, ArrayAttr linearModifiers, ArrayAttr linearSyms, ValueRange privateVars, TypeRange privateTypes, ArrayAttr privateSyms, UnitAttr privateNeedsBarrier, ArrayAttr reductionMods, ValueRange reductionVars, TypeRange reductionTypes, DenseBoolArrayAttr reductionByref, ArrayAttr reductionSyms)
static void printTaskReductionRegion (OpAsmPrinter &p, Operation *op, Region &region, ValueRange taskReductionVars, TypeRange taskReductionTypes, DenseBoolArrayAttr taskReductionByref, ArrayAttr taskReductionSyms)
static void printUseDeviceAddrUseDevicePtrRegion (OpAsmPrinter &p, Operation *op, Region &region, ValueRange useDeviceAddrVars, TypeRange useDeviceAddrTypes, ValueRange useDevicePtrVars, TypeRange useDevicePtrTypes)
template<typename ParsePrefixFn>
static ParseResult parseSplitIteratedList (OpAsmParser &parser, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &iteratedVars, SmallVectorImpl< Type > &iteratedTypes, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &plainVars, SmallVectorImpl< Type > &plainTypes, ParsePrefixFn &&parsePrefix)
template<typename PrintPrefixFn>
static void printSplitIteratedList (OpAsmPrinter &p, ValueRange iteratedVars, TypeRange iteratedTypes, ValueRange plainVars, TypeRange plainTypes, PrintPrefixFn &&printPrefixForPlain, PrintPrefixFn &&printPrefixForIterated)
static LogicalResult verifyReductionModifiers (Operation *op, OperandRange reductionVars, ArrayAttr reductionMods)
 Verify the per-variable modifier list has one entry per reduction variable.
static LogicalResult verifyReductionVarList (Operation *op, std::optional< ArrayAttr > reductionSyms, OperandRange reductionVars, std::optional< ArrayRef< bool > > reductionByref, ArrayAttr reductionMods=nullptr)
 Verifies Reduction Clause.
static ParseResult parseCopyprivate (OpAsmParser &parser, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &copyprivateVars, SmallVectorImpl< Type > &copyprivateTypes, ArrayAttr &copyprivateSyms)
 copyprivate-entry-list ::= copyprivate-entry | copyprivate-entry-list , copyprivate-entry copyprivate-entry ::= ssa-id -> symbol-ref : type
static void printCopyprivate (OpAsmPrinter &p, Operation *op, OperandRange copyprivateVars, TypeRange copyprivateTypes, std::optional< ArrayAttr > copyprivateSyms)
 Print Copyprivate clause.
static LogicalResult verifyCopyprivateVarList (Operation *op, OperandRange copyprivateVars, std::optional< ArrayAttr > copyprivateSyms)
 Verifies CopyPrivate Clause.
static ParseResult parseDependVarList (OpAsmParser &parser, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &dependVars, SmallVectorImpl< Type > &dependTypes, ArrayAttr &dependKinds, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &iteratedVars, SmallVectorImpl< Type > &iteratedTypes, ArrayAttr &iteratedKinds)
 depend-entry-list ::= depend-entry | depend-entry-list , depend-entry depend-entry ::= depend-kind -> ssa-id : type | depend-kind -> ssa-id : iterated-type
static void printDependVarList (OpAsmPrinter &p, Operation *op, OperandRange dependVars, TypeRange dependTypes, std::optional< ArrayAttr > dependKinds, OperandRange iteratedVars, TypeRange iteratedTypes, std::optional< ArrayAttr > iteratedKinds)
 Print Depend clause.
static LogicalResult verifyDependVarList (Operation *op, std::optional< ArrayAttr > dependKinds, OperandRange dependVars, std::optional< ArrayAttr > iteratedKinds, OperandRange iteratedVars)
 Verifies Depend clause.
static ParseResult parseSynchronizationHint (OpAsmParser &parser, IntegerAttr &hintAttr)
 Parses a Synchronization Hint clause.
static void printSynchronizationHint (OpAsmPrinter &p, Operation *op, IntegerAttr hintAttr)
 Prints a Synchronization Hint clause.
static LogicalResult verifySynchronizationHint (Operation *op, uint64_t hint)
 Verifies a synchronization hint clause.
static bool mapTypeToBool (ClauseMapFlags value, ClauseMapFlags flag)
return success ()
 if (parser.parseCommaSeparatedList(parseIndices)) return failure()
 if (failed(parser.parseRSquare())) return failure()
memberIdxs push_back (ArrayAttr::get(parser.getContext(), values))
values clear ()
 while (succeeded(parser.parseOptionalComma()))
 if (!memberIdxs.empty()) membersIdx
static void printMembersIndex (OpAsmPrinter &p, MapInfoOp op, ArrayAttr membersIdx)
static void printCaptureType (OpAsmPrinter &p, Operation *op, VariableCaptureKindAttr mapCaptureType)
static ParseResult parseCaptureType (OpAsmParser &parser, VariableCaptureKindAttr &mapCaptureType)
static LogicalResult verifyMapInfoForMapClause (Operation *op, mlir::omp::MapInfoOp mapInfoOp, llvm::DenseSet< mlir::TypedValue< mlir::omp::PointerLikeType > > &updateToVars, llvm::DenseSet< mlir::TypedValue< mlir::omp::PointerLikeType > > &updateFromVars)
static LogicalResult verifyMapClause (Operation *op, OperandRange mapVars, OperandRange mapIterated)
template<typename OpType>
static LogicalResult verifyPrivateVarList (OpType &op)
static LogicalResult verifyPrivateVarsMapping (TargetOp targetOp)
static LogicalResult verifyMapInfoDefinedArgs (Operation *op, StringRef clauseName, OperandRange vars)
static bool targetInReductionCapturedBy (Value inReductionVar, Value mapVarPtr)
 An omp.target in_reduction operand is captured by a map_entries entry when the entry's MapInfoOp var_ptr is the same SSA value, or another result of the same defining op. At this stage, exact identity can only be required for block arguments, which have no defining op. Flang emits hlfir.declare #0 for the in_reduction operand and #1 for the map var_ptr; these collapse to the same value after lowering, but that cannot be enforced here.
template<typename OpType>
static LogicalResult verifyLinearSyms (OpType op)
 Verifies that each linear variable has a linear privatizer.
static bool opInGlobalImplicitParallelRegion (Operation *op)
static LogicalResult verifyNumTeamsClause (Operation *op, Value numTeamsLower, OperandRange numTeamsUpperVars)
static void addUnknownMemoryEffects (SmallVectorImpl< MemoryEffects::EffectInstance > &effects)
 Add arbitrary read, write, allocate, and free effects.
static void getPrivatisationEffects (Operation *op, SmallVectorImpl< MemoryEffects::EffectInstance > &effects)
 Privatisation may read the original as a mold or firstprivate copy source. Any lastprivate copy-back is explicit in the nested operations.
static void getReductionEffects (Operation *op, SmallVectorImpl< MemoryEffects::EffectInstance > &effects)
 Reductions initialise private accumulators and combine them into the original variables.
static void getBarrierEffects (llvm::SmallVectorImpl< SideEffects::EffectInstance< MemoryEffects::Effect > > &effects)
static void getTaskSchedulingPointEffects (llvm::SmallVectorImpl< SideEffects::EffectInstance< MemoryEffects::Effect > > &effects)
static void getInReductionEffects (Operation *op, SmallVectorImpl< MemoryEffects::EffectInstance > &effects)
static void getTaskReductionEffects (Operation *op, SmallVectorImpl< MemoryEffects::EffectInstance > &effects)
static void printLoopTransformClis (OpAsmPrinter &p, TileOp op, OperandRange generatees, OperandRange applyees)
static ParseResult parseLoopTransformClis (OpAsmParser &parser, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &generateesOperands, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &applyeesOperands)
static LogicalResult checkApplyeesNesting (TileOp op)
 Check properties of the loop nest consisting of the transformation's applyees:
static void printLoopTransformClis (OpAsmPrinter &p, FuseOp op, OperandRange generatees, OperandRange applyees)
static LogicalResult verifyOrderedParent (Operation &op)
static Operation * getParentInSameDialect (Operation *thisOp)
LogicalResult verifyAlignment (Operation &op, std::optional< uint64_t > alignment)
 Verifies align clause in allocate directive.
static ParseResult parseUniformClause (OpAsmParser &parser, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &uniformVars, SmallVectorImpl< Type > &uniformTypes)
 uniform ::= uniform ( uniform-list ) uniform-list := uniform-val (, uniform-val)* uniform-val := ssa-id : type
static void printUniformClause (OpAsmPrinter &p, Operation *op, ValueRange uniformVars, TypeRange uniformTypes)
 Print Uniform Clauses.
static ParseResult parseAffinityClause (OpAsmParser &parser, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &iterated, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &affinityVars, SmallVectorImpl< Type > &iteratedTypes, SmallVectorImpl< Type > &affinityVarTypes)
static void printAffinityClause (OpAsmPrinter &p, Operation *op, ValueRange iterated, ValueRange affinityVars, TypeRange iteratedTypes, TypeRange affinityVarTypes)
static ParseResult parseIteratorHeader (OpAsmParser &parser, Region &region, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &lbs, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &ubs, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &steps, SmallVectorImpl< Type > &lbTypes, SmallVectorImpl< Type > &ubTypes, SmallVectorImpl< Type > &stepTypes)
static void printIteratorHeader (OpAsmPrinter &p, Operation *op, Region &region, ValueRange lbs, ValueRange ubs, ValueRange steps, TypeRange, TypeRange, TypeRange)

Variables

 false
 Parses a map_entries map type from a string format back into its numeric value.
 do

Macro Definition Documentation

◆ GET_ATTRDEF_CLASSES

#define GET_ATTRDEF_CLASSES

Definition at line 6343 of file OpenMPDialect.cpp.

◆ GET_OP_CLASSES

#define GET_OP_CLASSES

Definition at line 6346 of file OpenMPDialect.cpp.

◆ GET_TYPEDEF_CLASSES

#define GET_TYPEDEF_CLASSES

Definition at line 6349 of file OpenMPDialect.cpp.

Function Documentation

◆ addUnknownMemoryEffects()

void addUnknownMemoryEffects ( SmallVectorImpl< MemoryEffects::EffectInstance > & effects)
static

Add arbitrary read, write, allocate, and free effects.

Definition at line 3506 of file OpenMPDialect.cpp.

References mlir::SideEffects::Effect::Base< DerivedEffect, Effect >::get().

◆ checkApplyeesNesting()

LogicalResult checkApplyeesNesting ( TileOp op)
static

Check properties of the loop nest consisting of the transformation's applyees:

  1. They are nested inside each other
  2. They are perfectly nested (no code with side-effects in-between the loops)
  3. They are rectangular (loop bounds are invariant in respect to the outer loops)

TODO: Generalize for LoopTransformationInterface.

Definition at line 5187 of file OpenMPDialect.cpp.

References mlir::Block::begin(), mlir::omp::decodeCli(), mlir::Block::end(), mlir::Block::front(), and success().

◆ clear()

◆ generateLoopNestingName()

std::string generateLoopNestingName ( StringRef prefix,
CanonicalLoopOp op )
static

Generate a name of a canonical loop nest of the format <prefix>(_r<idx>_s<idx>)*.

Hereby, _r<idx> identifies the region argument index of an operation that has multiple regions, if the operation has multiple regions. _s<idx> identifies the position of an operation within a region, where only operations that may potentially contain loops ("container operations" i.e. have region arguments) are counted. Again, it is omitted if there is only one such operation in a region. If there are canonical loops nested inside each other, also may also use the format _d<num> where <num> is the nesting depth of the loop.

The generated name is a best-effort to make canonical loop unique within an SSA namespace. This also means that regions with IsolatedFromAbove property do not consider any parents or siblings.

If true, this component describes a region operand of an operation (the operand's owner) If false, this component describes an operation located in a parent region

Definition at line 99 of file OpenMPDialect.cpp.

References b, mlir::Region::getBlocks(), mlir::Region::getParentOp(), mlir::Operation::getParentRegion(), mlir::Operation::getRegions(), mlir::Operation::hasTrait(), and isUnique().

◆ getBarrierEffects()

◆ getInReductionEffects()

void getInReductionEffects ( Operation * op,
SmallVectorImpl< MemoryEffects::EffectInstance > & effects )
static

◆ getParentInSameDialect()

Operation * getParentInSameDialect ( Operation * thisOp)
static

◆ getPrivateNeedsBarrierSpelling()

constexpr StringRef getPrivateNeedsBarrierSpelling ( )
inlinestaticconstexpr

Definition at line 1310 of file OpenMPDialect.cpp.

◆ getPrivatisationEffects()

void getPrivatisationEffects ( Operation * op,
SmallVectorImpl< MemoryEffects::EffectInstance > & effects )
static

Privatisation may read the original as a mold or firstprivate copy source. Any lastprivate copy-back is explicit in the nested operations.

Definition at line 3516 of file OpenMPDialect.cpp.

References mlir::SideEffects::Effect::Base< DerivedEffect, Effect >::get().

◆ getReductionEffects()

void getReductionEffects ( Operation * op,
SmallVectorImpl< MemoryEffects::EffectInstance > & effects )
static

Reductions initialise private accumulators and combine them into the original variables.

Definition at line 3534 of file OpenMPDialect.cpp.

References mlir::SideEffects::Effect::Base< DerivedEffect, Effect >::get().

◆ getTaskReductionEffects()

void getTaskReductionEffects ( Operation * op,
SmallVectorImpl< MemoryEffects::EffectInstance > & effects )
static

◆ getTaskSchedulingPointEffects()

◆ if() [1/3]

if ( !memberIdxs. empty())

◆ if() [2/3]

if ( failed(parser.parseRSquare()) )

◆ if() [3/3]

if ( parser. parseCommaSeparatedListparseIndices)

◆ makeArrayAttr()

ArrayAttr makeArrayAttr ( MLIRContext * context,
llvm::ArrayRef< Attribute > attrs )
static

Definition at line 54 of file OpenMPDialect.cpp.

References ArrayAttr(), and nullptr.

◆ makeDenseBoolArrayAttr()

DenseBoolArrayAttr makeDenseBoolArrayAttr ( MLIRContext * ctx,
const ArrayRef< bool > boolArray )
static

Definition at line 60 of file OpenMPDialect.cpp.

References mlir::detail::DenseArrayAttrImpl< bool >::get(), and nullptr.

Referenced by parseInReductionClause().

◆ makeDenseI64ArrayAttr()

DenseI64ArrayAttr makeDenseI64ArrayAttr ( MLIRContext * ctx,
const ArrayRef< int64_t > intArray )
static

◆ mapTypeToBool()

bool mapTypeToBool ( ClauseMapFlags value,
ClauseMapFlags flag )
static

Definition at line 2441 of file OpenMPDialect.cpp.

Referenced by verifyMapInfoForMapClause().

◆ opInGlobalImplicitParallelRegion()

bool opInGlobalImplicitParallelRegion ( Operation * op)
static

◆ parseAffinityClause()

ParseResult parseAffinityClause ( OpAsmParser & parser,
SmallVectorImpl< OpAsmParser::UnresolvedOperand > & iterated,
SmallVectorImpl< OpAsmParser::UnresolvedOperand > & affinityVars,
SmallVectorImpl< Type > & iteratedTypes,
SmallVectorImpl< Type > & affinityVarTypes )
static

Definition at line 6137 of file OpenMPDialect.cpp.

References parseSplitIteratedList(), and success().

◆ parseAlignedClause()

ParseResult parseAlignedClause ( OpAsmParser & parser,
SmallVectorImpl< OpAsmParser::UnresolvedOperand > & alignedVars,
SmallVectorImpl< Type > & alignedTypes,
ArrayAttr & alignmentsAttr )
static

aligned ::= aligned ( aligned-list ) aligned-list := aligned-val | aligned-val aligned-list aligned-val := ssa-id-and-type -> alignment

Definition at line 625 of file OpenMPDialect.cpp.

References ArrayAttr(), mlir::AsmParser::parseCommaSeparatedList(), and success().

◆ parseAllocateAndAllocator()

ParseResult parseAllocateAndAllocator ( OpAsmParser & parser,
SmallVectorImpl< OpAsmParser::UnresolvedOperand > & allocateVars,
SmallVectorImpl< Type > & allocateTypes,
SmallVectorImpl< OpAsmParser::UnresolvedOperand > & allocatorVars,
SmallVectorImpl< Type > & allocatorTypes )
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 388 of file OpenMPDialect.cpp.

References mlir::AsmParser::parseArrow(), mlir::AsmParser::parseColonType(), mlir::AsmParser::parseCommaSeparatedList(), mlir::OpAsmParser::parseOperand(), and success().

◆ parseBlockArgClause() [1/4]

ParseResult parseBlockArgClause ( OpAsmParser & parser,
llvm::SmallVectorImpl< OpAsmParser::Argument > & entryBlockArgs,
StringRef keyword,
std::optional< LinearParseArgs > linearArgs )
static

◆ parseBlockArgClause() [2/4]

ParseResult parseBlockArgClause ( OpAsmParser & parser,
llvm::SmallVectorImpl< OpAsmParser::Argument > & entryBlockArgs,
StringRef keyword,
std::optional< MapParseArgs > mapArgs )
static

◆ parseBlockArgClause() [3/4]

ParseResult parseBlockArgClause ( OpAsmParser & parser,
llvm::SmallVectorImpl< OpAsmParser::Argument > & entryBlockArgs,
StringRef keyword,
std::optional< PrivateParseArgs > privateArgs )
static

◆ parseBlockArgClause() [4/4]

ParseResult parseBlockArgClause ( OpAsmParser & parser,
llvm::SmallVectorImpl< OpAsmParser::Argument > & entryBlockArgs,
StringRef keyword,
std::optional< ReductionParseArgs > reductionArgs )
static

◆ parseBlockArgRegion()

◆ parseCaptureType()

ParseResult parseCaptureType ( OpAsmParser & parser,
VariableCaptureKindAttr & mapCaptureType )
static

◆ parseClauseAttr()

template<typename ClauseAttr>
ParseResult parseClauseAttr ( AsmParser & parser,
ClauseAttr & attr )
static

◆ parseClauseWithRegionArgs()

◆ parseCopyprivate()

ParseResult parseCopyprivate ( OpAsmParser & parser,
SmallVectorImpl< OpAsmParser::UnresolvedOperand > & copyprivateVars,
SmallVectorImpl< Type > & copyprivateTypes,
ArrayAttr & copyprivateSyms )
static

copyprivate-entry-list ::= copyprivate-entry | copyprivate-entry-list , copyprivate-entry copyprivate-entry ::= ssa-id -> symbol-ref : type

Definition at line 2151 of file OpenMPDialect.cpp.

References ArrayAttr(), mlir::AsmParser::getContext(), mlir::AsmParser::parseCommaSeparatedList(), and success().

◆ parseDependVarList()

ParseResult parseDependVarList ( OpAsmParser & parser,
SmallVectorImpl< OpAsmParser::UnresolvedOperand > & dependVars,
SmallVectorImpl< Type > & dependTypes,
ArrayAttr & dependKinds,
SmallVectorImpl< OpAsmParser::UnresolvedOperand > & iteratedVars,
SmallVectorImpl< Type > & iteratedTypes,
ArrayAttr & iteratedKinds )
static

depend-entry-list ::= depend-entry | depend-entry-list , depend-entry depend-entry ::= depend-kind -> ssa-id : type | depend-kind -> ssa-id : iterated-type

Definition at line 2255 of file OpenMPDialect.cpp.

References ArrayAttr(), mlir::AsmParser::parseCommaSeparatedList(), and success().

◆ parseDynGroupprivateClause()

◆ parseGrainsizeClause()

ParseResult parseGrainsizeClause ( OpAsmParser & parser,
ClauseGrainsizeTypeAttr & grainsizeMod,
std::optional< OpAsmParser::UnresolvedOperand > & grainsize,
Type & grainsizeType )
static

Definition at line 964 of file OpenMPDialect.cpp.

References parseGranularityClause().

◆ parseGranularityClause()

template<typename ClauseTypeAttr, typename ClauseType>
ParseResult parseGranularityClause ( OpAsmParser & parser,
ClauseTypeAttr & prescriptiveness,
std::optional< OpAsmParser::UnresolvedOperand > & operand,
Type & operandType,
std::optional< ClauseType >(* symbolizeClause )(StringRef),
StringRef clauseName )
static

◆ parseHeapAllocClause()

◆ parseInReductionClause()

ParseResult parseInReductionClause ( OpAsmParser & parser,
SmallVectorImpl< OpAsmParser::UnresolvedOperand > & inReductionVars,
SmallVectorImpl< Type > & inReductionTypes,
DenseBoolArrayAttr & inReductionByref,
ArrayAttr & inReductionSyms )
static

Parses an in_reduction clause for an operation that does not give its list items entry block arguments (e.g.

omp.target). The expected format is a comma-separated list of [byref] @sym var followed by : types.

Definition at line 1172 of file OpenMPDialect.cpp.

References ArrayAttr(), mlir::AsmParser::getContext(), makeDenseBoolArrayAttr(), mlir::AsmParser::parseColon(), mlir::AsmParser::parseCommaSeparatedList(), and success().

◆ parseInReductionPrivateReductionRegion()

ParseResult parseInReductionPrivateReductionRegion ( OpAsmParser & parser,
Region & region,
SmallVectorImpl< OpAsmParser::UnresolvedOperand > & inReductionVars,
SmallVectorImpl< Type > & inReductionTypes,
DenseBoolArrayAttr & inReductionByref,
ArrayAttr & inReductionSyms,
llvm::SmallVectorImpl< OpAsmParser::UnresolvedOperand > & privateVars,
llvm::SmallVectorImpl< Type > & privateTypes,
ArrayAttr & privateSyms,
UnitAttr & privateNeedsBarrier,
ArrayAttr & reductionMods,
SmallVectorImpl< OpAsmParser::UnresolvedOperand > & reductionVars,
SmallVectorImpl< Type > & reductionTypes,
DenseBoolArrayAttr & reductionByref,
ArrayAttr & reductionSyms )
static

Definition at line 1615 of file OpenMPDialect.cpp.

References ArrayAttr(), and parseBlockArgRegion().

◆ parseInReductionPrivateRegion()

ParseResult parseInReductionPrivateRegion ( OpAsmParser & parser,
Region & region,
SmallVectorImpl< OpAsmParser::UnresolvedOperand > & inReductionVars,
SmallVectorImpl< Type > & inReductionTypes,
DenseBoolArrayAttr & inReductionByref,
ArrayAttr & inReductionSyms,
llvm::SmallVectorImpl< OpAsmParser::UnresolvedOperand > & privateVars,
llvm::SmallVectorImpl< Type > & privateTypes,
ArrayAttr & privateSyms,
UnitAttr & privateNeedsBarrier )
static

Definition at line 1599 of file OpenMPDialect.cpp.

References ArrayAttr(), and parseBlockArgRegion().

◆ parseIteratorHeader()

◆ parseLinearClause()

ParseResult parseLinearClause ( OpAsmParser & parser,
SmallVectorImpl< OpAsmParser::UnresolvedOperand > & linearVars,
SmallVectorImpl< Type > & linearTypes,
SmallVectorImpl< OpAsmParser::UnresolvedOperand > & linearStepVars,
SmallVectorImpl< Type > & linearStepTypes,
ArrayAttr & linearModifiers,
ArrayAttr & linearSyms )
static

linear ::= linear ( linear-list ) linear-list := linear-val | linear-val linear-list linear-val := ssa-id-and-type = ssa-id-and-type | val ( ssa-id-and-type = ssa-id-and-type ) | ref ( ssa-id-and-type = ssa-id-and-type ) | uval ( ssa-id-and-type = ssa-id-and-type )

Definition at line 459 of file OpenMPDialect.cpp.

References ArrayAttr(), mlir::AsmParser::getContext(), mlir::AsmParser::parseColonType(), mlir::AsmParser::parseCommaSeparatedList(), mlir::AsmParser::parseEqual(), mlir::AsmParser::parseLParen(), mlir::OpAsmParser::parseOperand(), mlir::AsmParser::parseOptionalKeyword(), mlir::AsmParser::parseRParen(), result, and success().

◆ parseLinearPrivateReductionRegion()

ParseResult parseLinearPrivateReductionRegion ( OpAsmParser & parser,
Region & region,
SmallVectorImpl< OpAsmParser::UnresolvedOperand > & linearVars,
SmallVectorImpl< Type > & linearTypes,
SmallVectorImpl< OpAsmParser::UnresolvedOperand > & linearStepVars,
SmallVectorImpl< Type > & linearStepTypes,
ArrayAttr & linearVarTypes,
ArrayAttr & linearModifiers,
ArrayAttr & linearSyms,
llvm::SmallVectorImpl< OpAsmParser::UnresolvedOperand > & privateVars,
llvm::SmallVectorImpl< Type > & privateTypes,
ArrayAttr & privateSyms,
UnitAttr & privateNeedsBarrier,
ArrayAttr & reductionMods,
SmallVectorImpl< OpAsmParser::UnresolvedOperand > & reductionVars,
SmallVectorImpl< Type > & reductionTypes,
DenseBoolArrayAttr & reductionByref,
ArrayAttr & reductionSyms )
static

Definition at line 1663 of file OpenMPDialect.cpp.

References ArrayAttr(), and parseBlockArgRegion().

◆ parseLoopTransformClis()

◆ parseNumTasksClause()

ParseResult parseNumTasksClause ( OpAsmParser & parser,
ClauseNumTasksTypeAttr & numTasksMod,
std::optional< OpAsmParser::UnresolvedOperand > & numTasks,
Type & numTasksType )
static

Definition at line 986 of file OpenMPDialect.cpp.

References parseGranularityClause().

◆ parseOrderClause()

ParseResult parseOrderClause ( OpAsmParser & parser,
ClauseOrderKindAttr & order,
OrderModifierAttr & orderMod )
static

◆ parsePrivateReductionRegion()

ParseResult parsePrivateReductionRegion ( OpAsmParser & parser,
Region & region,
llvm::SmallVectorImpl< OpAsmParser::UnresolvedOperand > & privateVars,
llvm::SmallVectorImpl< Type > & privateTypes,
ArrayAttr & privateSyms,
UnitAttr & privateNeedsBarrier,
ArrayAttr & reductionMods,
SmallVectorImpl< OpAsmParser::UnresolvedOperand > & reductionVars,
SmallVectorImpl< Type > & reductionTypes,
DenseBoolArrayAttr & reductionByref,
ArrayAttr & reductionSyms )
static

Definition at line 1647 of file OpenMPDialect.cpp.

References ArrayAttr(), and parseBlockArgRegion().

◆ parsePrivateRegion()

ParseResult parsePrivateRegion ( OpAsmParser & parser,
Region & region,
llvm::SmallVectorImpl< OpAsmParser::UnresolvedOperand > & privateVars,
llvm::SmallVectorImpl< Type > & privateTypes,
ArrayAttr & privateSyms,
UnitAttr & privateNeedsBarrier )
static

Definition at line 1636 of file OpenMPDialect.cpp.

References ArrayAttr(), and parseBlockArgRegion().

◆ parseScheduleClause()

ParseResult parseScheduleClause ( OpAsmParser & parser,
ClauseScheduleKindAttr & scheduleAttr,
ScheduleModifierAttr & scheduleMod,
UnitAttr & scheduleSimd,
std::optional< OpAsmParser::UnresolvedOperand > & chunkSize,
Type & chunkType )
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 793 of file OpenMPDialect.cpp.

References mlir::AsmParser::emitError(), mlir::AsmParser::getBuilder(), mlir::AsmParser::getContext(), mlir::Builder::getContext(), mlir::AsmParser::getCurrentLocation(), mlir::AsmParser::getNameLoc(), mlir::AsmParser::parseColonType(), mlir::AsmParser::parseKeyword(), mlir::OpAsmParser::parseOperand(), mlir::AsmParser::parseOptionalComma(), mlir::AsmParser::parseOptionalEqual(), success(), and verifyScheduleModifiers().

◆ parseSplitIteratedList()

template<typename ParsePrefixFn>
ParseResult parseSplitIteratedList ( OpAsmParser & parser,
SmallVectorImpl< OpAsmParser::UnresolvedOperand > & iteratedVars,
SmallVectorImpl< Type > & iteratedTypes,
SmallVectorImpl< OpAsmParser::UnresolvedOperand > & plainVars,
SmallVectorImpl< Type > & plainTypes,
ParsePrefixFn && parsePrefix )
static

◆ parseSynchronizationHint()

ParseResult parseSynchronizationHint ( OpAsmParser & parser,
IntegerAttr & hintAttr )
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 2354 of file OpenMPDialect.cpp.

References mlir::AsmParser::emitError(), mlir::AsmParser::getBuilder(), mlir::AsmParser::getCurrentLocation(), mlir::Builder::getI64Type(), mlir::AsmParser::parseCommaSeparatedList(), mlir::AsmParser::parseKeyword(), mlir::AsmParser::parseOptionalKeyword(), and success().

◆ parseTargetOpRegion()

ParseResult parseTargetOpRegion ( OpAsmParser & parser,
Region & region,
SmallVectorImpl< OpAsmParser::UnresolvedOperand > & hasDeviceAddrVars,
SmallVectorImpl< Type > & hasDeviceAddrTypes,
SmallVectorImpl< OpAsmParser::UnresolvedOperand > & hostEvalVars,
SmallVectorImpl< Type > & hostEvalTypes,
SmallVectorImpl< OpAsmParser::UnresolvedOperand > & mapVars,
SmallVectorImpl< Type > & mapTypes,
llvm::SmallVectorImpl< OpAsmParser::UnresolvedOperand > & privateVars,
llvm::SmallVectorImpl< Type > & privateTypes,
ArrayAttr & privateSyms,
UnitAttr & privateNeedsBarrier,
DenseI64ArrayAttr & privateMaps )
static

Definition at line 1579 of file OpenMPDialect.cpp.

References ArrayAttr(), and parseBlockArgRegion().

◆ parseTaskReductionRegion()

ParseResult parseTaskReductionRegion ( OpAsmParser & parser,
Region & region,
SmallVectorImpl< OpAsmParser::UnresolvedOperand > & taskReductionVars,
SmallVectorImpl< Type > & taskReductionTypes,
DenseBoolArrayAttr & taskReductionByref,
ArrayAttr & taskReductionSyms )
static

Definition at line 1687 of file OpenMPDialect.cpp.

References ArrayAttr(), and parseBlockArgRegion().

◆ parseUniformClause()

ParseResult parseUniformClause ( OpAsmParser & parser,
SmallVectorImpl< OpAsmParser::UnresolvedOperand > & uniformVars,
SmallVectorImpl< Type > & uniformTypes )
static

uniform ::= uniform ( uniform-list ) uniform-list := uniform-val (, uniform-val)* uniform-val := ssa-id : type

Definition at line 6112 of file OpenMPDialect.cpp.

References mlir::AsmParser::parseColonType(), mlir::AsmParser::parseCommaSeparatedList(), and mlir::OpAsmParser::parseOperand().

◆ parseUseDeviceAddrUseDevicePtrRegion()

ParseResult parseUseDeviceAddrUseDevicePtrRegion ( OpAsmParser & parser,
Region & region,
SmallVectorImpl< OpAsmParser::UnresolvedOperand > & useDeviceAddrVars,
SmallVectorImpl< Type > & useDeviceAddrTypes,
SmallVectorImpl< OpAsmParser::UnresolvedOperand > & useDevicePtrVars,
SmallVectorImpl< Type > & useDevicePtrTypes )
static

Definition at line 1698 of file OpenMPDialect.cpp.

References parseBlockArgRegion().

◆ printAffinityClause()

void printAffinityClause ( OpAsmPrinter & p,
Operation * op,
ValueRange iterated,
ValueRange affinityVars,
TypeRange iteratedTypes,
TypeRange affinityVarTypes )
static

Definition at line 6150 of file OpenMPDialect.cpp.

References printSplitIteratedList().

◆ printAlignedClause()

void printAlignedClause ( OpAsmPrinter & p,
Operation * op,
ValueRange alignedVars,
TypeRange alignedTypes,
std::optional< ArrayAttr > alignments )
static

Print Aligned Clause.

Definition at line 646 of file OpenMPDialect.cpp.

References mlir::ValueRange::getType().

◆ printAllocateAndAllocator()

void printAllocateAndAllocator ( OpAsmPrinter & p,
Operation * op,
OperandRange allocateVars,
TypeRange allocateTypes,
OperandRange allocatorVars,
TypeRange allocatorTypes )
static

Print allocate clause.

Definition at line 414 of file OpenMPDialect.cpp.

◆ printBlockArgClause() [1/4]

void printBlockArgClause ( OpAsmPrinter & p,
MLIRContext * ctx,
StringRef clauseName,
ValueRange argsSubrange,
std::optional< LinearPrintArgs > linearArgs )
static

Definition at line 1853 of file OpenMPDialect.cpp.

◆ printBlockArgClause() [2/4]

void printBlockArgClause ( OpAsmPrinter & p,
MLIRContext * ctx,
StringRef clauseName,
ValueRange argsSubrange,
std::optional< MapPrintArgs > mapArgs )
static

Definition at line 1824 of file OpenMPDialect.cpp.

References printClauseWithRegionArgs().

Referenced by printBlockArgRegion().

◆ printBlockArgClause() [3/4]

void printBlockArgClause ( OpAsmPrinter & p,
MLIRContext * ctx,
StringRef clauseName,
ValueRange argsSubrange,
std::optional< PrivatePrintArgs > privateArgs )
static

Definition at line 1832 of file OpenMPDialect.cpp.

References printClauseWithRegionArgs().

◆ printBlockArgClause() [4/4]

void printBlockArgClause ( OpAsmPrinter & p,
MLIRContext * ctx,
StringRef clauseName,
ValueRange argsSubrange,
std::optional< ReductionPrintArgs > reductionArgs )
static

Definition at line 1843 of file OpenMPDialect.cpp.

References printClauseWithRegionArgs().

◆ printBlockArgRegion()

◆ printCaptureType()

void printCaptureType ( OpAsmPrinter & p,
Operation * op,
VariableCaptureKindAttr mapCaptureType )
static

Definition at line 2653 of file OpenMPDialect.cpp.

◆ printClauseAttr()

template<typename ClauseAttr>
void printClauseAttr ( OpAsmPrinter & p,
Operation * op,
ClauseAttr attr )
static

Definition at line 445 of file OpenMPDialect.cpp.

◆ printClauseWithRegionArgs()

void printClauseWithRegionArgs ( OpAsmPrinter & p,
MLIRContext * ctx,
StringRef clauseName,
ValueRange argsSubrange,
ValueRange operands,
TypeRange types,
ArrayAttr symbols = nullptr,
DenseI64ArrayAttr mapIndices = nullptr,
DenseBoolArrayAttr byref = nullptr,
ArrayAttr modifier = nullptr,
UnitAttr needsBarrier = nullptr )
static

◆ printCopyprivate()

void printCopyprivate ( OpAsmPrinter & p,
Operation * op,
OperandRange copyprivateVars,
TypeRange copyprivateTypes,
std::optional< ArrayAttr > copyprivateSyms )
static

Print Copyprivate clause.

Definition at line 2171 of file OpenMPDialect.cpp.

◆ printDependVarList()

void printDependVarList ( OpAsmPrinter & p,
Operation * op,
OperandRange dependVars,
TypeRange dependTypes,
std::optional< ArrayAttr > dependKinds,
OperandRange iteratedVars,
TypeRange iteratedTypes,
std::optional< ArrayAttr > iteratedKinds )
static

Print Depend clause.

Definition at line 2296 of file OpenMPDialect.cpp.

◆ printDynGroupprivateClause()

void printDynGroupprivateClause ( OpAsmPrinter & printer,
Operation * op,
AccessGroupModifierAttr modifierFirst,
FallbackModifierAttr modifierSecond,
Value dynGroupprivateSize,
Type sizeType )
static

Definition at line 1136 of file OpenMPDialect.cpp.

◆ printGrainsizeClause()

void printGrainsizeClause ( OpAsmPrinter & p,
Operation * op,
ClauseGrainsizeTypeAttr grainsizeMod,
Value grainsize,
mlir::Type grainsizeType )
static

Definition at line 972 of file OpenMPDialect.cpp.

References printGranularityClause().

◆ printGranularityClause()

template<typename ClauseTypeAttr, typename ClauseType>
void printGranularityClause ( OpAsmPrinter & p,
Operation * op,
ClauseTypeAttr prescriptiveness,
Value operand,
mlir::Type operandType,
StringRef(* stringifyClauseType )(ClauseType) )
static

Definition at line 946 of file OpenMPDialect.cpp.

Referenced by printGrainsizeClause(), and printNumTasksClause().

◆ printHeapAllocClause()

void printHeapAllocClause ( OpAsmPrinter & p,
Operation * op,
TypeAttr inType,
ValueRange typeparams,
TypeRange typeparamsTypes,
ValueRange shape,
TypeRange shapeTypes )
static

Definition at line 1039 of file OpenMPDialect.cpp.

References mlir::OpAsmPrinter::printOperand().

◆ printInReductionClause()

void printInReductionClause ( OpAsmPrinter & p,
Operation * op,
ValueRange inReductionVars,
TypeRange inReductionTypes,
DenseBoolArrayAttr inReductionByref,
ArrayAttr inReductionSyms )
static

Prints an in_reduction clause for an operation that does not give its list items entry block arguments (e.g.

omp.target). Mirrors parseInReductionClause.

Definition at line 1208 of file OpenMPDialect.cpp.

References ArrayAttr(), mlir::detail::DenseArrayAttrImpl< T >::asArrayRef(), mlir::detail::DenseArrayAttrImpl< bool >::get(), and mlir::Operation::getContext().

◆ printInReductionPrivateReductionRegion()

void printInReductionPrivateReductionRegion ( OpAsmPrinter & p,
Operation * op,
Region & region,
ValueRange inReductionVars,
TypeRange inReductionTypes,
DenseBoolArrayAttr inReductionByref,
ArrayAttr inReductionSyms,
ValueRange privateVars,
TypeRange privateTypes,
ArrayAttr privateSyms,
UnitAttr privateNeedsBarrier,
ArrayAttr reductionMods,
ValueRange reductionVars,
TypeRange reductionTypes,
DenseBoolArrayAttr reductionByref,
ArrayAttr reductionSyms )
static

Definition at line 1948 of file OpenMPDialect.cpp.

References ArrayAttr(), and printBlockArgRegion().

◆ printInReductionPrivateRegion()

void printInReductionPrivateRegion ( OpAsmPrinter & p,
Operation * op,
Region & region,
ValueRange inReductionVars,
TypeRange inReductionTypes,
DenseBoolArrayAttr inReductionByref,
ArrayAttr inReductionSyms,
ValueRange privateVars,
TypeRange privateTypes,
ArrayAttr privateSyms,
UnitAttr privateNeedsBarrier )
static

Definition at line 1934 of file OpenMPDialect.cpp.

References ArrayAttr(), and printBlockArgRegion().

◆ printIteratorHeader()

◆ printLinearClause()

void printLinearClause ( OpAsmPrinter & p,
Operation * op,
ValueRange linearVars,
TypeRange linearTypes,
ValueRange linearStepVars,
TypeRange stepVarTypes,
ArrayAttr linearModifiers,
ArrayAttr linearSyms )
static

Print Linear Clause.

linearSyms is only used by ops with a region, which print the linear clause with their entry block arguments.

Definition at line 513 of file OpenMPDialect.cpp.

References ArrayAttr().

◆ printLinearPrivateReductionRegion()

void printLinearPrivateReductionRegion ( OpAsmPrinter & p,
Operation * op,
Region & region,
ValueRange linearVars,
TypeRange linearTypes,
ValueRange linearStepVars,
TypeRange linearStepTypes,
ArrayAttr linearVarTypes,
ArrayAttr linearModifiers,
ArrayAttr linearSyms,
ValueRange privateVars,
TypeRange privateTypes,
ArrayAttr privateSyms,
UnitAttr privateNeedsBarrier,
ArrayAttr reductionMods,
ValueRange reductionVars,
TypeRange reductionTypes,
DenseBoolArrayAttr reductionByref,
ArrayAttr reductionSyms )
static

Definition at line 1991 of file OpenMPDialect.cpp.

References ArrayAttr(), and printBlockArgRegion().

◆ printLoopTransformClis() [1/2]

void printLoopTransformClis ( OpAsmPrinter & p,
FuseOp op,
OperandRange generatees,
OperandRange applyees )
static

Definition at line 5290 of file OpenMPDialect.cpp.

◆ printLoopTransformClis() [2/2]

void printLoopTransformClis ( OpAsmPrinter & p,
TileOp op,
OperandRange generatees,
OperandRange applyees )
static

Definition at line 5140 of file OpenMPDialect.cpp.

◆ printMembersIndex()

void printMembersIndex ( OpAsmPrinter & p,
MapInfoOp op,
ArrayAttr membersIdx )
static

Definition at line 2638 of file OpenMPDialect.cpp.

References ArrayAttr().

◆ printNumTasksClause()

void printNumTasksClause ( OpAsmPrinter & p,
Operation * op,
ClauseNumTasksTypeAttr numTasksMod,
Value numTasks,
mlir::Type numTasksType )
static

Definition at line 994 of file OpenMPDialect.cpp.

References printGranularityClause().

◆ printOrderClause()

void printOrderClause ( OpAsmPrinter & p,
Operation * op,
ClauseOrderKindAttr order,
OrderModifierAttr orderMod )
static

Definition at line 899 of file OpenMPDialect.cpp.

◆ printPrivateReductionRegion()

void printPrivateReductionRegion ( OpAsmPrinter & p,
Operation * op,
Region & region,
ValueRange privateVars,
TypeRange privateTypes,
ArrayAttr privateSyms,
UnitAttr privateNeedsBarrier,
ArrayAttr reductionMods,
ValueRange reductionVars,
TypeRange reductionTypes,
DenseBoolArrayAttr reductionByref,
ArrayAttr reductionSyms )
static

Definition at line 1977 of file OpenMPDialect.cpp.

References ArrayAttr(), and printBlockArgRegion().

◆ printPrivateRegion()

void printPrivateRegion ( OpAsmPrinter & p,
Operation * op,
Region & region,
ValueRange privateVars,
TypeRange privateTypes,
ArrayAttr privateSyms,
UnitAttr privateNeedsBarrier )
static

Definition at line 1966 of file OpenMPDialect.cpp.

References ArrayAttr(), and printBlockArgRegion().

◆ printScheduleClause()

void printScheduleClause ( OpAsmPrinter & p,
Operation * op,
ClauseScheduleKindAttr scheduleKind,
ScheduleModifierAttr scheduleMod,
UnitAttr scheduleSimd,
Value scheduleChunk,
Type scheduleChunkType )
static

Print schedule clause.

Definition at line 855 of file OpenMPDialect.cpp.

References mlir::Value::getType().

◆ printSplitIteratedList()

template<typename PrintPrefixFn>
void printSplitIteratedList ( OpAsmPrinter & p,
ValueRange iteratedVars,
TypeRange iteratedTypes,
ValueRange plainVars,
TypeRange plainTypes,
PrintPrefixFn && printPrefixForPlain,
PrintPrefixFn && printPrefixForIterated )
static

Definition at line 2064 of file OpenMPDialect.cpp.

References emit().

Referenced by printAffinityClause().

◆ printSynchronizationHint()

void printSynchronizationHint ( OpAsmPrinter & p,
Operation * op,
IntegerAttr hintAttr )
static

Prints a Synchronization Hint clause.

Definition at line 2385 of file OpenMPDialect.cpp.

◆ printTargetOpRegion()

void printTargetOpRegion ( OpAsmPrinter & p,
Operation * op,
Region & region,
ValueRange hasDeviceAddrVars,
TypeRange hasDeviceAddrTypes,
ValueRange hostEvalVars,
TypeRange hostEvalTypes,
ValueRange mapVars,
TypeRange mapTypes,
ValueRange privateVars,
TypeRange privateTypes,
ArrayAttr privateSyms,
UnitAttr privateNeedsBarrier,
DenseI64ArrayAttr privateMaps )
static

Definition at line 1916 of file OpenMPDialect.cpp.

References ArrayAttr(), and printBlockArgRegion().

◆ printTaskReductionRegion()

void printTaskReductionRegion ( OpAsmPrinter & p,
Operation * op,
Region & region,
ValueRange taskReductionVars,
TypeRange taskReductionTypes,
DenseBoolArrayAttr taskReductionByref,
ArrayAttr taskReductionSyms )
static

Definition at line 2011 of file OpenMPDialect.cpp.

References ArrayAttr(), and printBlockArgRegion().

◆ printUniformClause()

void printUniformClause ( OpAsmPrinter & p,
Operation * op,
ValueRange uniformVars,
TypeRange uniformTypes )
static

Print Uniform Clauses.

Definition at line 6124 of file OpenMPDialect.cpp.

◆ printUseDeviceAddrUseDevicePtrRegion()

void printUseDeviceAddrUseDevicePtrRegion ( OpAsmPrinter & p,
Operation * op,
Region & region,
ValueRange useDeviceAddrVars,
TypeRange useDeviceAddrTypes,
ValueRange useDevicePtrVars,
TypeRange useDevicePtrTypes )
static

Definition at line 2023 of file OpenMPDialect.cpp.

References printBlockArgRegion().

◆ push_back()

◆ success()

◆ targetInReductionCapturedBy()

bool targetInReductionCapturedBy ( Value inReductionVar,
Value mapVarPtr )
static

An omp.target in_reduction operand is captured by a map_entries entry when the entry's MapInfoOp var_ptr is the same SSA value, or another result of the same defining op. At this stage, exact identity can only be required for block arguments, which have no defining op. Flang emits hlfir.declare #0 for the in_reduction operand and #1 for the map var_ptr; these collapse to the same value after lowering, but that cannot be enforced here.

Definition at line 3031 of file OpenMPDialect.cpp.

References mlir::Value::getDefiningOp().

◆ verifyAlignedClause()

LogicalResult verifyAlignedClause ( Operation * op,
std::optional< ArrayAttr > alignments,
OperandRange alignedVars )
static

Definition at line 585 of file OpenMPDialect.cpp.

References mlir::Operation::emitOpError(), and success().

◆ verifyAlignment()

LogicalResult verifyAlignment ( Operation & op,
std::optional< uint64_t > alignment )

Verifies align clause in allocate directive.

Definition at line 5984 of file OpenMPDialect.cpp.

References mlir::Operation::emitError(), and success().

◆ verifyAllocateClause()

LogicalResult verifyAllocateClause ( Operation * op,
ValueRange allocateVars,
ValueRange allocatorVars,
DenseI64ArrayAttr allocateAlignments,
DenseI64ArrayAttr allocatePrivateIndices,
ValueRange privateVars = {},
ArrayAttr privateSyms = nullptr,
bool requirePrivateIndices = false )
static

Definition at line 657 of file OpenMPDialect.cpp.

◆ verifyCopyprivateVarList()

LogicalResult verifyCopyprivateVarList ( Operation * op,
OperandRange copyprivateVars,
std::optional< ArrayAttr > copyprivateSyms )
static

Verifies CopyPrivate Clause.

Definition at line 2187 of file OpenMPDialect.cpp.

References mlir::Operation::emitOpError(), mlir::SymbolTable::lookupNearestSymbolFrom(), and success().

◆ verifyDeclareTargetAttr()

LogicalResult verifyDeclareTargetAttr ( Operation * op,
Attribute attr )
static

◆ verifyDependVarList()

LogicalResult verifyDependVarList ( Operation * op,
std::optional< ArrayAttr > dependKinds,
OperandRange dependVars,
std::optional< ArrayAttr > iteratedKinds,
OperandRange iteratedVars )
static

Verifies Depend clause.

Definition at line 2320 of file OpenMPDialect.cpp.

References mlir::Operation::emitOpError(), and success().

◆ verifyDynGroupprivateClause()

LogicalResult verifyDynGroupprivateClause ( Operation * op,
AccessGroupModifierAttr accessGroup,
FallbackModifierAttr fallback,
Value dynGroupprivateSize )
static

Definition at line 1058 of file OpenMPDialect.cpp.

References mlir::Operation::emitOpError(), and success().

◆ verifyLinearModifiers()

LogicalResult verifyLinearModifiers ( Operation * op,
std::optional< ArrayAttr > linearModifiers,
OperandRange linearVars,
bool isDeclareSimd = false )
static

OpenMP 5.2, Section 5.4.6: "A linear-modifier may be specified as ref or uval only on a declare simd directive.

" Also verifies that modifier count matches variable count.

Definition at line 542 of file OpenMPDialect.cpp.

References mlir::Operation::emitOpError(), and success().

◆ verifyLinearSyms()

template<typename OpType>
LogicalResult verifyLinearSyms ( OpType op)
static

Verifies that each linear variable has a linear privatizer.

Definition at line 3287 of file OpenMPDialect.cpp.

References mlir::SymbolTable::lookupNearestSymbolFrom(), and success().

◆ verifyMapClause()

LogicalResult verifyMapClause ( Operation * op,
OperandRange mapVars,
OperandRange mapIterated )
static

◆ verifyMapInfoDefinedArgs()

LogicalResult verifyMapInfoDefinedArgs ( Operation * op,
StringRef clauseName,
OperandRange vars )
static

Definition at line 2831 of file OpenMPDialect.cpp.

References mlir::Operation::emitOpError(), and success().

◆ verifyMapInfoForMapClause()

LogicalResult verifyMapInfoForMapClause ( Operation * op,
mlir::omp::MapInfoOp mapInfoOp,
llvm::DenseSet< mlir::TypedValue< mlir::omp::PointerLikeType > > & updateToVars,
llvm::DenseSet< mlir::TypedValue< mlir::omp::PointerLikeType > > & updateFromVars )
static

Definition at line 2690 of file OpenMPDialect.cpp.

References mlir::emitError(), mlir::Operation::getLoc(), mapTypeToBool(), and success().

Referenced by verifyMapClause().

◆ verifyNontemporalClause()

LogicalResult verifyNontemporalClause ( Operation * op,
OperandRange nontemporalVars )
static

Definition at line 570 of file OpenMPDialect.cpp.

References mlir::Operation::emitOpError(), and success().

◆ verifyNumTeamsClause()

LogicalResult verifyNumTeamsClause ( Operation * op,
Value numTeamsLower,
OperandRange numTeamsUpperVars )
static

◆ verifyOrderedParent()

◆ verifyPrivateVarList()

template<typename OpType>
LogicalResult verifyPrivateVarList ( OpType & op)
static

Definition at line 3241 of file OpenMPDialect.cpp.

References mlir::SymbolTable::lookupNearestSymbolFrom(), and success().

◆ verifyPrivateVarsMapping()

LogicalResult verifyPrivateVarsMapping ( TargetOp targetOp)
static

Definition at line 2809 of file OpenMPDialect.cpp.

References mlir::emitError(), and success().

◆ verifyReductionModifiers()

LogicalResult verifyReductionModifiers ( Operation * op,
OperandRange reductionVars,
ArrayAttr reductionMods )
static

Verify the per-variable modifier list has one entry per reduction variable.

Definition at line 2086 of file OpenMPDialect.cpp.

References ArrayAttr(), mlir::Operation::emitOpError(), and success().

Referenced by verifyReductionVarList().

◆ verifyReductionVarList()

LogicalResult verifyReductionVarList ( Operation * op,
std::optional< ArrayAttr > reductionSyms,
OperandRange reductionVars,
std::optional< ArrayRef< bool > > reductionByref,
ArrayAttr reductionMods = nullptr )
static

◆ verifyScheduleModifiers()

ParseResult verifyScheduleModifiers ( OpAsmParser & parser,
SmallVectorImpl< SmallString< 12 > > & modifiers )
static

◆ verifySynchronizationHint()

LogicalResult verifySynchronizationHint ( Operation * op,
uint64_t hint )
static

Verifies a synchronization hint clause.

Definition at line 2416 of file OpenMPDialect.cpp.

References mlir::Operation::emitOpError(), and success().

◆ while()

while ( succeeded(parser.parseOptionalComma()) )

Variable Documentation

◆ do

do
Initial value:
{
if (failed(parser.parseLSquare()))
return failure()

Definition at line 2618 of file OpenMPDialect.cpp.

◆ false

false

Parses a map_entries map type from a string format back into its numeric value.

map-clause = map_clauses ( ( ( always, ? implicit, ? ompx_hold, ? / close, ? present, ? ( to | from | delete ) )+ )` ) static ParseResult parseMapClause(OpAsmParser &parser, ClauseMapFlagsAttr &mapType) { ClauseMapFlags mapTypeBits = ClauseMapFlags::none; This simply verifies the correct keyword is read in, the keyword itself is stored inside of the operation auto parseTypeAndMod = [&]() -> ParseResult { StringRef mapTypeMod; if (parser.parseKeyword(&mapTypeMod)) return failure();

if (mapTypeMod == "always") mapTypeBits |= ClauseMapFlags::always;

if (mapTypeMod == "implicit") mapTypeBits |= ClauseMapFlags::implicit;

if (mapTypeMod == "ompx_hold") mapTypeBits |= ClauseMapFlags::ompx_hold;

if (mapTypeMod == "close") mapTypeBits |= ClauseMapFlags::close;

if (mapTypeMod == "present") mapTypeBits |= ClauseMapFlags::present;

if (mapTypeMod == "to") mapTypeBits |= ClauseMapFlags::to;

if (mapTypeMod == "from") mapTypeBits |= ClauseMapFlags::from;

if (mapTypeMod == "tofrom") mapTypeBits |= ClauseMapFlags::to | ClauseMapFlags::from;

if (mapTypeMod == "delete") mapTypeBits |= ClauseMapFlags::del;

if (mapTypeMod == "storage") mapTypeBits |= ClauseMapFlags::storage;

if (mapTypeMod == "return_param") mapTypeBits |= ClauseMapFlags::return_param;

if (mapTypeMod == "private") mapTypeBits |= ClauseMapFlags::priv;

if (mapTypeMod == "literal") mapTypeBits |= ClauseMapFlags::literal;

if (mapTypeMod == "attach") mapTypeBits |= ClauseMapFlags::attach;

if (mapTypeMod == "attach_always") mapTypeBits |= ClauseMapFlags::attach_always;

if (mapTypeMod == "attach_never") mapTypeBits |= ClauseMapFlags::attach_never;

if (mapTypeMod == "attach_auto") mapTypeBits |= ClauseMapFlags::attach_auto;

if (mapTypeMod == "ref_ptr") mapTypeBits |= ClauseMapFlags::ref_ptr;

if (mapTypeMod == "ref_ptee") mapTypeBits |= ClauseMapFlags::ref_ptee;

if (mapTypeMod == "is_device_ptr") mapTypeBits |= ClauseMapFlags::is_device_ptr;

if (mapTypeMod == "target_param") mapTypeBits |= ClauseMapFlags::target_param;

return success(); };

if (parser.parseCommaSeparatedList(parseTypeAndMod)) return failure();

mapType = parser.getBuilder().getAttr<mlir::omp::ClauseMapFlagsAttr>(mapTypeBits);

return success(); }

/ Prints a map_entries map type from its numeric value out into its string / format. static void printMapClause(OpAsmPrinter &p, Operation *op, ClauseMapFlagsAttr mapType) { llvm::SmallVector<std::string, 4> mapTypeStrs; ClauseMapFlags mapFlags = mapType.getValue();

handling of always, close, present placed at the beginning of the string to aid readability if (mapTypeToBool(mapFlags, ClauseMapFlags::always)) mapTypeStrs.push_back("always"); if (mapTypeToBool(mapFlags, ClauseMapFlags::implicit)) mapTypeStrs.push_back("implicit"); if (mapTypeToBool(mapFlags, ClauseMapFlags::ompx_hold)) mapTypeStrs.push_back("ompx_hold"); if (mapTypeToBool(mapFlags, ClauseMapFlags::close)) mapTypeStrs.push_back("close"); if (mapTypeToBool(mapFlags, ClauseMapFlags::present)) mapTypeStrs.push_back("present"); if (mapTypeToBool(mapFlags, ClauseMapFlags::target_param)) mapTypeStrs.push_back("target_param");

special handling of to/from/tofrom/delete and release/alloc, release + alloc are the abscense of one of the other flags, whereas tofrom requires both the to and from flag to be set. bool to = mapTypeToBool(mapFlags, ClauseMapFlags::to); bool from = mapTypeToBool(mapFlags, ClauseMapFlags::from);

if (to && from) mapTypeStrs.push_back("tofrom"); else if (from) mapTypeStrs.push_back("from"); else if (to) mapTypeStrs.push_back("to");

if (mapTypeToBool(mapFlags, ClauseMapFlags::del)) mapTypeStrs.push_back("delete"); if (mapTypeToBool(mapFlags, ClauseMapFlags::return_param)) mapTypeStrs.push_back("return_param"); if (mapTypeToBool(mapFlags, ClauseMapFlags::storage)) mapTypeStrs.push_back("storage"); if (mapTypeToBool(mapFlags, ClauseMapFlags::priv)) mapTypeStrs.push_back("private"); if (mapTypeToBool(mapFlags, ClauseMapFlags::literal)) mapTypeStrs.push_back("literal"); if (mapTypeToBool(mapFlags, ClauseMapFlags::attach)) mapTypeStrs.push_back("attach"); if (mapTypeToBool(mapFlags, ClauseMapFlags::attach_always)) mapTypeStrs.push_back("attach_always"); if (mapTypeToBool(mapFlags, ClauseMapFlags::attach_never)) mapTypeStrs.push_back("attach_never"); if (mapTypeToBool(mapFlags, ClauseMapFlags::attach_auto)) mapTypeStrs.push_back("attach_auto"); if (mapTypeToBool(mapFlags, ClauseMapFlags::ref_ptr)) mapTypeStrs.push_back("ref_ptr"); if (mapTypeToBool(mapFlags, ClauseMapFlags::ref_ptee)) mapTypeStrs.push_back("ref_ptee"); if (mapTypeToBool(mapFlags, ClauseMapFlags::is_device_ptr)) mapTypeStrs.push_back("is_device_ptr"); if (mapFlags == ClauseMapFlags::none) mapTypeStrs.push_back("none");

for (unsigned int i = 0; i < mapTypeStrs.size(); ++i) { p << mapTypeStrs[i]; if (i + 1 < mapTypeStrs.size()) { p << ", "; } } }

static ParseResult parseMembersIndex(OpAsmParser &parser, ArrayAttr &membersIdx) { SmallVector<Attribute> values, memberIdxs;

auto parseIndices = [&]() -> ParseResult { int64_t value; if (parser.parseInteger(value)) return failure(); values.push_back(IntegerAttr::get(parser.getBuilder().getIntegerType(64), APInt(64, value, /*isSigned=

Definition at line 2614 of file OpenMPDialect.cpp.

Referenced by mlir::Operation::CloneOptions::CloneOptions(), mlir::LLVM::detail::DebugTranslation::DebugTranslation(), mlir::sparse_tensor::ir_detail::DimLvlMap::DimLvlMap(), mlir::SideEffects::EffectInstance< Effect >::EffectInstance(), mlir::SideEffects::EffectInstance< Effect >::EffectInstance(), mlir::SideEffects::EffectInstance< Effect >::EffectInstance(), mlir::SideEffects::EffectInstance< Effect >::EffectInstance(), mlir::SideEffects::EffectInstance< Effect >::EffectInstance(), mlir::SideEffects::EffectInstance< Effect >::EffectInstance(), mlir::LLVM::detail::LLVMStructTypeStorage::Key::Key(), mlir::sparse_tensor::LatPoint::LatPoint(), mlir::pdll::Lexer::Lexer(), mlir::sparse_tensor::Merger::Merger(), mlir::detail::OperandStorage::OperandStorage(), mlir::OpPrintingFlags::OpPrintingFlags(), mlir::detail::PassOptions::Option< DataType, OptionParser >::Option(), mlir::detail::PassExecutionState::PassExecutionState(), mlir::PassManager::PassManager(), mlir::PassManager::PassManager(), mlir::PassPipelineCLParser::PassPipelineCLParser(), mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyRewritePatternSet::PyRewritePatternSet(), mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyTypeConverter::PyTypeConverter(), mlir::ShapedTypeComponents::ShapedTypeComponents(), mlir::presburger::Simplex::Simplex(), mlir::presburger::SimplexBase::SimplexBase(), mlir::spirv::detail::StructTypeStorage::StructTypeStorage(), mlir::spirv::detail::StructTypeStorage::StructTypeStorage(), and mlir::tosa::ValueKnowledge::ValueKnowledge().