14 #ifndef MLIR_BYTECODE_ENCODING_H
15 #define MLIR_BYTECODE_ENCODING_H
19 #include <type_traits>
108 namespace OpEncodingMask {
126 template <
typename OperandT>
127 static inline uint64_t
getUseID(OperandT &val,
unsigned ownerID) {
128 uint32_t operandNumberID;
129 if constexpr (std::is_same_v<OpOperand, OperandT>)
130 operandNumberID = val.getOperandNumber();
131 else if constexpr (std::is_same_v<BlockArgument, OperandT>)
132 operandNumberID = val.getArgNumber();
134 llvm_unreachable(
"unexpected operand type");
135 return (
static_cast<uint64_t
>(ownerID) << 32) | operandNumberID;
@ kAttrType
This section contains the attributes and types referenced within an IR module.
@ kAttrTypeOffset
This section contains the offsets for the attribute and types within the AttrType section.
@ kIR
This section contains the list of operations serialized into the bytecode, and their nested regions/o...
@ kResource
This section contains the resources of the bytecode.
@ kResourceOffset
This section contains the offsets of resources within the Resource section.
@ kDialect
This section contains the dialects referenced within an IR module.
@ kString
This section contains strings referenced within the bytecode.
@ kDialectVersions
This section contains the versions of each dialect.
@ kProperties
This section contains the properties for the operations.
@ kNumSections
The total number of section types.
static uint64_t getUseID(OperandT &val, unsigned ownerID)
Get the unique ID of a value use.
@ kUseListOrdering
Use-list ordering started to be encoded in version 3.
@ kAlignmentByte
An arbitrary value used to fill alignment padding.
@ kVersion
The current bytecode version.
@ kLazyLoading
Support for lazy-loading of isolated region was added in version 2.
@ kDialectVersioning
Dialects versioning was added in version 1.
@ kElideUnknownBlockArgLocation
Avoid recording unknown locations on block arguments (compression) started in version 4.
@ kNativePropertiesEncoding
Support for encoding properties natively in bytecode instead of merged with the discardable attribute...
@ kMinSupportedVersion
The minimum supported version of the bytecode.
@ kNativePropertiesODSSegmentSize
ODS emits operand/result segment_size as native properties instead of an attribute.
Include the generated interface declarations.