MLIR  21.0.0git
Classes | Typedefs | Functions
LLVMIR.h File Reference
#include "mlir-c/IR.h"
#include "mlir-c/Support.h"
#include "llvm-c/Core.h"
#include "llvm-c/Support.h"

Go to the source code of this file.

Classes

struct  MlirTypeFromLLVMIRTranslator
 
struct  MlirTypeToLLVMIRTranslator
 

Typedefs

typedef struct MlirTypeFromLLVMIRTranslator MlirTypeFromLLVMIRTranslator
 
typedef struct MlirTypeToLLVMIRTranslator MlirTypeToLLVMIRTranslator
 

Functions

MLIR_CAPI_EXPORTED LLVMModuleRef mlirTranslateModuleToLLVMIR (MlirOperation module, LLVMContextRef context)
 Translate operation that satisfies LLVM dialect module requirements into an LLVM IR module living in the given context. More...
 
MLIR_CAPI_EXPORTED MlirTypeFromLLVMIRTranslator mlirTypeFromLLVMIRTranslatorCreate (MlirContext ctx)
 Create an LLVM::TypeFromLLVMIRTranslator and transfer ownership to the caller. More...
 
MLIR_CAPI_EXPORTED void mlirTypeFromLLVMIRTranslatorDestroy (MlirTypeFromLLVMIRTranslator translator)
 Takes an LLVM::TypeFromLLVMIRTranslator owned by the caller and destroys it. More...
 
MLIR_CAPI_EXPORTED MlirType mlirTypeFromLLVMIRTranslatorTranslateType (MlirTypeFromLLVMIRTranslator translator, LLVMTypeRef llvmType)
 Translates the given LLVM IR type to the MLIR LLVM dialect. More...
 
MLIR_CAPI_EXPORTED MlirTypeToLLVMIRTranslator mlirTypeToLLVMIRTranslatorCreate (LLVMContextRef ctx)
 Create an LLVM::TypeToLLVMIRTranslator and transfer ownership to the caller. More...
 
MLIR_CAPI_EXPORTED void mlirTypeToLLVMIRTranslatorDestroy (MlirTypeToLLVMIRTranslator translator)
 Takes an LLVM::TypeToLLVMIRTranslator owned by the caller and destroys it. More...
 
MLIR_CAPI_EXPORTED LLVMTypeRef mlirTypeToLLVMIRTranslatorTranslateType (MlirTypeToLLVMIRTranslator translator, MlirType mlirType)
 Translates the given MLIR LLVM dialect to the LLVM IR type. More...
 

Typedef Documentation

◆ MlirTypeFromLLVMIRTranslator

Definition at line 34 of file LLVMIR.h.

◆ MlirTypeToLLVMIRTranslator

Definition at line 54 of file LLVMIR.h.

Function Documentation

◆ mlirTranslateModuleToLLVMIR()

MLIR_CAPI_EXPORTED LLVMModuleRef mlirTranslateModuleToLLVMIR ( MlirOperation  module,
LLVMContextRef  context 
)

Translate operation that satisfies LLVM dialect module requirements into an LLVM IR module living in the given context.

This translates operations from any dilalect that has a registered implementation of LLVMTranslationDialectInterface.

Returns
the generated LLVM IR Module from the translated MLIR module, it is owned by the caller.

Definition at line 23 of file LLVMIR.cpp.

References mlir::translateModuleToLLVMIR(), unwrap(), and wrap().

◆ mlirTypeFromLLVMIRTranslatorCreate()

MLIR_CAPI_EXPORTED MlirTypeFromLLVMIRTranslator mlirTypeFromLLVMIRTranslatorCreate ( MlirContext  ctx)

Create an LLVM::TypeFromLLVMIRTranslator and transfer ownership to the caller.

◆ mlirTypeFromLLVMIRTranslatorDestroy()

MLIR_CAPI_EXPORTED void mlirTypeFromLLVMIRTranslatorDestroy ( MlirTypeFromLLVMIRTranslator  translator)

Takes an LLVM::TypeFromLLVMIRTranslator owned by the caller and destroys it.

It is the responsibility of the user to only pass an LLVM::TypeFromLLVMIRTranslator class.

Definition at line 47 of file LLVMIR.cpp.

References unwrap().

◆ mlirTypeFromLLVMIRTranslatorTranslateType()

MLIR_CAPI_EXPORTED MlirType mlirTypeFromLLVMIRTranslatorTranslateType ( MlirTypeFromLLVMIRTranslator  translator,
LLVMTypeRef  llvmType 
)

Translates the given LLVM IR type to the MLIR LLVM dialect.

Definition at line 52 of file LLVMIR.cpp.

References mlir::LLVM::TypeFromLLVMIRTranslator::translateType(), unwrap(), and wrap().

◆ mlirTypeToLLVMIRTranslatorCreate()

MLIR_CAPI_EXPORTED MlirTypeToLLVMIRTranslator mlirTypeToLLVMIRTranslatorCreate ( LLVMContextRef  ctx)

Create an LLVM::TypeToLLVMIRTranslator and transfer ownership to the caller.

◆ mlirTypeToLLVMIRTranslatorDestroy()

MLIR_CAPI_EXPORTED void mlirTypeToLLVMIRTranslatorDestroy ( MlirTypeToLLVMIRTranslator  translator)

Takes an LLVM::TypeToLLVMIRTranslator owned by the caller and destroys it.

It is the responsibility of the user to only pass an LLVM::TypeToLLVMIRTranslator class.

Definition at line 69 of file LLVMIR.cpp.

References unwrap().

◆ mlirTypeToLLVMIRTranslatorTranslateType()

MLIR_CAPI_EXPORTED LLVMTypeRef mlirTypeToLLVMIRTranslatorTranslateType ( MlirTypeToLLVMIRTranslator  translator,
MlirType  mlirType 
)

Translates the given MLIR LLVM dialect to the LLVM IR type.

Definition at line 74 of file LLVMIR.cpp.

References mlir::LLVM::TypeToLLVMIRTranslator::translateType(), unwrap(), and wrap().