MLIR 24.0.0git
OpenACC.cpp File Reference
#include "mlir/Dialect/OpenACC/OpenACC.h"
#include "mlir/Dialect/Arith/IR/Arith.h"
#include "mlir/Dialect/GPU/IR/GPUDialect.h"
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
#include "mlir/Dialect/LLVMIR/LLVMTypes.h"
#include "mlir/Dialect/MemRef/IR/MemRef.h"
#include "mlir/Dialect/Utils/StaticValueUtils.h"
#include "mlir/IR/Builders.h"
#include "mlir/IR/BuiltinAttributes.h"
#include "mlir/IR/BuiltinOps.h"
#include "mlir/IR/BuiltinTypes.h"
#include "mlir/IR/DialectImplementation.h"
#include "mlir/IR/IRMapping.h"
#include "mlir/IR/Matchers.h"
#include "mlir/IR/OpImplementation.h"
#include "mlir/IR/SymbolTable.h"
#include "mlir/Support/LLVM.h"
#include "mlir/Transforms/DialectConversion.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/TypeSwitch.h"
#include "llvm/Support/LogicalResult.h"
#include <variant>
#include "mlir/Dialect/OpenACC/OpenACCOpsDialect.cpp.inc"
#include "mlir/Dialect/OpenACC/OpenACCOpsEnums.cpp.inc"
#include "mlir/Dialect/OpenACC/OpenACCOpsInterfaces.cpp.inc"
#include "mlir/Dialect/OpenACC/OpenACCTypeInterfaces.cpp.inc"
#include "mlir/Dialect/OpenACCMPCommon/Interfaces/OpenACCMPOpsInterfaces.cpp.inc"
#include "mlir/Dialect/OpenACC/OpenACCOps.cpp.inc"
#include "mlir/Dialect/OpenACC/OpenACCOpsAttributes.cpp.inc"
#include "mlir/Dialect/OpenACC/OpenACCOpsTypes.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_OP_CLASSES
#define GET_ATTRDEF_CLASSES
#define GET_TYPEDEF_CLASSES

Enumerations

enum class  BodyExecution { Always , Never , Maybe }
 Whether the body of a structured acc.loop is proven to run. More...

Functions

static void getSingleRegionOpSuccessorRegions (Operation *op, Region &region, RegionBranchPoint point, SmallVectorImpl< RegionSuccessor > &regions)
 Generic helper for single-region OpenACC ops that execute their body once and then continue after the operation with their results (if any).
static ValueRange getSingleRegionSuccessorInputs (Operation *op, RegionSuccessor successor)
static BodyExecution getBodyExecution (LoopOp loopOp)
 Prove whether the body of loopOp runs.
