#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/BuiltinOps.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"
#include "llvm/Support/FormatVariadic.h"
usingnamespacemlir;
OpenACCIRBuilder;
static constexpr uint64_t kCreateFlag = …;
static constexpr uint64_t kDeviceCopyinFlag = …;
static constexpr uint64_t kHostCopyoutFlag = …;
static constexpr uint64_t kPresentFlag = …;
static constexpr uint64_t kDeleteFlag = …;
static constexpr uint64_t kHoldFlag = …;
static constexpr int64_t kDefaultDevice = …;
static llvm::Value *createSourceLocationInfo(OpenACCIRBuilder &builder,
Operation *op) { … }
static llvm::Function *getAssociatedFunction(OpenACCIRBuilder &builder,
Operation *op) { … }
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) { … }
static LogicalResult
processDataOperands(llvm::IRBuilderBase &builder,
LLVM::ModuleTranslation &moduleTranslation,
acc::EnterDataOp op, SmallVector<uint64_t> &flags,
SmallVectorImpl<llvm::Constant *> &names,
struct OpenACCIRBuilder::MapperAllocas &mapperAllocas) { … }
static LogicalResult
processDataOperands(llvm::IRBuilderBase &builder,
LLVM::ModuleTranslation &moduleTranslation,
acc::ExitDataOp op, SmallVector<uint64_t> &flags,
SmallVectorImpl<llvm::Constant *> &names,
struct OpenACCIRBuilder::MapperAllocas &mapperAllocas) { … }
static LogicalResult
processDataOperands(llvm::IRBuilderBase &builder,
LLVM::ModuleTranslation &moduleTranslation,
acc::UpdateOp op, SmallVector<uint64_t> &flags,
SmallVectorImpl<llvm::Constant *> &names,
struct OpenACCIRBuilder::MapperAllocas &mapperAllocas) { … }
static LogicalResult convertDataOp(acc::DataOp &op,
llvm::IRBuilderBase &builder,
LLVM::ModuleTranslation &moduleTranslation) { … }
template <typename OpTy>
static LogicalResult
convertStandaloneDataOp(OpTy &op, llvm::IRBuilderBase &builder,
LLVM::ModuleTranslation &moduleTranslation) { … }
namespace {
class OpenACCDialectLLVMIRTranslationInterface
: public LLVMTranslationDialectInterface { … };
}
LogicalResult OpenACCDialectLLVMIRTranslationInterface::convertOperation(
Operation *op, llvm::IRBuilderBase &builder,
LLVM::ModuleTranslation &moduleTranslation) const { … }
void mlir::registerOpenACCDialectTranslation(DialectRegistry ®istry) { … }
void mlir::registerOpenACCDialectTranslation(MLIRContext &context) { … }