MLIR
20.0.0git
|
#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>
#include "mlir/Dialect/LLVMIR/LLVMTypeInterfaces.cpp.inc"
#include "mlir/Dialect/LLVMIR/LLVMTypes.cpp.inc"
Go to the source code of this file.
Macros | |
#define | GET_TYPEDEF_CLASSES |
#define | GET_TYPEDEF_LIST |
Functions | |
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) |
Parses the parameter list for a target extension type. More... | |
static void | printExtTypeParams (AsmPrinter &p, ArrayRef< Type > typeParams, ArrayRef< unsigned int > intParams) |
static LLVM_ATTRIBUTE_UNUSED OptionalParseResult | generatedTypeParser (AsmParser &parser, StringRef *mnemonic, Type &value) |
These are unused for now. More... | |
static LLVM_ATTRIBUTE_UNUSED LogicalResult | generatedTypePrinter (Type def, AsmPrinter &printer) |
static std::optional< uint64_t > | getPointerDataLayoutEntry (DataLayoutEntryListRef params, LLVMPointerType type, PtrDLEntryPos pos) |
Returns the part of the data layout entry that corresponds to pos for the given type by interpreting the list of entries params . More... | |
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) |
static uint64_t | extractStructSpecValue (Attribute attr, StructDLEntryPos pos) |
template<typename VecTy > | |
static LogicalResult | verifyVectorConstructionInvariants (function_ref< InFlightDiagnostic()> emitError, Type elementType, unsigned numElements) |
Verifies that the type about to be constructed is well-formed. More... | |
static bool | isCompatibleImpl (Type type, DenseSet< Type > &compatibleTypes) |
Variables | |
constexpr static const uint64_t | kBitsInByte = 8 |
constexpr static const uint64_t | kDefaultPointerSizeBits = 64 |
constexpr static const uint64_t | kDefaultPointerAlignment = 8 |
static constexpr llvm::StringRef | kSpirvPrefix = "spirv." |
static constexpr llvm::StringRef | kArmSVCount = "aarch64.svcount" |
#define GET_TYPEDEF_CLASSES |
Definition at line 144 of file LLVMTypes.cpp.
#define GET_TYPEDEF_LIST |
|
static |
Definition at line 557 of file LLVMTypes.cpp.
References getStructDataLayoutEntry(), mlir::DataLayout::getTypeABIAlignment(), kBitsInByte, and max().
|
static |
Definition at line 595 of file LLVMTypes.cpp.
|
static |
These are unused for now.
TODO: Move over to these once more types have been migrated to TypeDef.
Referenced by parsePDLType().
|
static |
|
static |
Returns the part of the data layout entry that corresponds to pos
for the given type
by interpreting the list of entries params
.
For the pointer type in the default address space, returns the default value if the entries do not provide a custom one, for other address spaces returns std::nullopt.
Definition at line 276 of file LLVMTypes.cpp.
References mlir::LLVM::extractPointerSpecValue(), mlir::LLVM::Index, kBitsInByte, kDefaultPointerAlignment, kDefaultPointerSizeBits, and mlir::LLVM::Size.
|
static |
Definition at line 539 of file LLVMTypes.cpp.
Referenced by calculateStructAlignment().
Definition at line 803 of file LLVMTypes.cpp.
Referenced by mlir::LLVM::isCompatibleType().
|
static |
Parses the parameter list for a target extension type.
The parameter list contains an optional list of type parameters, followed by an optional list of integer parameters. Type and integer parameters cannot be interleaved in the list. extTypeParams ::= typeList? | intList? | (typeList "," intList) typeList ::= type ("," type)* intList ::= integer ("," integer)*
Definition at line 90 of file LLVMTypes.cpp.
References mlir::AsmParser::emitError(), mlir::AsmParser::getCurrentLocation(), mlir::AsmParser::parseCommaSeparatedList(), mlir::AsmParser::parseOptionalInteger(), mlir::LLVM::parsePrettyLLVMType(), and mlir::parseType().
|
static |
Definition at line 36 of file LLVMTypes.cpp.
References mlir::AsmParser::parseOptionalComma(), mlir::AsmParser::parseOptionalEllipsis(), mlir::AsmParser::parseOptionalRParen(), mlir::LLVM::parsePrettyLLVMType(), and mlir::AsmParser::parseRParen().
|
static |
Definition at line 122 of file LLVMTypes.cpp.
|
static |
Definition at line 66 of file LLVMTypes.cpp.
References mlir::LLVM::printPrettyLLVMType().
|
static |
Verifies that the type about to be constructed is well-formed.
Definition at line 663 of file LLVMTypes.cpp.
References mlir::emitError().
|
staticconstexpr |
Definition at line 737 of file LLVMTypes.cpp.
|
staticconstexpr |
Definition at line 30 of file LLVMTypes.cpp.
Referenced by calculateStructAlignment(), and getPointerDataLayoutEntry().
|
staticconstexpr |
Definition at line 260 of file LLVMTypes.cpp.
Referenced by getPointerDataLayoutEntry().
|
staticconstexpr |
Definition at line 259 of file LLVMTypes.cpp.
Referenced by getPointerDataLayoutEntry().
|
staticconstexpr |
Definition at line 736 of file LLVMTypes.cpp.