static bool hasDeviceTypeValues (std::optional< mlir::ArrayAttr > arrayAttr)
static bool hasDeviceType (std::optional< mlir::ArrayAttr > arrayAttr, mlir::acc::DeviceType deviceType)
static void printDeviceTypes (mlir::OpAsmPrinter &p, std::optional< mlir::ArrayAttr > deviceTypes)
static std::optional< unsignedfindSegment (ArrayAttr segments, mlir::acc::DeviceType deviceType)
static mlir::Operation::operand_range getValuesFromSegments (std::optional< mlir::ArrayAttr > arrayAttr, mlir::Operation::operand_range range, std::optional< llvm::ArrayRef< int32_t > > segments, mlir::acc::DeviceType deviceType)
static mlir::Value getWaitDevnumValue (std::optional< mlir::ArrayAttr > deviceTypeAttr, mlir::Operation::operand_range operands, std::optional< llvm::ArrayRef< int32_t > > segments, std::optional< mlir::ArrayAttr > hasWaitDevnum, mlir::acc::DeviceType deviceType)
static mlir::Operation::operand_range getWaitValuesWithoutDevnum (std::optional< mlir::ArrayAttr > deviceTypeAttr, mlir::Operation::operand_range operands, std::optional< llvm::ArrayRef< int32_t > > segments, std::optional< mlir::ArrayAttr > hasWaitDevnum, mlir::acc::DeviceType deviceType)
template<typename Op>
static LogicalResult checkWaitAndAsyncConflict (Op op)
template<typename Op>
static LogicalResult checkVarAndVarType (Op op)
template<typename Op>
static LogicalResult checkVarAndAccVar (Op op)
template<typename Op>
static LogicalResult checkNoModifier (Op op)
template<typename Op>
static LogicalResult checkValidModifier (Op op, acc::DataClauseModifier validModifiers)
template<typename OpT, typename RecipeOpT>
static LogicalResult checkRecipe (OpT op, llvm::StringRef operandName)
static ParseResult parseVar (mlir::OpAsmParser &parser, OpAsmParser::UnresolvedOperand &var)
static void printVar (mlir::OpAsmPrinter &p, mlir::Operation *op, mlir::Value var)
static ParseResult parseAccVar (mlir::OpAsmParser &parser, OpAsmParser::UnresolvedOperand &var, mlir::Type &accVarType)
static void printAccVar (mlir::OpAsmPrinter &p, mlir::Operation *op, mlir::Value accVar, mlir::Type accVarType)
static ParseResult parseVarPtrType (mlir::OpAsmParser &parser, mlir::Type &varPtrType, mlir::TypeAttr &varTypeAttr)
static void printVarPtrType (mlir::OpAsmPrinter &p, mlir::Operation *op, mlir::Type varPtrType, mlir::TypeAttr varTypeAttr)
static ParseResult parseSourceLocation (mlir::OpAsmParser &parser, mlir::LocationAttr &locAttr)
static void printSourceLocation (mlir::OpAsmPrinter &p, mlir::Operation *op, mlir::LocationAttr locAttr)
static ParseResult parseRecipeSym (mlir::OpAsmParser &parser, mlir::SymbolRefAttr &recipeAttr)
static void printRecipeSym (mlir::OpAsmPrinter &p, mlir::Operation *op, mlir::SymbolRefAttr recipeAttr)
static ParseResult parseDenseBoolArrayAttr (mlir::OpAsmParser &parser, mlir::DenseBoolArrayAttr &attr)
static void printDenseBoolArrayAttr (mlir::OpAsmPrinter &p, mlir::Operation *op, mlir::DenseBoolArrayAttr attr)
static ParseResult parseArrayAttr (mlir::OpAsmParser &parser, mlir::ArrayAttr &attr)
static void printArrayAttr (mlir::OpAsmPrinter &p, mlir::Operation *op, mlir::ArrayAttr attr)
static bool isEnclosedIntoComputeOp (mlir::Operation *op)
template<typename EffectTy>
static void addOperandEffect (SmallVectorImpl< SideEffects::EffectInstance< MemoryEffects::Effect > > &effects, MutableOperandRange operand)
 Helper to add an effect on an operand, referenced by its mutable range.
template<typename EffectTy>
static void addResultEffect (SmallVectorImpl< SideEffects::EffectInstance< MemoryEffects::Effect > > &effects, Value result)
 Helper to add an effect on a result value.
static LogicalResult verifyInitLikeSingleArgRegion (Operation *op, Region &region, StringRef regionType, StringRef regionName, Type type, bool verifyYield, bool optional=false)
template<typename Op>
static LogicalResult checkDataOperands (Op op, const mlir::ValueRange &operands)
 Check dataOperands for acc.parallel, acc.serial and acc.kernels.
