MLIR  16.0.0git
Macros | Functions
OpenMPDialect.cpp File Reference
#include "mlir/Dialect/OpenMP/OpenMPDialect.h"
#include "mlir/Dialect/LLVMIR/LLVMTypes.h"
#include "mlir/IR/Attributes.h"
#include "mlir/IR/DialectImplementation.h"
#include "mlir/IR/OpImplementation.h"
#include "mlir/IR/OperationSupport.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 <cstddef>
#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 dependency graph for OpenMPDialect.cpp:

Go to the source code of this file.

Macros

#define GET_OP_LIST
 
#define GET_ATTRDEF_LIST
 
#define GET_ATTRDEF_CLASSES
 
#define GET_OP_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 verifyAlignedClause (Operation *op, 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, 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, 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, Optional< ArrayAttr > reductions)
 Print Reduction clause. More...
 
static LogicalResult verifyReductionVarList (Operation *op, Optional< ArrayAttr > reductions, OperandRange reductionVars)
 Verifies Reduction 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...
 
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) More...
 
void printLoopControl (OpAsmPrinter &p, Operation *op, Region &region, ValueRange lowerBound, ValueRange upperBound, ValueRange steps, TypeRange loopVarTypes, UnitAttr inclusive)
 
static ParseResult parseAtomicReductionRegion (OpAsmParser &parser, Region &region)
 
static void printAtomicReductionRegion (OpAsmPrinter &printer, ReductionDeclareOp op, Region &region)
 

Macro Definition Documentation

◆ GET_ATTRDEF_CLASSES

#define GET_ATTRDEF_CLASSES

Definition at line 1142 of file OpenMPDialect.cpp.

◆ GET_ATTRDEF_LIST

#define GET_ATTRDEF_LIST

◆ GET_OP_CLASSES

#define GET_OP_CLASSES

Definition at line 1145 of file OpenMPDialect.cpp.

◆ GET_OP_LIST

#define GET_OP_LIST

Function Documentation

◆ parseAlignedClause()

static ParseResult parseAlignedClause ( OpAsmParser parser,
SmallVectorImpl< OpAsmParser::UnresolvedOperand > &  alignedItems,
SmallVectorImpl< Type > &  types,
ArrayAttr &  alignmentValues 
)
static

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

Definition at line 215 of file OpenMPDialect.cpp.

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

◆ parseAllocateAndAllocator()

static ParseResult parseAllocateAndAllocator ( OpAsmParser parser,
SmallVectorImpl< OpAsmParser::UnresolvedOperand > &  operandsAllocate,
SmallVectorImpl< Type > &  typesAllocate,
SmallVectorImpl< OpAsmParser::UnresolvedOperand > &  operandsAllocator,
SmallVectorImpl< Type > &  typesAllocator 
)
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 71 of file OpenMPDialect.cpp.

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

◆ parseAtomicReductionRegion()

static ParseResult parseAtomicReductionRegion ( OpAsmParser parser,
Region region 
)
static

◆ parseClauseAttr()

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

◆ parseLinearClause()

static ParseResult parseLinearClause ( OpAsmParser parser,
SmallVectorImpl< OpAsmParser::UnresolvedOperand > &  vars,
SmallVectorImpl< Type > &  types,
SmallVectorImpl< OpAsmParser::UnresolvedOperand > &  stepVars 
)
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 140 of file OpenMPDialect.cpp.

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

◆ parseLoopControl()

ParseResult parseLoopControl ( OpAsmParser parser,
Region region,
SmallVectorImpl< OpAsmParser::UnresolvedOperand > &  lowerBound,
SmallVectorImpl< OpAsmParser::UnresolvedOperand > &  upperBound,
SmallVectorImpl< OpAsmParser::UnresolvedOperand > &  steps,
SmallVectorImpl< Type > &  loopVarTypes,
UnitAttr &  inclusive 
)

◆ parseReductionVarList()

static ParseResult parseReductionVarList ( OpAsmParser parser,
SmallVectorImpl< OpAsmParser::UnresolvedOperand > &  operands,
SmallVectorImpl< Type > &  types,
ArrayAttr &  redcuctionSymbols 
)
static

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

