Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
mlir/include/mlir/Conversion/LLVMCommon/TypeConverter.h
Show All 18 Lines | |||||
namespace mlir { | namespace mlir { | ||||
class DataLayoutAnalysis; | class DataLayoutAnalysis; | ||||
class LowerToLLVMOptions; | class LowerToLLVMOptions; | ||||
namespace LLVM { | namespace LLVM { | ||||
class LLVMDialect; | class LLVMDialect; | ||||
class LLVMPointerType; | |||||
} // namespace LLVM | } // namespace LLVM | ||||
/// Conversion from types to the LLVM IR dialect. | /// Conversion from types to the LLVM IR dialect. | ||||
class LLVMTypeConverter : public TypeConverter { | class LLVMTypeConverter : public TypeConverter { | ||||
/// Give structFuncArgTypeConverter access to memref-specific functions. | /// Give structFuncArgTypeConverter access to memref-specific functions. | ||||
friend LogicalResult | friend LogicalResult | ||||
structFuncArgTypeConverter(LLVMTypeConverter &converter, Type type, | structFuncArgTypeConverter(LLVMTypeConverter &converter, Type type, | ||||
SmallVectorImpl<Type> &result); | SmallVectorImpl<Type> &result); | ||||
▲ Show 20 Lines • Show All 79 Lines • ▼ Show 20 Lines | public: | ||||
const DataLayoutAnalysis *getDataLayoutAnalysis() const { | const DataLayoutAnalysis *getDataLayoutAnalysis() const { | ||||
return dataLayoutAnalysis; | return dataLayoutAnalysis; | ||||
} | } | ||||
/// Gets the LLVM representation of the index type. The returned type is an | /// Gets the LLVM representation of the index type. The returned type is an | ||||
/// integer type with the size configured for this type converter. | /// integer type with the size configured for this type converter. | ||||
Type getIndexType(); | Type getIndexType(); | ||||
/// Returns true if using opaque pointers was enabled in the lowering options. | |||||
bool useOpaquePointers() const { return getOptions().useOpaquePointers; } | |||||
/// Creates an LLVM pointer type with the given element type and address | |||||
/// space. | |||||
/// This function is meant to be used in code supporting both typed and opaque | |||||
/// pointers, as it will create an opaque pointer with the given address space | |||||
/// if opaque pointers are enabled in the lowering options. | |||||
LLVM::LLVMPointerType getPointerType(Type elementType, | |||||
gysit: ultra nit: getPointer -> getPointerType? | |||||
unsigned addressSpace = 0); | |||||
/// Gets the bitwidth of the index type when converted to LLVM. | /// Gets the bitwidth of the index type when converted to LLVM. | ||||
unsigned getIndexTypeBitwidth() { return options.getIndexBitwidth(); } | unsigned getIndexTypeBitwidth() { return options.getIndexBitwidth(); } | ||||
/// Gets the pointer bitwidth. | /// Gets the pointer bitwidth. | ||||
unsigned getPointerBitwidth(unsigned addressSpace = 0); | unsigned getPointerBitwidth(unsigned addressSpace = 0); | ||||
/// Returns the size of the memref descriptor object in bytes. | /// Returns the size of the memref descriptor object in bytes. | ||||
unsigned getMemRefDescriptorSize(MemRefType type, const DataLayout &layout); | unsigned getMemRefDescriptorSize(MemRefType type, const DataLayout &layout); | ||||
▲ Show 20 Lines • Show All 108 Lines • Show Last 20 Lines |
ultra nit: getPointer -> getPointerType?