MLIR
22.0.0git
|
#include "TypeDetail.h"
#include "mlir/Dialect/LLVMIR/LLVMAttrs.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/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) |
static bool | isCompatiblePtrType (Type type) |
Check whether type is a compatible ptr type. 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 563 of file LLVMTypes.cpp.
References getStructDataLayoutEntry(), mlir::DataLayout::getTypeABIAlignment(), kBitsInByte, and max().
|
static |
Definition at line 601 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 280 of file LLVMTypes.cpp.
References mlir::LLVM::extractPointerSpecValue(), mlir::LLVM::Index, kBitsInByte, kDefaultPointerAlignment, kDefaultPointerSizeBits, and mlir::LLVM::Size.
|
static |
Definition at line 545 of file LLVMTypes.cpp.
Referenced by calculateStructAlignment().
Definition at line 752 of file LLVMTypes.cpp.
References isCompatiblePtrType().
Referenced by mlir::LLVM::isCompatibleType().
|
static |
Check whether type is a compatible ptr type.
These are pointer-like types with no element type, no metadata, and using the LLVM LLVMAddrSpaceAttrInterface memory space.
Definition at line 708 of file LLVMTypes.cpp.
Referenced by isCompatibleImpl(), mlir::LLVM::isCompatibleOuterType(), and mlir::LLVM::isCompatibleVectorType().
|
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::remark::failed(), 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().
|
staticconstexpr |
Definition at line 669 of file LLVMTypes.cpp.
|
staticconstexpr |
Definition at line 30 of file LLVMTypes.cpp.
Referenced by calculateStructAlignment(), and getPointerDataLayoutEntry().
|
staticconstexpr |
Definition at line 264 of file LLVMTypes.cpp.
Referenced by getPointerDataLayoutEntry().
|
staticconstexpr |
Definition at line 263 of file LLVMTypes.cpp.
Referenced by getPointerDataLayoutEntry().
|
staticconstexpr |
Definition at line 668 of file LLVMTypes.cpp.