Definition at line 376 of file OpenMPDialect.cpp.

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

◆ parseScheduleClause()

static ParseResult parseScheduleClause ( OpAsmParser parser,
ClauseScheduleKindAttr &  scheduleAttr,
ScheduleModifierAttr &  scheduleModifier,
UnitAttr &  simdModifier,
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 293 of file OpenMPDialect.cpp.

References mlir::AsmParser::emitError(), mlir::failure(), 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().

◆ parseSynchronizationHint()

static 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 458 of file OpenMPDialect.cpp.

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

◆ printAlignedClause()

static void printAlignedClause ( OpAsmPrinter p,
Operation op,
ValueRange  alignedVars,
TypeRange  alignedVarTypes,
Optional< ArrayAttr >  alignmentValues 
)
static

Print Aligned Clause.

Definition at line 236 of file OpenMPDialect.cpp.

References mlir::ValueRange::getType().

◆ printAllocateAndAllocator()

static void printAllocateAndAllocator ( OpAsmPrinter p,
Operation op,
OperandRange  varsAllocate,
TypeRange  typesAllocate,
OperandRange  varsAllocator,
TypeRange  typesAllocator 
)
static

Print allocate clause.

Definition at line 97 of file OpenMPDialect.cpp.

◆ printAtomicReductionRegion()

static void printAtomicReductionRegion ( OpAsmPrinter printer,
ReductionDeclareOp  op,
Region region 
)
static

Definition at line 676 of file OpenMPDialect.cpp.

References mlir::Region::empty(), and mlir::OpAsmPrinter::printRegion().

◆ printClauseAttr()

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

Definition at line 128 of file OpenMPDialect.cpp.

◆ printLinearClause()

static void printLinearClause ( OpAsmPrinter p,
Operation op,
ValueRange  linearVars,
TypeRange  linearVarTypes,
ValueRange  linearStepVars 
)
static

Print Linear Clause.

Definition at line 160 of file OpenMPDialect.cpp.

◆ printLoopControl()

void printLoopControl ( OpAsmPrinter p,
Operation op,
Region region,
ValueRange  lowerBound,
ValueRange  upperBound,
ValueRange  steps,
TypeRange  loopVarTypes,
UnitAttr  inclusive 
)

◆ printReductionVarList()

static void printReductionVarList ( OpAsmPrinter p,
Operation op,
OperandRange  reductionVars,
TypeRange  reductionTypes,
Optional< ArrayAttr >  reductions 
)
static

Print Reduction clause.

Definition at line 396 of file OpenMPDialect.cpp.

References mlir::OperandRange::getType().

◆ printScheduleClause()

static void printScheduleClause ( OpAsmPrinter p,
Operation op,
ClauseScheduleKindAttr  schedAttr,
ScheduleModifierAttr  modifier,
UnitAttr  simd,
Value  scheduleChunkVar,
Type  scheduleChunkType 
)
static

Print schedule clause.

Definition at line 354 of file OpenMPDialect.cpp.

References mlir::Value::getType().

◆ printSynchronizationHint()

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

Prints a Synchronization Hint clause.

Definition at line 489 of file OpenMPDialect.cpp.

References value.

◆ verifyAlignedClause()

static LogicalResult verifyAlignedClause ( Operation op,
Optional< ArrayAttr >  alignmentValues,
OperandRange  alignedVariables 
)
static

Definition at line 176 of file OpenMPDialect.cpp.

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

◆ verifyReductionVarList()

static LogicalResult verifyReductionVarList ( Operation op,
Optional< ArrayAttr >  reductions,
OperandRange  reductionVars 
)
static

Verifies Reduction Clause.

Definition at line 409 of file OpenMPDialect.cpp.

References mlir::Type::cast(), mlir::Operation::emitOpError(), mlir::Value::getType(), and mlir::success().

◆ verifyScheduleModifiers()

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

◆ verifySynchronizationHint()

static LogicalResult verifySynchronizationHint ( Operation op,
uint64_t  hint 
)
static

Verifies a synchronization hint clause.

Definition at line 520 of file OpenMPDialect.cpp.

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