template<typename OpT, typename RecipeOpT>
static LogicalResult checkPrivateOperands (mlir::Operation *accConstructOp, const mlir::ValueRange &operands, llvm::StringRef operandName)
template<typename Op>
static LogicalResult verifyDeviceTypeCountMatch (Op op, OperandRange operands, ArrayAttr deviceTypes, llvm::StringRef keyword)
template<typename Op>
static LogicalResult verifyDeviceTypeAndSegmentCountMatch (Op op, OperandRange operands, DenseI32ArrayAttr segments, ArrayAttr deviceTypes, llvm::StringRef keyword, int32_t maxInSegment=0)
static mlir::Value getValueInDeviceTypeSegment (std::optional< mlir::ArrayAttr > arrayAttr, mlir::Operation::operand_range range, mlir::acc::DeviceType deviceType)
static bool hasAnyGangWorkerVectorForDeviceType (std::optional< mlir::ArrayAttr > numGangsDeviceType, mlir::Operation::operand_range numGangs, std::optional< llvm::ArrayRef< int32_t > > numGangsSegments, std::optional< mlir::ArrayAttr > numWorkersDeviceType, mlir::Operation::operand_range numWorkers, std::optional< mlir::ArrayAttr > vectorLengthDeviceType, mlir::Operation::operand_range vectorLength, mlir::acc::DeviceType deviceType)
static ParseResult parseNumGangs (mlir::OpAsmParser &parser, llvm::SmallVectorImpl< mlir::OpAsmParser::UnresolvedOperand > &operands, llvm::SmallVectorImpl< Type > &types, mlir::ArrayAttr &deviceTypes, mlir::DenseI32ArrayAttr &segments)
static void printSingleDeviceType (mlir::OpAsmPrinter &p, mlir::Attribute attr)
static void printNumGangs (mlir::OpAsmPrinter &p, mlir::Operation *op, mlir::OperandRange operands, mlir::TypeRange types, std::optional< mlir::ArrayAttr > deviceTypes, std::optional< mlir::DenseI32ArrayAttr > segments)
static ParseResult parseDeviceTypeOperandsWithSegment (mlir::OpAsmParser &parser, llvm::SmallVectorImpl< mlir::OpAsmParser::UnresolvedOperand > &operands, llvm::SmallVectorImpl< Type > &types, mlir::ArrayAttr &deviceTypes, mlir::DenseI32ArrayAttr &segments)
static void printDeviceTypeOperandsWithSegment (mlir::OpAsmPrinter &p, mlir::Operation *op, mlir::OperandRange operands, mlir::TypeRange types, std::optional< mlir::ArrayAttr > deviceTypes, std::optional< mlir::DenseI32ArrayAttr > segments)
static ParseResult parseWaitClause (mlir::OpAsmParser &parser, llvm::SmallVectorImpl< mlir::OpAsmParser::UnresolvedOperand > &operands, llvm::SmallVectorImpl< Type > &types, mlir::ArrayAttr &deviceTypes, mlir::DenseI32ArrayAttr &segments, mlir::ArrayAttr &hasDevNum, mlir::ArrayAttr &keywordOnly)
static bool hasOnlyDeviceTypeNone (std::optional< mlir::ArrayAttr > attrs)
static void printWaitClause (mlir::OpAsmPrinter &p, mlir::Operation *op, mlir::OperandRange operands, mlir::TypeRange types, std::optional< mlir::ArrayAttr > deviceTypes, std::optional< mlir::DenseI32ArrayAttr > segments, std::optional< mlir::ArrayAttr > hasDevNum, std::optional< mlir::ArrayAttr > keywordOnly)
static ParseResult parseDeviceTypeOperands (mlir::OpAsmParser &parser, llvm::SmallVectorImpl< mlir::OpAsmParser::UnresolvedOperand > &operands, llvm::SmallVectorImpl< Type > &types, mlir::ArrayAttr &deviceTypes)
static void printDeviceTypeOperands (mlir::OpAsmPrinter &p, mlir::Operation *op, mlir::OperandRange operands, mlir::TypeRange types, std::optional< mlir::ArrayAttr > deviceTypes)
static ParseResult parseDeviceTypeOperandsWithKeywordOnly (mlir::OpAsmParser &parser, llvm::SmallVectorImpl< mlir::OpAsmParser::UnresolvedOperand > &operands, llvm::SmallVectorImpl< Type > &types, mlir::ArrayAttr &deviceTypes, mlir::ArrayAttr &keywordOnlyDeviceType)
static void printDeviceTypeOperandsWithKeywordOnly (mlir::OpAsmPrinter &p, mlir::Operation *op, mlir::OperandRange operands, mlir::TypeRange types, std::optional< mlir::ArrayAttr > deviceTypes, std::optional< mlir::ArrayAttr > keywordOnlyDeviceTypes)
static ParseResult parseOperandWithKeywordOnly (mlir::OpAsmParser &parser, std::optional< OpAsmParser::UnresolvedOperand > &operand, mlir::Type &operandType, mlir::UnitAttr &attr)
static void printOperandWithKeywordOnly (mlir::OpAsmPrinter &p, mlir::Operation *op, std::optional< mlir::Value > operand, mlir::Type operandType, mlir::UnitAttr attr)
static ParseResult parseOperandsWithKeywordOnly (mlir::OpAsmParser &parser, llvm::SmallVectorImpl< mlir::OpAsmParser::UnresolvedOperand > &operands, llvm::SmallVectorImpl< Type > &types, mlir::UnitAttr &attr)
static void printOperandsWithKeywordOnly (mlir::OpAsmPrinter &p, mlir::Operation *op, mlir::OperandRange operands, mlir::TypeRange types, mlir::UnitAttr attr)
static ParseResult parseCombinedConstructsLoop (mlir::OpAsmParser &parser, mlir::acc::CombinedConstructsTypeAttr &attr)
static void printCombinedConstructsLoop (mlir::OpAsmPrinter &p, mlir::Operation *op, mlir::acc::CombinedConstructsTypeAttr attr)
static ParseResult parseGangValue (OpAsmParser &parser, llvm::StringRef keyword, llvm::SmallVectorImpl< mlir::OpAsmParser::UnresolvedOperand > &operands, llvm::SmallVectorImpl< Type > &types, llvm::SmallVector< GangArgTypeAttr > &attributes, GangArgTypeAttr gangArgType, bool &needCommaBetweenValues, bool &newValue)
static ParseResult parseGangClause (OpAsmParser &parser, llvm::SmallVectorImpl< mlir::OpAsmParser::UnresolvedOperand > &gangOperands, llvm::SmallVectorImpl< Type > &gangOperandsType, mlir::ArrayAttr &gangArgType, mlir::ArrayAttr &deviceType, mlir::DenseI32ArrayAttr &segments, mlir::ArrayAttr &gangOnlyDeviceType)
void printGangClause (OpAsmPrinter &p, Operation *op, mlir::OperandRange operands, mlir::TypeRange types, std::optional< mlir::ArrayAttr > gangArgTypes, std::optional< mlir::ArrayAttr > deviceTypes, std::optional< mlir::DenseI32ArrayAttr > segments, std::optional< mlir::ArrayAttr > gangOnlyDeviceTypes)
bool hasDuplicateDeviceTypes (std::optional< mlir::ArrayAttr > segments, llvm::SmallSet< mlir::acc::DeviceType, 3 > &deviceTypes)
static std::optional< mlir::acc::DeviceType > checkDeviceTypes (mlir::ArrayAttr deviceTypes)
 Check for duplicates in the DeviceType array attribute.
