MLIR 22.0.0git
mlir::LLVM::TypeToLLVMIRTranslator Class Reference

Utility class to translate MLIR LLVM dialect types to LLVM IR. More...

#include "mlir/Target/LLVMIR/TypeToLLVM.h"

Public Member Functions

 TypeToLLVMIRTranslator (llvm::LLVMContext &context)
 ~TypeToLLVMIRTranslator ()
unsigned getPreferredAlignment (Type type, const llvm::DataLayout &layout)
 Returns the preferred alignment for the type given the data layout.
llvm::Type * translateType (Type type)
 Translates the given MLIR LLVM dialect type to LLVM IR.

Detailed Description

Utility class to translate MLIR LLVM dialect types to LLVM IR.

Stores the translation state, in particular any identified structure types that can be reused in further translation.

Definition at line 39 of file TypeToLLVM.h.

Constructor & Destructor Documentation

◆ TypeToLLVMIRTranslator()

LLVM::TypeToLLVMIRTranslator::TypeToLLVMIRTranslator ( llvm::LLVMContext & context)

Definition at line 181 of file TypeToLLVM.cpp.

◆ ~TypeToLLVMIRTranslator()

LLVM::TypeToLLVMIRTranslator::~TypeToLLVMIRTranslator ( )
default

Member Function Documentation

◆ getPreferredAlignment()

unsigned LLVM::TypeToLLVMIRTranslator::getPreferredAlignment ( Type type,
const llvm::DataLayout & layout )

Returns the preferred alignment for the type given the data layout.

Note that this will perform type conversion and store its results for future uses.

Definition at line 190 of file TypeToLLVM.cpp.

References translateType().

Referenced by createDeviceArgumentAccessor(), getMemRefAlignment(), and getVectorAlignment().

◆ translateType()

llvm::Type * LLVM::TypeToLLVMIRTranslator::translateType ( Type type)

Translates the given MLIR LLVM dialect type to LLVM IR.

Definition at line 186 of file TypeToLLVM.cpp.

Referenced by getPreferredAlignment(), and mlirTypeToLLVMIRTranslatorTranslateType().


The documentation for this class was generated from the following files: