MLIR  19.0.0git
Functions
LLVMIRToLLVMTranslation.cpp File Reference
#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"
#include "mlir/Dialect/LLVMIR/LLVMConversionEnumsFromLLVM.inc"
#include "mlir/Dialect/LLVMIR/LLVMConvertibleLLVMIRIntrinsics.inc"
#include "mlir/Dialect/LLVMIR/LLVMIntrinsicFromLLVMIRConversions.inc"

Go to the source code of this file.

Functions

static bool isConvertibleIntrinsic (llvm::Intrinsic::ID id)
 Returns true if the LLVM IR intrinsic is convertible to an MLIR LLVM dialect intrinsic. More...
 
static ArrayRef< unsigned > getSupportedIntrinsicsImpl ()
 Returns the list of LLVM IR intrinsic identifiers that are convertible to MLIR LLVM dialect intrinsics. More...
 
static LogicalResult convertIntrinsicImpl (OpBuilder &odsBuilder, llvm::CallInst *inst, LLVM::ModuleImport &moduleImport)
 Converts the LLVM intrinsic to an MLIR LLVM dialect operation if a conversion exits. More...
 
static ArrayRef< unsigned > getSupportedMetadataImpl ()
 Returns the list of LLVM IR metadata kinds that are convertible to MLIR LLVM dialect attributes. More...
 
static LogicalResult setProfilingAttr (OpBuilder &builder, llvm::MDNode *node, Operation *op, LLVM::ModuleImport &moduleImport)
 Converts the given profiling metadata node to an MLIR profiling attribute and attaches it to the imported operation if the translation succeeds. More...
 
static LogicalResult setTBAAAttr (const llvm::MDNode *node, Operation *op, LLVM::ModuleImport &moduleImport)
 Searches for the attribute that maps to the given TBAA metadata node and attaches it to the imported operation if the lookup succeeds. More...
 
static LogicalResult setAccessGroupsAttr (const llvm::MDNode *node, Operation *op, LLVM::ModuleImport &moduleImport)
 Looks up all the access group attributes that map to the access group nodes starting from the access group metadata node, and attaches all of them to the imported operation if the lookups succeed. More...
 
static LogicalResult setLoopAttr (const llvm::MDNode *node, Operation *op, LLVM::ModuleImport &moduleImport)
 Converts the given loop metadata node to an MLIR loop annotation attribute and attaches it to the imported operation if the translation succeeds. More...
 
static LogicalResult setAliasScopesAttr (const llvm::MDNode *node, Operation *op, LLVM::ModuleImport &moduleImport)
 Looks up all the alias scope attributes that map to the alias scope nodes starting from the alias scope metadata node, and attaches all of them to the imported operation if the lookups succeed. More...
 
static LogicalResult setNoaliasScopesAttr (const llvm::MDNode *node, Operation *op, LLVM::ModuleImport &moduleImport)
 Looks up all the alias scope attributes that map to the alias scope nodes starting from the noalias metadata node, and attaches all of them to the imported operation if the lookups succeed. More...
 

Function Documentation

◆ convertIntrinsicImpl()

static LogicalResult convertIntrinsicImpl ( OpBuilder odsBuilder,
llvm::CallInst *  inst,
LLVM::ModuleImport moduleImport 
)
static

Converts the LLVM intrinsic to an MLIR LLVM dialect operation if a conversion exits.

Returns failure otherwise.

Definition at line 55 of file LLVMIRToLLVMTranslation.cpp.

References mlir::failure(), and isConvertibleIntrinsic().

◆ getSupportedIntrinsicsImpl()

static ArrayRef<unsigned> getSupportedIntrinsicsImpl ( )
static

Returns the list of LLVM IR intrinsic identifiers that are convertible to MLIR LLVM dialect intrinsics.

Definition at line 46 of file LLVMIRToLLVMTranslation.cpp.

◆ getSupportedMetadataImpl()

static ArrayRef<unsigned> getSupportedMetadataImpl ( )
static

Returns the list of LLVM IR metadata kinds that are convertible to MLIR LLVM dialect attributes.

Definition at line 73 of file LLVMIRToLLVMTranslation.cpp.

◆ isConvertibleIntrinsic()

static bool isConvertibleIntrinsic ( llvm::Intrinsic::ID  id)
static

Returns true if the LLVM IR intrinsic is convertible to an MLIR LLVM dialect intrinsic.

Returns false otherwise.

Definition at line 37 of file LLVMIRToLLVMTranslation.cpp.

Referenced by convertIntrinsicImpl().

◆ setAccessGroupsAttr()

static LogicalResult setAccessGroupsAttr ( const llvm::MDNode *  node,
Operation op,
LLVM::ModuleImport moduleImport 
)
static

Looks up all the access group attributes that map to the access group nodes starting from the access group metadata node, and attaches all of them to the imported operation if the lookups succeed.

Returns failure otherwise.

Definition at line 155 of file LLVMIRToLLVMTranslation.cpp.

◆ setAliasScopesAttr()

static LogicalResult setAliasScopesAttr ( const llvm::MDNode *  node,
Operation op,
LLVM::ModuleImport moduleImport 
)
static

Looks up all the alias scope attributes that map to the alias scope nodes starting from the alias scope metadata node, and attaches all of them to the imported operation if the lookups succeed.

Returns failure otherwise.

Definition at line 193 of file LLVMIRToLLVMTranslation.cpp.

◆ setLoopAttr()

static LogicalResult setLoopAttr ( const llvm::MDNode *  node,
Operation op,
LLVM::ModuleImport moduleImport 
)
static

Converts the given loop metadata node to an MLIR loop annotation attribute and attaches it to the imported operation if the translation succeeds.

Returns failure otherwise.

Definition at line 175 of file LLVMIRToLLVMTranslation.cpp.

◆ setNoaliasScopesAttr()

static LogicalResult setNoaliasScopesAttr ( const llvm::MDNode *  node,
Operation op,
LLVM::ModuleImport moduleImport 
)
static

Looks up all the alias scope attributes that map to the alias scope nodes starting from the noalias metadata node, and attaches all of them to the imported operation if the lookups succeed.

Returns failure otherwise.

Definition at line 212 of file LLVMIRToLLVMTranslation.cpp.

◆ setProfilingAttr()

static LogicalResult setProfilingAttr ( OpBuilder builder,
llvm::MDNode *  node,
Operation op,
LLVM::ModuleImport moduleImport 
)
static

Converts the given profiling metadata node to an MLIR profiling attribute and attaches it to the imported operation if the translation succeeds.

Returns failure otherwise.

Definition at line 84 of file LLVMIRToLLVMTranslation.cpp.

◆ setTBAAAttr()

static LogicalResult setTBAAAttr ( const llvm::MDNode *  node,
Operation op,
LLVM::ModuleImport moduleImport 
)
static

Searches for the attribute that maps to the given TBAA metadata node and attaches it to the imported operation if the lookup succeeds.

Returns failure otherwise.

Definition at line 138 of file LLVMIRToLLVMTranslation.cpp.