ParseResult parseLoopControl (OpAsmParser &parser, Region &region, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &lowerbound, SmallVectorImpl< Type > &lowerboundType, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &upperbound, SmallVectorImpl< Type > &upperboundType, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &step, SmallVectorImpl< Type > &stepType)
 loop-control ::= control ( ssa-id-and-type-list ) = ( ssa-id-and-type-list ) to ( ssa-id-and-type-list ) step ( ssa-id-and-type-list ) region
void printLoopControl (OpAsmPrinter &p, Operation *op, Region &region, ValueRange lowerbound, TypeRange lowerboundType, ValueRange upperbound, TypeRange upperboundType, ValueRange steps, TypeRange stepType)
template<typename Op>
static LogicalResult checkDeclareOperands (Op &op, const mlir::ValueRange &operands, bool requireAtLeastOneOperand=true)
static unsigned getParallelismForDeviceType (acc::RoutineOp op, acc::DeviceType dtype)
static ParseResult parseBindName (OpAsmParser &parser, mlir::ArrayAttr &bindIdName, mlir::ArrayAttr &bindStrName, mlir::ArrayAttr &deviceIdTypes, mlir::ArrayAttr &deviceStrTypes)
static void printBindName (mlir::OpAsmPrinter &p, mlir::Operation *op, std::optional< mlir::ArrayAttr > bindIdName, std::optional< mlir::ArrayAttr > bindStrName, std::optional< mlir::ArrayAttr > deviceIdTypes, std::optional< mlir::ArrayAttr > deviceStrTypes)
static ParseResult parseRoutineGangClause (OpAsmParser &parser, mlir::ArrayAttr &gang, mlir::ArrayAttr &gangDim, mlir::ArrayAttr &gangDimDeviceTypes)
void printRoutineGangClause (OpAsmPrinter &p, Operation *op, std::optional< mlir::ArrayAttr > gang, std::optional< mlir::ArrayAttr > gangDim, std::optional< mlir::ArrayAttr > gangDimDeviceTypes)
static ParseResult parseDeviceTypeArrayAttr (OpAsmParser &parser, mlir::ArrayAttr &deviceTypes)
static void printDeviceTypeArrayAttr (mlir::OpAsmPrinter &p, mlir::Operation *op, std::optional< mlir::ArrayAttr > deviceTypes)

Macro Definition Documentation

◆ GET_ATTRDEF_CLASSES

#define GET_ATTRDEF_CLASSES

Definition at line 5343 of file OpenACC.cpp.

◆ GET_ATTRDEF_LIST

#define GET_ATTRDEF_LIST

◆ GET_OP_CLASSES

#define GET_OP_CLASSES

Definition at line 5340 of file OpenACC.cpp.

◆ GET_OP_LIST

#define GET_OP_LIST

◆ GET_TYPEDEF_CLASSES

#define GET_TYPEDEF_CLASSES

Definition at line 5346 of file OpenACC.cpp.

◆ GET_TYPEDEF_LIST

#define GET_TYPEDEF_LIST

Enumeration Type Documentation

◆ BodyExecution

enum class BodyExecution
strong

Whether the body of a structured acc.loop is proven to run.

This decides which edges out of the parent are feasible; the edges out of the region are unaffected.

Enumerator
Always 

The body runs at least once, so the parent cannot bypass the region.

Never 

The body never runs, so the parent cannot enter the region.

Maybe 

Neither could be proven, so the parent may do either.

Definition at line 602 of file OpenACC.cpp.

Function Documentation

◆ addOperandEffect()

template<typename EffectTy>
void addOperandEffect ( SmallVectorImpl< SideEffects::EffectInstance< MemoryEffects::Effect > > & effects,
MutableOperandRange operand )
static

Helper to add an effect on an operand, referenced by its mutable range.

Definition at line 1455 of file OpenACC.cpp.

References mlir::MutableOperandRange::size().

◆ addResultEffect()

template<typename EffectTy>
void addResultEffect ( SmallVectorImpl< SideEffects::EffectInstance< MemoryEffects::Effect > > & effects,
Value result )
static

Helper to add an effect on a result value.

Definition at line 1465 of file OpenACC.cpp.

References result.

◆ checkDataOperands()

template<typename Op>
LogicalResult checkDataOperands ( Op op,
const mlir::ValueRange & operands )
static

Check dataOperands for acc.parallel, acc.serial and acc.kernels.

Definition at line 2157 of file OpenACC.cpp.

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

◆ checkDeclareOperands()

template<typename Op>
LogicalResult checkDeclareOperands ( Op & op,
const mlir::ValueRange & operands,
bool requireAtLeastOneOperand = true )
static

◆ checkDeviceTypes()

std::optional< mlir::acc::DeviceType > checkDeviceTypes ( mlir::ArrayAttr deviceTypes)
static

Check for duplicates in the DeviceType array attribute.

Returns std::nullopt if no duplicates, or the duplicate DeviceType if found.

Definition at line 3646 of file OpenACC.cpp.

◆ checkNoModifier()

template<typename Op>
LogicalResult checkNoModifier ( Op op)
static

Definition at line 858 of file OpenACC.cpp.

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

◆ checkPrivateOperands()

template<typename OpT, typename RecipeOpT>
LogicalResult checkPrivateOperands ( mlir::Operation * accConstructOp,
const mlir::ValueRange & operands,
llvm::StringRef operandName )
static

Definition at line 2171 of file OpenACC.cpp.

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

◆ checkRecipe()

template<typename OpT, typename RecipeOpT>
LogicalResult checkRecipe ( OpT op,
llvm::StringRef operandName )
static

◆ checkValidModifier()

template<typename Op>
LogicalResult checkValidModifier ( Op op,
acc::DataClauseModifier validModifiers )
static

Definition at line 866 of file OpenACC.cpp.

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

◆ checkVarAndAccVar()

template<typename Op>
LogicalResult checkVarAndAccVar ( Op op)
static

Definition at line 850 of file OpenACC.cpp.

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

◆ checkVarAndVarType()

template<typename Op>
LogicalResult checkVarAndVarType ( Op op)
static

Definition at line 832 of file OpenACC.cpp.

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

◆ checkWaitAndAsyncConflict()

template<typename Op>
LogicalResult checkWaitAndAsyncConflict ( Op op)
static

Definition at line 810 of file OpenACC.cpp.

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

◆ findSegment()

std::optional< unsigned > findSegment ( ArrayAttr segments,
mlir::acc::DeviceType deviceType )
static

◆ getBodyExecution()

BodyExecution getBodyExecution ( LoopOp loopOp)
static

Prove whether the body of loopOp runs.

A counted dimension whose entry test already fails at its lower bound runs exactly zero times, so a single comparison decides both Always and Never. Bounds that are not constant prove nothing.

Definition at line 615 of file OpenACC.cpp.

References Always, mlir::getConstantIntValue(), Maybe, Never, and result.

◆ getParallelismForDeviceType()

unsigned getParallelismForDeviceType ( acc::RoutineOp op,
acc::DeviceType dtype )
static

Definition at line 4709 of file OpenACC.cpp.

◆ getSingleRegionOpSuccessorRegions()

void getSingleRegionOpSuccessorRegions ( Operation * op,
Region & region,
RegionBranchPoint point,
SmallVectorImpl< RegionSuccessor > & regions )
static

Generic helper for single-region OpenACC ops that execute their body once and then continue after the operation with their results (if any).

Definition at line 533 of file OpenACC.cpp.

References mlir::RegionBranchPoint::isParent().

◆ getSingleRegionSuccessorInputs()

ValueRange getSingleRegionSuccessorInputs ( Operation * op,
RegionSuccessor successor )
static

◆ getValueInDeviceTypeSegment()

mlir::Value getValueInDeviceTypeSegment ( std::optional< mlir::ArrayAttr > arrayAttr,
mlir::Operation::operand_range range,
mlir::acc::DeviceType deviceType )
static

Definition at line 2285 of file OpenACC.cpp.

References findSegment().

Referenced by hasAnyGangWorkerVectorForDeviceType().

◆ getValuesFromSegments()

mlir::Operation::operand_range getValuesFromSegments ( std::optional< mlir::ArrayAttr > arrayAttr,
mlir::Operation::operand_range range,
std::optional< llvm::ArrayRef< int32_t > > segments,
mlir::acc::DeviceType deviceType )
static

◆ getWaitDevnumValue()

mlir::Value getWaitDevnumValue ( std::optional< mlir::ArrayAttr > deviceTypeAttr,
mlir::Operation::operand_range operands,
std::optional< llvm::ArrayRef< int32_t > > segments,
std::optional< mlir::ArrayAttr > hasWaitDevnum,
mlir::acc::DeviceType deviceType )
static

