#include "TypeDetail.h"
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
#include "mlir/Dialect/LLVMIR/LLVMTypes.h"
#include "mlir/IR/BuiltinTypes.h"
#include "mlir/IR/DialectImplementation.h"
#include "mlir/IR/TypeSupport.h"
#include "llvm/ADT/ScopeExit.h"
#include "llvm/ADT/TypeSwitch.h"
#include "llvm/Support/TypeSize.h"
#include <optional>
usingnamespacemlir;
usingnamespacemlir::LLVM;
constexpr const static uint64_t kBitsInByte = …;
static ParseResult parseFunctionTypes(AsmParser &p, SmallVector<Type> ¶ms,
bool &isVarArg) { … }
static void printFunctionTypes(AsmPrinter &p, ArrayRef<Type> params,
bool isVarArg) { … }
static ParseResult
parseExtTypeParams(AsmParser &p, SmallVectorImpl<Type> &typeParams,
SmallVectorImpl<unsigned int> &intParams) { … }
static void printExtTypeParams(AsmPrinter &p, ArrayRef<Type> typeParams,
ArrayRef<unsigned int> intParams) { … }
LLVM_ATTRIBUTE_UNUSED static OptionalParseResult
generatedTypeParser(AsmParser &parser, StringRef *mnemonic, Type &value);
LLVM_ATTRIBUTE_UNUSED static LogicalResult
generatedTypePrinter(Type def, AsmPrinter &printer);
#include "mlir/Dialect/LLVMIR/LLVMTypeInterfaces.cpp.inc"
#define GET_TYPEDEF_CLASSES
#include "mlir/Dialect/LLVMIR/LLVMTypes.cpp.inc"
bool LLVMArrayType::isValidElementType(Type type) { … }
LLVMArrayType LLVMArrayType::get(Type elementType, uint64_t numElements) { … }
LLVMArrayType
LLVMArrayType::getChecked(function_ref<InFlightDiagnostic()> emitError,
Type elementType, uint64_t numElements) { … }
LogicalResult
LLVMArrayType::verify(function_ref<InFlightDiagnostic()> emitError,
Type elementType, uint64_t numElements) { … }
llvm::TypeSize
LLVMArrayType::getTypeSizeInBits(const DataLayout &dataLayout,
DataLayoutEntryListRef params) const { … }
llvm::TypeSize LLVMArrayType::getTypeSize(const DataLayout &dataLayout,
DataLayoutEntryListRef params) const { … }
uint64_t LLVMArrayType::getABIAlignment(const DataLayout &dataLayout,
DataLayoutEntryListRef params) const { … }
uint64_t
LLVMArrayType::getPreferredAlignment(const DataLayout &dataLayout,
DataLayoutEntryListRef params) const { … }
bool LLVMFunctionType::isValidArgumentType(Type type) { … }
bool LLVMFunctionType::isValidResultType(Type type) { … }
LLVMFunctionType LLVMFunctionType::get(Type result, ArrayRef<Type> arguments,
bool isVarArg) { … }
LLVMFunctionType
LLVMFunctionType::getChecked(function_ref<InFlightDiagnostic()> emitError,
Type result, ArrayRef<Type> arguments,
bool isVarArg) { … }
LLVMFunctionType LLVMFunctionType::clone(TypeRange inputs,
TypeRange results) const { … }
ArrayRef<Type> LLVMFunctionType::getReturnTypes() const { … }
LogicalResult
LLVMFunctionType::verify(function_ref<InFlightDiagnostic()> emitError,
Type result, ArrayRef<Type> arguments, bool) { … }
constexpr const static uint64_t kDefaultPointerSizeBits = …;
constexpr const static uint64_t kDefaultPointerAlignment = …;
std::optional<uint64_t> mlir::LLVM::extractPointerSpecValue(Attribute attr,
PtrDLEntryPos pos) { … }
static std::optional<uint64_t>
getPointerDataLayoutEntry(DataLayoutEntryListRef params, LLVMPointerType type,
PtrDLEntryPos pos) { … }
llvm::TypeSize
LLVMPointerType::getTypeSizeInBits(const DataLayout &dataLayout,
DataLayoutEntryListRef params) const { … }
uint64_t LLVMPointerType::getABIAlignment(const DataLayout &dataLayout,
DataLayoutEntryListRef params) const { … }
uint64_t
LLVMPointerType::getPreferredAlignment(const DataLayout &dataLayout,
DataLayoutEntryListRef params) const { … }
std::optional<uint64_t>
LLVMPointerType::getIndexBitwidth(const DataLayout &dataLayout,
DataLayoutEntryListRef params) const { … }
bool LLVMPointerType::areCompatible(DataLayoutEntryListRef oldLayout,
DataLayoutEntryListRef newLayout) const { … }
LogicalResult LLVMPointerType::verifyEntries(DataLayoutEntryListRef entries,
Location loc) const { … }
bool LLVMStructType::isValidElementType(Type type) { … }
LLVMStructType LLVMStructType::getIdentified(MLIRContext *context,
StringRef name) { … }
LLVMStructType LLVMStructType::getIdentifiedChecked(
function_ref<InFlightDiagnostic()> emitError, MLIRContext *context,
StringRef name) { … }
LLVMStructType LLVMStructType::getNewIdentified(MLIRContext *context,
StringRef name,
ArrayRef<Type> elements,
bool isPacked) { … }
LLVMStructType LLVMStructType::getLiteral(MLIRContext *context,
ArrayRef<Type> types, bool isPacked) { … }
LLVMStructType
LLVMStructType::getLiteralChecked(function_ref<InFlightDiagnostic()> emitError,
MLIRContext *context, ArrayRef<Type> types,
bool isPacked) { … }
LLVMStructType LLVMStructType::getOpaque(StringRef name, MLIRContext *context) { … }
LLVMStructType
LLVMStructType::getOpaqueChecked(function_ref<InFlightDiagnostic()> emitError,
MLIRContext *context, StringRef name) { … }
LogicalResult LLVMStructType::setBody(ArrayRef<Type> types, bool isPacked) { … }
bool LLVMStructType::isPacked() const { … }
bool LLVMStructType::isIdentified() const { … }
bool LLVMStructType::isOpaque() { … }
bool LLVMStructType::isInitialized() { … }
StringRef LLVMStructType::getName() { … }
ArrayRef<Type> LLVMStructType::getBody() const { … }
LogicalResult
LLVMStructType::verifyInvariants(function_ref<InFlightDiagnostic()>, StringRef,
bool) { … }
LogicalResult
LLVMStructType::verifyInvariants(function_ref<InFlightDiagnostic()> emitError,
ArrayRef<Type> types, bool) { … }
llvm::TypeSize
LLVMStructType::getTypeSizeInBits(const DataLayout &dataLayout,
DataLayoutEntryListRef params) const { … }
namespace {
enum class StructDLEntryPos { … };
}
static std::optional<uint64_t>
getStructDataLayoutEntry(DataLayoutEntryListRef params, LLVMStructType type,
StructDLEntryPos pos) { … }
static uint64_t calculateStructAlignment(const DataLayout &dataLayout,
DataLayoutEntryListRef params,
LLVMStructType type,
StructDLEntryPos pos) { … }
uint64_t LLVMStructType::getABIAlignment(const DataLayout &dataLayout,
DataLayoutEntryListRef params) const { … }
uint64_t
LLVMStructType::getPreferredAlignment(const DataLayout &dataLayout,
DataLayoutEntryListRef params) const { … }
static uint64_t extractStructSpecValue(Attribute attr, StructDLEntryPos pos) { … }
bool LLVMStructType::areCompatible(DataLayoutEntryListRef oldLayout,
DataLayoutEntryListRef newLayout) const { … }
LogicalResult LLVMStructType::verifyEntries(DataLayoutEntryListRef entries,
Location loc) const { … }
template <typename VecTy>
static LogicalResult
verifyVectorConstructionInvariants(function_ref<InFlightDiagnostic()> emitError,
Type elementType, unsigned numElements) { … }
LLVMFixedVectorType LLVMFixedVectorType::get(Type elementType,
unsigned numElements) { … }
LLVMFixedVectorType
LLVMFixedVectorType::getChecked(function_ref<InFlightDiagnostic()> emitError,
Type elementType, unsigned numElements) { … }
bool LLVMFixedVectorType::isValidElementType(Type type) { … }
LogicalResult
LLVMFixedVectorType::verify(function_ref<InFlightDiagnostic()> emitError,
Type elementType, unsigned numElements) { … }
LLVMScalableVectorType LLVMScalableVectorType::get(Type elementType,
unsigned minNumElements) { … }
LLVMScalableVectorType
LLVMScalableVectorType::getChecked(function_ref<InFlightDiagnostic()> emitError,
Type elementType, unsigned minNumElements) { … }
bool LLVMScalableVectorType::isValidElementType(Type type) { … }
LogicalResult
LLVMScalableVectorType::verify(function_ref<InFlightDiagnostic()> emitError,
Type elementType, unsigned numElements) { … }
static constexpr llvm::StringRef kSpirvPrefix = …;
static constexpr llvm::StringRef kArmSVCount = …;
bool LLVM::LLVMTargetExtType::hasProperty(Property prop) const { … }
bool LLVM::LLVMTargetExtType::supportsMemOps() const { … }
bool mlir::LLVM::isCompatibleOuterType(Type type) { … }
static bool isCompatibleImpl(Type type, DenseSet<Type> &compatibleTypes) { … }
bool LLVMDialect::isCompatibleType(Type type) { … }
bool mlir::LLVM::isCompatibleType(Type type) { … }
bool mlir::LLVM::isCompatibleFloatingPointType(Type type) { … }
bool mlir::LLVM::isCompatibleVectorType(Type type) { … }
Type mlir::LLVM::getVectorElementType(Type type) { … }
llvm::ElementCount mlir::LLVM::getVectorNumElements(Type type) { … }
bool mlir::LLVM::isScalableVectorType(Type vectorType) { … }
Type mlir::LLVM::getVectorType(Type elementType, unsigned numElements,
bool isScalable) { … }
Type mlir::LLVM::getVectorType(Type elementType,
const llvm::ElementCount &numElements) { … }
Type mlir::LLVM::getFixedVectorType(Type elementType, unsigned numElements) { … }
Type mlir::LLVM::getScalableVectorType(Type elementType, unsigned numElements) { … }
llvm::TypeSize mlir::LLVM::getPrimitiveTypeSizeInBits(Type type) { … }
void LLVMDialect::registerTypes() { … }
Type LLVMDialect::parseType(DialectAsmParser &parser) const { … }
void LLVMDialect::printType(Type type, DialectAsmPrinter &os) const { … }