MLIR  20.0.0git
Functions
TypeConverter.cpp File Reference
#include "mlir/Conversion/LLVMCommon/TypeConverter.h"
#include "MemRefDescriptor.h"
#include "mlir/Conversion/LLVMCommon/MemRefBuilder.h"
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
#include "mlir/Dialect/LLVMIR/LLVMTypes.h"
#include "llvm/ADT/ScopeExit.h"
#include "llvm/Support/Threading.h"
#include <memory>
#include <mutex>
#include <optional>

Go to the source code of this file.

Functions

static bool isBarePointer (ValueRange values)
 Helper function that checks if the given value range is a bare pointer. More...
 
static Value packUnrankedMemRefDesc (OpBuilder &builder, UnrankedMemRefType resultType, ValueRange inputs, Location loc, const LLVMTypeConverter &converter)
 Pack SSA values into an unranked memref descriptor struct. More...
 
static Value packRankedMemRefDesc (OpBuilder &builder, MemRefType resultType, ValueRange inputs, Location loc, const LLVMTypeConverter &converter)
 Pack SSA values into a ranked memref descriptor struct. More...
 
static Value unrankedMemRefMaterialization (OpBuilder &builder, UnrankedMemRefType resultType, ValueRange inputs, Location loc, const LLVMTypeConverter &converter)
 MemRef descriptor elements -> UnrankedMemRefType. More...
 
static Value rankedMemRefMaterialization (OpBuilder &builder, MemRefType resultType, ValueRange inputs, Location loc, const LLVMTypeConverter &converter)
 MemRef descriptor elements -> MemRefType. More...
 
static void filterByValRefArgAttrs (FunctionOpInterface funcOp, SmallVectorImpl< std::optional< NamedAttribute >> &result)
 Returns the llvm.byval or llvm.byref attributes that are present in the function arguments. More...
 

Function Documentation

◆ filterByValRefArgAttrs()

static void filterByValRefArgAttrs ( FunctionOpInterface  funcOp,
SmallVectorImpl< std::optional< NamedAttribute >> &  result 
)
static

Returns the llvm.byval or llvm.byref attributes that are present in the function arguments.

Returns an empty container if none of these attributes are found in any of the arguments.

Definition at line 336 of file TypeConverter.cpp.

Referenced by mlir::LLVMTypeConverter::convertFunctionSignature().

◆ isBarePointer()

static bool isBarePointer ( ValueRange  values)
static

Helper function that checks if the given value range is a bare pointer.

Definition at line 48 of file TypeConverter.cpp.

References mlir::ValueRange::getType().

Referenced by packRankedMemRefDesc().

◆ packRankedMemRefDesc()

static Value packRankedMemRefDesc ( OpBuilder builder,
MemRefType  resultType,
ValueRange  inputs,
Location  loc,
const LLVMTypeConverter converter 
)
static

◆ packUnrankedMemRefDesc()

static Value packUnrankedMemRefDesc ( OpBuilder builder,
UnrankedMemRefType  resultType,
ValueRange  inputs,
Location  loc,
const LLVMTypeConverter converter 
)
static

Pack SSA values into an unranked memref descriptor struct.

Definition at line 54 of file TypeConverter.cpp.

References mlir::LLVMTypeConverter::getUnrankedMemRefDescriptorFields(), and mlir::UnrankedMemRefDescriptor::pack().

Referenced by mlir::LLVMTypeConverter::LLVMTypeConverter(), and unrankedMemRefMaterialization().

◆ rankedMemRefMaterialization()

static Value rankedMemRefMaterialization ( OpBuilder builder,
MemRefType  resultType,
ValueRange  inputs,
Location  loc,
const LLVMTypeConverter converter 
)
static

MemRef descriptor elements -> MemRefType.

Definition at line 100 of file TypeConverter.cpp.

References mlir::OpBuilder::create(), and packRankedMemRefDesc().

Referenced by mlir::LLVMTypeConverter::LLVMTypeConverter().

◆ unrankedMemRefMaterialization()

static Value unrankedMemRefMaterialization ( OpBuilder builder,
UnrankedMemRefType  resultType,
ValueRange  inputs,
Location  loc,
const LLVMTypeConverter converter 
)
static

MemRef descriptor elements -> UnrankedMemRefType.

Definition at line 84 of file TypeConverter.cpp.

References mlir::OpBuilder::create(), and packUnrankedMemRefDesc().

Referenced by mlir::LLVMTypeConverter::LLVMTypeConverter().