Definition at line 770 of file OpenACC.cpp.

References findSegment(), getValuesFromSegments(), and hasDeviceTypeValues().

◆ getWaitValuesWithoutDevnum()

mlir::Operation::operand_range getWaitValuesWithoutDevnum ( std::optional< mlir::ArrayAttr > deviceTypeAttr,
mlir::Operation::operand_range operands,
std::optional< llvm::ArrayRef< int32_t > > segments,
std::optional< mlir::ArrayAttr > hasWaitDevnum,
mlir::acc::DeviceType deviceType )
static

Definition at line 790 of file OpenACC.cpp.

References findSegment(), and getValuesFromSegments().

◆ hasAnyGangWorkerVectorForDeviceType()

bool hasAnyGangWorkerVectorForDeviceType ( std::optional< mlir::ArrayAttr > numGangsDeviceType,
mlir::Operation::operand_range numGangs,
std::optional< llvm::ArrayRef< int32_t > > numGangsSegments,
std::optional< mlir::ArrayAttr > numWorkersDeviceType,
mlir::Operation::operand_range numWorkers,
std::optional< mlir::ArrayAttr > vectorLengthDeviceType,
mlir::Operation::operand_range vectorLength,
mlir::acc::DeviceType deviceType )
static

Definition at line 2342 of file OpenACC.cpp.

References getValueInDeviceTypeSegment(), and getValuesFromSegments().

◆ hasDeviceType()

bool hasDeviceType ( std::optional< mlir::ArrayAttr > arrayAttr,
mlir::acc::DeviceType deviceType )
static

Definition at line 716 of file OpenACC.cpp.

References hasDeviceTypeValues().

Referenced by checkWaitAndAsyncConflict().

◆ hasDeviceTypeValues()

◆ hasDuplicateDeviceTypes()

bool hasDuplicateDeviceTypes ( std::optional< mlir::ArrayAttr > segments,
llvm::SmallSet< mlir::acc::DeviceType, 3 > & deviceTypes )

Definition at line 3630 of file OpenACC.cpp.

◆ hasOnlyDeviceTypeNone()

bool hasOnlyDeviceTypeNone ( std::optional< mlir::ArrayAttr > attrs)
static

◆ isEnclosedIntoComputeOp()

bool isEnclosedIntoComputeOp ( mlir::Operation * op)
static

Definition at line 1449 of file OpenACC.cpp.

References ACC_COMPUTE_CONSTRUCT_OPS, and mlir::Operation::getParentOfType().

◆ parseAccVar()

◆ parseArrayAttr()

ParseResult parseArrayAttr ( mlir::OpAsmParser & parser,
mlir::ArrayAttr & attr )
static

Definition at line 1052 of file OpenACC.cpp.

References mlir::AsmParser::parseAttribute().

◆ parseBindName()

ParseResult parseBindName ( OpAsmParser & parser,
mlir::ArrayAttr & bindIdName,
mlir::ArrayAttr & bindStrName,
mlir::ArrayAttr & deviceIdTypes,
mlir::ArrayAttr & deviceStrTypes )
static

◆ parseCombinedConstructsLoop()

ParseResult parseCombinedConstructsLoop ( mlir::OpAsmParser & parser,
mlir::acc::CombinedConstructsTypeAttr & attr )
static

◆ parseDenseBoolArrayAttr()

ParseResult parseDenseBoolArrayAttr ( mlir::OpAsmParser & parser,
mlir::DenseBoolArrayAttr & attr )
static

Definition at line 1042 of file OpenACC.cpp.

References mlir::AsmParser::parseAttribute().

◆ parseDeviceTypeArrayAttr()

◆ parseDeviceTypeOperands()

ParseResult parseDeviceTypeOperands ( mlir::OpAsmParser & parser,
llvm::SmallVectorImpl< mlir::OpAsmParser::UnresolvedOperand > & operands,
llvm::SmallVectorImpl< Type > & types,
mlir::ArrayAttr & deviceTypes )
static

Definition at line 2775 of file OpenACC.cpp.

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

◆ parseDeviceTypeOperandsWithKeywordOnly()

◆ parseDeviceTypeOperandsWithSegment()

◆ parseGangClause()

◆ parseGangValue()

ParseResult parseGangValue ( OpAsmParser & parser,
llvm::StringRef keyword,
llvm::SmallVectorImpl< mlir::OpAsmParser::UnresolvedOperand > & operands,
llvm::SmallVectorImpl< Type > & types,
llvm::SmallVector< GangArgTypeAttr > & attributes,
GangArgTypeAttr gangArgType,
bool & needCommaBetweenValues,
bool & newValue )
static

◆ parseLoopControl()

ParseResult parseLoopControl ( OpAsmParser & parser,
Region & region,
SmallVectorImpl< OpAsmParser::UnresolvedOperand > & lowerbound,
SmallVectorImpl< Type > & lowerboundType,
SmallVectorImpl< OpAsmParser::UnresolvedOperand > & upperbound,
SmallVectorImpl< Type > & upperboundType,
SmallVectorImpl< OpAsmParser::UnresolvedOperand > & step,
SmallVectorImpl< Type > & stepType )

◆ parseNumGangs()

◆ parseOperandsWithKeywordOnly()

◆ parseOperandWithKeywordOnly()

ParseResult parseOperandWithKeywordOnly ( mlir::OpAsmParser & parser,
std::optional< OpAsmParser::UnresolvedOperand > & operand,
mlir::Type & operandType,
mlir::UnitAttr & attr )
static

◆ parseRecipeSym()

ParseResult parseRecipeSym ( mlir::OpAsmParser & parser,
mlir::SymbolRefAttr & recipeAttr )
static

Definition at line 1030 of file OpenACC.cpp.

References mlir::AsmParser::parseAttribute(), and success().

◆ parseRoutineGangClause()

◆ parseSourceLocation()

ParseResult parseSourceLocation ( mlir::OpAsmParser & parser,
mlir::LocationAttr & locAttr )
static

◆ parseVar()

◆ parseVarPtrType()

ParseResult parseVarPtrType ( mlir::OpAsmParser & parser,
mlir::Type & varPtrType,
mlir::TypeAttr & varTypeAttr )
static

◆ parseWaitClause()

◆ printAccVar()

void printAccVar ( mlir::OpAsmPrinter & p,
mlir::Operation * op,
mlir::Value accVar,
mlir::Type accVarType )
static

◆ printArrayAttr()

void printArrayAttr ( mlir::OpAsmPrinter & p,
mlir::Operation * op,
mlir::ArrayAttr attr )
static

Definition at line 1057 of file OpenACC.cpp.

◆ printBindName()

void printBindName ( mlir::OpAsmPrinter & p,
mlir::Operation * op,
std::optional< mlir::ArrayAttr > bindIdName,
std::optional< mlir::ArrayAttr > bindStrName,
std::optional< mlir::ArrayAttr > deviceIdTypes,
std::optional< mlir::ArrayAttr > deviceStrTypes )
static

Definition at line 4801 of file OpenACC.cpp.

References hasDeviceTypeValues(), and printSingleDeviceType().

◆ printCombinedConstructsLoop()

void printCombinedConstructsLoop ( mlir::OpAsmPrinter & p,
mlir::Operation * op,
mlir::acc::CombinedConstructsTypeAttr attr )
static

Definition at line 3005 of file OpenACC.cpp.

◆ printDenseBoolArrayAttr()

void printDenseBoolArrayAttr ( mlir::OpAsmPrinter & p,
mlir::Operation * op,
mlir::DenseBoolArrayAttr attr )
static

Definition at line 1047 of file OpenACC.cpp.

◆ printDeviceTypeArrayAttr()

void printDeviceTypeArrayAttr ( mlir::OpAsmPrinter & p,
mlir::Operation * op,
std::optional< mlir::ArrayAttr > deviceTypes )
static

Definition at line 4949 of file OpenACC.cpp.

References hasDeviceTypeValues().

◆ printDeviceTypeOperands()

void printDeviceTypeOperands ( mlir::OpAsmPrinter & p,
mlir::Operation * op,
mlir::OperandRange operands,
mlir::TypeRange types,
std::optional< mlir::ArrayAttr > deviceTypes )
static

Definition at line 2802 of file OpenACC.cpp.

References hasDeviceTypeValues(), and printSingleDeviceType().

Referenced by printDeviceTypeOperandsWithKeywordOnly().

◆ printDeviceTypeOperandsWithKeywordOnly()

void printDeviceTypeOperandsWithKeywordOnly ( mlir::OpAsmPrinter & p,
mlir::Operation * op,
mlir::OperandRange operands,
mlir::TypeRange types,
std::optional< mlir::ArrayAttr > deviceTypes,
std::optional< mlir::ArrayAttr > keywordOnlyDeviceTypes )
static

◆ printDeviceTypeOperandsWithSegment()

void printDeviceTypeOperandsWithSegment ( mlir::OpAsmPrinter & p,
mlir::Operation * op,
mlir::OperandRange operands,
mlir::TypeRange types,
std::optional< mlir::ArrayAttr > deviceTypes,
std::optional< mlir::DenseI32ArrayAttr > segments )
static

Definition at line 2627 of file OpenACC.cpp.

References printSingleDeviceType().

◆ printDeviceTypes()

