|
MLIR 22.0.0git
|
#include "mlir/Target/LLVMIR/Dialect/OpenACC/OpenACCToLLVMIRTranslation.h"#include "mlir/Analysis/TopologicalSortUtils.h"#include "mlir/Dialect/LLVMIR/LLVMDialect.h"#include "mlir/Dialect/OpenACC/OpenACC.h"#include "mlir/IR/Operation.h"#include "mlir/Support/LLVM.h"#include "mlir/Target/LLVMIR/Dialect/OpenMPCommon.h"#include "mlir/Target/LLVMIR/ModuleTranslation.h"#include "llvm/ADT/TypeSwitch.h"#include "llvm/Frontend/OpenMP/OMPConstants.h"Go to the source code of this file.
Typedefs | |
| using | OpenACCIRBuilder = llvm::OpenMPIRBuilder |
Functions | |
| static llvm::Value * | createSourceLocationInfo (OpenACCIRBuilder &builder, Operation *op) |
| Create the location struct from the operation location information. | |
| static llvm::Function * | getAssociatedFunction (OpenACCIRBuilder &builder, Operation *op) |
| Return the runtime function used to lower the given operation. | |
| static LogicalResult | processOperands (llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation, Operation *op, ValueRange operands, unsigned totalNbOperand, uint64_t operandFlag, SmallVector< uint64_t > &flags, SmallVectorImpl< llvm::Constant * > &names, unsigned &index, struct OpenACCIRBuilder::MapperAllocas &mapperAllocas) |
| Extract pointer, size and mapping information from operands to populate the future functions arguments. | |
| static LogicalResult | processDataOperands (llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation, acc::EnterDataOp op, SmallVector< uint64_t > &flags, SmallVectorImpl< llvm::Constant * > &names, struct OpenACCIRBuilder::MapperAllocas &mapperAllocas) |
| Process data operands from acc::EnterDataOp. | |
| static LogicalResult | processDataOperands (llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation, acc::ExitDataOp op, SmallVector< uint64_t > &flags, SmallVectorImpl< llvm::Constant * > &names, struct OpenACCIRBuilder::MapperAllocas &mapperAllocas) |
| Process data operands from acc::ExitDataOp. | |
| static LogicalResult | processDataOperands (llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation, acc::UpdateOp op, SmallVector< uint64_t > &flags, SmallVectorImpl< llvm::Constant * > &names, struct OpenACCIRBuilder::MapperAllocas &mapperAllocas) |
| Process data operands from acc::UpdateOp. | |
| static LogicalResult | convertDataOp (acc::DataOp &op, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| Converts an OpenACC data operation into LLVM IR. | |
| template<typename OpTy> | |
| static LogicalResult | convertStandaloneDataOp (OpTy &op, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| Converts an OpenACC standalone data operation into LLVM IR. | |
Variables | |
| static constexpr uint64_t | kCreateFlag = 0x000 |
| Flag values are extracted from openmp/libomptarget/include/omptarget.h and mapped to corresponding OpenACC flags. | |
| static constexpr uint64_t | kDeviceCopyinFlag = 0x001 |
| static constexpr uint64_t | kHostCopyoutFlag = 0x002 |
| static constexpr uint64_t | kPresentFlag = 0x1000 |
| static constexpr uint64_t | kDeleteFlag = 0x008 |
| static constexpr uint64_t | kHoldFlag = 0x2000 |
| static constexpr int64_t | kDefaultDevice = -1 |
| Default value for the device id. | |
| using OpenACCIRBuilder = llvm::OpenMPIRBuilder |
Definition at line 28 of file OpenACCToLLVMIRTranslation.cpp.
|
static |
Converts an OpenACC data operation into LLVM IR.
Definition at line 260 of file OpenACCToLLVMIRTranslation.cpp.
References mlir::LLVM::ModuleTranslation::convertBlock(), createSourceLocationInfo(), mlir::getBlocksSortedByDominance(), mlir::LLVM::ModuleTranslation::getOpenMPBuilder(), kCreateFlag, kDefaultDevice, kDeleteFlag, kDeviceCopyinFlag, kHoldFlag, kHostCopyoutFlag, kPresentFlag, mlir::LLVM::ModuleTranslation::lookupBlock(), mlir::LLVM::ModuleTranslation::lookupFunction(), mlir::LLVM::ModuleTranslation::mapBlock(), processOperands(), and success().
|
static |
Converts an OpenACC standalone data operation into LLVM IR.
Definition at line 422 of file OpenACCToLLVMIRTranslation.cpp.
References createSourceLocationInfo(), getAssociatedFunction(), mlir::LLVM::ModuleTranslation::getOpenMPBuilder(), kDefaultDevice, mlir::LLVM::ModuleTranslation::lookupFunction(), processDataOperands(), and success().
|
static |
Create the location struct from the operation location information.
Definition at line 48 of file OpenACCToLLVMIRTranslation.cpp.
References mlir::LLVM::createSourceLocStrFromLocation(), mlir::Operation::getLoc(), and mlir::Operation::getParentOfType().
Referenced by convertDataOp(), and convertStandaloneDataOp().
|
static |
Return the runtime function used to lower the given operation.
Definition at line 60 of file OpenACCToLLVMIRTranslation.cpp.
Referenced by convertStandaloneDataOp().
|
static |
Process data operands from acc::EnterDataOp.
Definition at line 141 of file OpenACCToLLVMIRTranslation.cpp.
References kCreateFlag, kDeviceCopyinFlag, processOperands(), and success().
Referenced by convertStandaloneDataOp().
|
static |
Process data operands from acc::ExitDataOp.
Definition at line 181 of file OpenACCToLLVMIRTranslation.cpp.
References kDeleteFlag, kHostCopyoutFlag, processOperands(), and success().
|
static |
Process data operands from acc::UpdateOp.
Definition at line 222 of file OpenACCToLLVMIRTranslation.cpp.
References kDeviceCopyinFlag, kHostCopyoutFlag, processOperands(), and success().
|
static |
Extract pointer, size and mapping information from operands to populate the future functions arguments.
Definition at line 81 of file OpenACCToLLVMIRTranslation.cpp.
References mlir::LLVM::createMappingInformation(), mlir::Operation::emitOpError(), mlir::LLVM::ModuleTranslation::getOpenMPBuilder(), mlir::LLVM::ModuleTranslation::lookupValue(), and success().
Referenced by convertDataOp(), processDataOperands(), processDataOperands(), and processDataOperands().
|
staticconstexpr |
Flag values are extracted from openmp/libomptarget/include/omptarget.h and mapped to corresponding OpenACC flags.
Definition at line 36 of file OpenACCToLLVMIRTranslation.cpp.
Referenced by convertDataOp(), and processDataOperands().
|
staticconstexpr |
Default value for the device id.
Definition at line 45 of file OpenACCToLLVMIRTranslation.cpp.
Referenced by convertDataOp(), and convertStandaloneDataOp().
|
staticconstexpr |
Definition at line 40 of file OpenACCToLLVMIRTranslation.cpp.
Referenced by convertDataOp(), and processDataOperands().
|
staticconstexpr |
Definition at line 37 of file OpenACCToLLVMIRTranslation.cpp.
Referenced by convertDataOp(), processDataOperands(), and processDataOperands().
|
staticconstexpr |
Definition at line 42 of file OpenACCToLLVMIRTranslation.cpp.
Referenced by convertDataOp().
|
staticconstexpr |
Definition at line 38 of file OpenACCToLLVMIRTranslation.cpp.
Referenced by convertDataOp(), processDataOperands(), and processDataOperands().
|
staticconstexpr |
Definition at line 39 of file OpenACCToLLVMIRTranslation.cpp.
Referenced by convertDataOp().