#include "mlir/Target/LLVMIR/Dialect/LLVMIR/LLVMIRToLLVMTranslation.h"
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
#include "mlir/Dialect/LLVMIR/LLVMInterfaces.h"
#include "mlir/Support/LLVM.h"
#include "mlir/Target/LLVMIR/ModuleImport.h"
#include "llvm/ADT/PostOrderIterator.h"
#include "llvm/ADT/ScopeExit.h"
#include "llvm/ADT/StringSet.h"
#include "llvm/ADT/TypeSwitch.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/InlineAsm.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/Support/ModRef.h"
usingnamespacemlir;
usingnamespacemlir::LLVM;
usingnamespacemlir::LLVM::detail;
#include "mlir/Dialect/LLVMIR/LLVMConversionEnumsFromLLVM.inc"
static constexpr StringLiteral vecTypeHintMDName = …;
static constexpr StringLiteral workGroupSizeHintMDName = …;
static constexpr StringLiteral reqdWorkGroupSizeMDName = …;
static constexpr StringLiteral intelReqdSubGroupSizeMDName = …;
static bool isConvertibleIntrinsic(llvm::Intrinsic::ID id) { … }
static ArrayRef<unsigned> getSupportedIntrinsicsImpl() { … }
static LogicalResult convertIntrinsicImpl(OpBuilder &odsBuilder,
llvm::CallInst *inst,
LLVM::ModuleImport &moduleImport) { … }
static ArrayRef<unsigned> getSupportedMetadataImpl(llvm::LLVMContext &context) { … }
static LogicalResult setProfilingAttr(OpBuilder &builder, llvm::MDNode *node,
Operation *op,
LLVM::ModuleImport &moduleImport) { … }
static LogicalResult setTBAAAttr(const llvm::MDNode *node, Operation *op,
LLVM::ModuleImport &moduleImport) { … }
static LogicalResult setAccessGroupsAttr(const llvm::MDNode *node,
Operation *op,
LLVM::ModuleImport &moduleImport) { … }
static LogicalResult setLoopAttr(const llvm::MDNode *node, Operation *op,
LLVM::ModuleImport &moduleImport) { … }
static LogicalResult setAliasScopesAttr(const llvm::MDNode *node, Operation *op,
LLVM::ModuleImport &moduleImport) { … }
static LogicalResult setNoaliasScopesAttr(const llvm::MDNode *node,
Operation *op,
LLVM::ModuleImport &moduleImport) { … }
static std::optional<int32_t> parseIntegerMD(llvm::Metadata *md) { … }
static VecTypeHintAttr convertVecTypeHint(Builder builder, llvm::MDNode *node,
ModuleImport &moduleImport) { … }
static DenseI32ArrayAttr convertDenseI32Array(Builder builder,
llvm::MDNode *node) { … }
static IntegerAttr convertIntegerMD(Builder builder, llvm::MDNode *node) { … }
static LogicalResult setVecTypeHintAttr(Builder &builder, llvm::MDNode *node,
Operation *op,
LLVM::ModuleImport &moduleImport) { … }
static LogicalResult
setWorkGroupSizeHintAttr(Builder &builder, llvm::MDNode *node, Operation *op) { … }
static LogicalResult
setReqdWorkGroupSizeAttr(Builder &builder, llvm::MDNode *node, Operation *op) { … }
static LogicalResult setIntelReqdSubGroupSizeAttr(Builder &builder,
llvm::MDNode *node,
Operation *op) { … }
namespace {
class LLVMDialectLLVMIRImportInterface : public LLVMImportDialectInterface { … };
}
void mlir::registerLLVMDialectImport(DialectRegistry ®istry) { … }
void mlir::registerLLVMDialectImport(MLIRContext &context) { … }