My Project
Public Member Functions | Protected Attributes | List of all members
mlir::LLVMTypeConverter Class Reference

Conversion from types in the Standard dialect to the LLVM IR dialect. More...

#include <ConvertStandardToLLVM.h>

Inheritance diagram for mlir::LLVMTypeConverter:
Inheritance graph
[legend]
Collaboration diagram for mlir::LLVMTypeConverter:
Collaboration graph
[legend]

Public Member Functions

 LLVMTypeConverter (MLIRContext *ctx)
 
Type convertType (Type t) override
 
LLVM::LLVMType convertFunctionSignature (FunctionType type, bool isVariadic, SignatureConversion &result)
 
Type packFunctionResults (ArrayRef< Type > types)
 
llvm::LLVMContext & getLLVMContext ()
 Returns the LLVM context. More...
 
LLVM::LLVMDialectgetDialect ()
 Returns the LLVM dialect. More...
 
SmallVector< Value, 4 > promoteMemRefDescriptors (Location loc, ValueRange opOperands, ValueRange operands, OpBuilder &builder)
 
Value promoteOneMemRefDescriptor (Location loc, Value operand, OpBuilder &builder)
 
- Public Member Functions inherited from mlir::TypeConverter
virtual ~TypeConverter ()=default
 
virtual LogicalResult convertType (Type t, SmallVectorImpl< Type > &results)
 This hooks allows for converting a type. More...
 
LogicalResult convertTypes (ArrayRef< Type > types, SmallVectorImpl< Type > &results)
 
bool isLegal (Type type)
 
bool isSignatureLegal (FunctionType funcType)
 
virtual LogicalResult convertSignatureArg (unsigned inputNo, Type type, SignatureConversion &result)
 This hook allows for converting a specific argument of a signature. More...
 
Optional< SignatureConversionconvertBlockSignature (Block *block)
 
virtual OperationmaterializeConversion (PatternRewriter &rewriter, Type resultType, ArrayRef< Value > inputs, Location loc)
 

Protected Attributes

llvm::Module * module
 LLVM IR module used to parse/create types. More...
 
LLVM::LLVMDialectllvmDialect
 

Detailed Description

Conversion from types in the Standard dialect to the LLVM IR dialect.

Constructor & Destructor Documentation

◆ LLVMTypeConverter()

LLVMTypeConverter::LLVMTypeConverter ( MLIRContext ctx)

Member Function Documentation

◆ convertFunctionSignature()

LLVM::LLVMType LLVMTypeConverter::convertFunctionSignature ( FunctionType  type,
bool  isVariadic,
LLVMTypeConverter::SignatureConversion result 
)

Convert a function type. The arguments and results are converted one by one and results are packed into a wrapped LLVM IR structure type. result is populated with argument mapping.

◆ convertType()

Type LLVMTypeConverter::convertType ( Type  t)
overridevirtual

Convert types to LLVM IR. This calls convertAdditionalType to convert non-standard or non-builtin types.

Reimplemented from mlir::TypeConverter.

◆ getDialect()

LLVM::LLVMDialect* mlir::LLVMTypeConverter::getDialect ( )
inline

Returns the LLVM dialect.

◆ getLLVMContext()

llvm::LLVMContext & LLVMTypeConverter::getLLVMContext ( )

Returns the LLVM context.

◆ packFunctionResults()

Type LLVMTypeConverter::packFunctionResults ( ArrayRef< Type types)

Convert a non-empty list of types to be returned from a function into a supported LLVM IR type. In particular, if more than one values is returned, create an LLVM IR structure type with elements that correspond to each of the MLIR types converted with convertType.

◆ promoteMemRefDescriptors()

SmallVector< Value, 4 > LLVMTypeConverter::promoteMemRefDescriptors ( Location  loc,
ValueRange  opOperands,
ValueRange  operands,
OpBuilder builder 
)

Promote the LLVM struct representation of all MemRef descriptors to stack and use pointers to struct to avoid the complexity of the platform-specific C/C++ ABI lowering related to struct argument passing.

◆ promoteOneMemRefDescriptor()

Value LLVMTypeConverter::promoteOneMemRefDescriptor ( Location  loc,
Value  operand,
OpBuilder builder 
)

Promote the LLVM struct representation of one MemRef descriptor to stack and use pointer to struct to avoid the complexity of the platform-specific C/C++ ABI lowering related to struct argument passing.

Member Data Documentation

◆ llvmDialect

LLVM::LLVMDialect* mlir::LLVMTypeConverter::llvmDialect
protected

◆ module

llvm::Module* mlir::LLVMTypeConverter::module
protected

LLVM IR module used to parse/create types.


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