void printDeviceTypes ( mlir::OpAsmPrinter & p,
std::optional< mlir::ArrayAttr > deviceTypes )
static

◆ printGangClause()

void printGangClause ( OpAsmPrinter & p,
Operation * op,
mlir::OperandRange operands,
mlir::TypeRange types,
std::optional< mlir::ArrayAttr > gangArgTypes,
std::optional< mlir::ArrayAttr > deviceTypes,
std::optional< mlir::DenseI32ArrayAttr > segments,
std::optional< mlir::ArrayAttr > gangOnlyDeviceTypes )

◆ printLoopControl()

void printLoopControl ( OpAsmPrinter & p,
Operation * op,
Region & region,
ValueRange lowerbound,
TypeRange lowerboundType,
ValueRange upperbound,
TypeRange upperboundType,
ValueRange steps,
TypeRange stepType )

◆ printNumGangs()

void printNumGangs ( mlir::OpAsmPrinter & p,
mlir::Operation * op,
mlir::OperandRange operands,
mlir::TypeRange types,
std::optional< mlir::ArrayAttr > deviceTypes,
std::optional< mlir::DenseI32ArrayAttr > segments )
static

Definition at line 2564 of file OpenACC.cpp.

References printSingleDeviceType().

◆ printOperandsWithKeywordOnly()

void printOperandsWithKeywordOnly ( mlir::OpAsmPrinter & p,
mlir::Operation * op,
mlir::OperandRange operands,
mlir::TypeRange types,
mlir::UnitAttr attr )
static

Definition at line 2969 of file OpenACC.cpp.

◆ printOperandWithKeywordOnly()

void printOperandWithKeywordOnly ( mlir::OpAsmPrinter & p,
mlir::Operation * op,
std::optional< mlir::Value > operand,
mlir::Type operandType,
mlir::UnitAttr attr )
static

◆ printRecipeSym()

void printRecipeSym ( mlir::OpAsmPrinter & p,
mlir::Operation * op,
mlir::SymbolRefAttr recipeAttr )
static

Definition at line 1037 of file OpenACC.cpp.

◆ printRoutineGangClause()

void printRoutineGangClause ( OpAsmPrinter & p,
Operation * op,
std::optional< mlir::ArrayAttr > gang,
std::optional< mlir::ArrayAttr > gangDim,
std::optional< mlir::ArrayAttr > gangDimDeviceTypes )

Definition at line 4892 of file OpenACC.cpp.

References hasDeviceTypeValues(), printDeviceTypes(), and printSingleDeviceType().

◆ printSingleDeviceType()

◆ printSourceLocation()

void printSourceLocation ( mlir::OpAsmPrinter & p,
mlir::Operation * op,
mlir::LocationAttr locAttr )
static

Definition at line 1025 of file OpenACC.cpp.

References mlir::AsmPrinter::printAttribute().

◆ printVar()

void printVar ( mlir::OpAsmPrinter & p,
mlir::Operation * op,
mlir::Value var )
static

Definition at line 912 of file OpenACC.cpp.

References mlir::Value::getType(), and mlir::OpAsmPrinter::printOperand().

◆ printVarPtrType()

void printVarPtrType ( mlir::OpAsmPrinter & p,
mlir::Operation * op,
mlir::Type varPtrType,
mlir::TypeAttr varTypeAttr )
static

Definition at line 987 of file OpenACC.cpp.

References mlir::AsmPrinter::printType().

◆ printWaitClause()

void printWaitClause ( mlir::OpAsmPrinter & p,
mlir::Operation * op,
mlir::OperandRange operands,
mlir::TypeRange types,
std::optional< mlir::ArrayAttr > deviceTypes,
std::optional< mlir::DenseI32ArrayAttr > segments,
std::optional< mlir::ArrayAttr > hasDevNum,
std::optional< mlir::ArrayAttr > keywordOnly )
static

◆ verifyDeviceTypeAndSegmentCountMatch()

template<typename Op>
LogicalResult verifyDeviceTypeAndSegmentCountMatch ( Op op,
OperandRange operands,
DenseI32ArrayAttr segments,
ArrayAttr deviceTypes,
llvm::StringRef keyword,
int32_t maxInSegment = 0 )
static

◆ verifyDeviceTypeCountMatch()

template<typename Op>
LogicalResult verifyDeviceTypeCountMatch ( Op op,
OperandRange operands,
ArrayAttr deviceTypes,
llvm::StringRef keyword )
static

Definition at line 2202 of file OpenACC.cpp.

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

◆ verifyInitLikeSingleArgRegion()

LogicalResult verifyInitLikeSingleArgRegion ( Operation * op,
Region & region,
StringRef regionType,
StringRef regionName,
Type type,
bool verifyYield,
bool optional = false )
static