MLIR
20.0.0git
|
Public Member Functions | |
NumberingDialectWriter (IRNumberingState &state, llvm::StringMap< std::unique_ptr< DialectVersion >> &dialectVersionMap) | |
void | writeAttribute (Attribute attr) override |
Write a reference to the given attribute. More... | |
void | writeOptionalAttribute (Attribute attr) override |
void | writeType (Type type) override |
Write a reference to the given type. More... | |
void | writeResourceHandle (const AsmDialectResourceHandle &resource) override |
Write the given handle to a dialect resource. More... | |
void | writeVarInt (uint64_t) override |
Stubbed out methods that are not used for numbering. More... | |
void | writeSignedVarInt (int64_t value) override |
Write a signed variable width integer to the output stream. More... | |
void | writeAPIntWithKnownWidth (const APInt &value) override |
Write an APInt to the bytecode stream whose bitwidth will be known externally at read time. More... | |
void | writeAPFloatWithKnownSemantics (const APFloat &value) override |
Write an APFloat to the bytecode stream whose semantics will be known externally at read time. More... | |
void | writeOwnedString (StringRef) override |
Write a string to the bytecode, which is owned by the caller and is guaranteed to not die before the end of the bytecode process. More... | |
void | writeOwnedBlob (ArrayRef< char > blob) override |
Write a blob to the bytecode, which is owned by the caller and is guaranteed to not die before the end of the bytecode process. More... | |
void | writeOwnedBool (bool value) override |
Write a bool to the output stream. More... | |
int64_t | getBytecodeVersion () const override |
Return the bytecode version being emitted for. More... | |
FailureOr< const DialectVersion * > | getDialectVersion (StringRef dialectName) const override |
Retrieve the dialect version by name if available. More... | |
Public Member Functions inherited from mlir::DialectBytecodeWriter | |
virtual | ~DialectBytecodeWriter ()=default |
template<typename RangeT , typename CallbackFn > | |
void | writeList (RangeT &&range, CallbackFn &&callback) |
Write out a list of elements, invoking the provided callback for each element. More... | |
template<typename T > | |
void | writeAttributes (ArrayRef< T > attrs) |
template<typename T > | |
void | writeTypes (ArrayRef< T > types) |
void | writeSignedVarInts (ArrayRef< int64_t > value) |
void | writeVarIntWithFlag (uint64_t value, bool flag) |
Write a VarInt and a flag packed together. More... | |
template<typename T > | |
void | writeSparseArray (ArrayRef< T > array) |
Write out a "small" sparse array of integer <= 32 bits elements, where index/value pairs can be compressed when the array is small. More... | |
template<class T > | |
FailureOr< const DialectVersion * > | getDialectVersion () const |
Public Attributes | |
IRNumberingState & | state |
The parent numbering state that is populated by this writer. More... | |
llvm::StringMap< std::unique_ptr< DialectVersion > > & | dialectVersionMap |
A map containing dialect version information for each dialect to emit. More... | |
Definition at line 25 of file IRNumbering.cpp.
|
inline |
Definition at line 26 of file IRNumbering.cpp.
|
inlineoverridevirtual |
Return the bytecode version being emitted for.
Implements mlir::DialectBytecodeWriter.
Definition at line 54 of file IRNumbering.cpp.
References mlir::bytecode::detail::IRNumberingState::getDesiredBytecodeVersion(), and mlir::bytecode::detail::IRNumberingState::NumberingDialectWriter::state.
|
inlineoverridevirtual |
Retrieve the dialect version by name if available.
Implements mlir::DialectBytecodeWriter.
Definition at line 59 of file IRNumbering.cpp.
References mlir::bytecode::detail::IRNumberingState::NumberingDialectWriter::dialectVersionMap.
|
inlineoverridevirtual |
Write an APFloat to the bytecode stream whose semantics will be known externally at read time.
This method is useful for encoding APFloat values when the semantics are known via external means, such as via a type.
Implements mlir::DialectBytecodeWriter.
Definition at line 45 of file IRNumbering.cpp.
|
inlineoverridevirtual |
Write an APInt to the bytecode stream whose bitwidth will be known externally at read time.
This method is useful for encoding APInt values when the width is known via external means, such as via a type. This method should generally only be invoked if you need an APInt, otherwise use the varint methods above. APInt values are generally encoded using zigzag encoding, to enable more efficient encodings for negative values.
Implements mlir::DialectBytecodeWriter.
Definition at line 44 of file IRNumbering.cpp.
|
inlineoverridevirtual |
Write a reference to the given attribute.
Implements mlir::DialectBytecodeWriter.
Definition at line 31 of file IRNumbering.cpp.
References mlir::bytecode::detail::IRNumberingState::NumberingDialectWriter::state.
|
inlineoverridevirtual |
Implements mlir::DialectBytecodeWriter.
Definition at line 32 of file IRNumbering.cpp.
References mlir::bytecode::detail::IRNumberingState::NumberingDialectWriter::state.
|
inlineoverridevirtual |
Write a blob to the bytecode, which is owned by the caller and is guaranteed to not die before the end of the bytecode process.
The blob is written as-is, with no additional compression or compaction.
Implements mlir::DialectBytecodeWriter.
Definition at line 51 of file IRNumbering.cpp.
|
inlineoverridevirtual |
Write a bool to the output stream.
Implements mlir::DialectBytecodeWriter.
Definition at line 52 of file IRNumbering.cpp.
|
inlineoverridevirtual |
Write a string to the bytecode, which is owned by the caller and is guaranteed to not die before the end of the bytecode process.
This should only be called if such a guarantee can be made, such as when the string is owned by an attribute or type.
Implements mlir::DialectBytecodeWriter.
Definition at line 46 of file IRNumbering.cpp.
|
inlineoverridevirtual |
Write the given handle to a dialect resource.
Implements mlir::DialectBytecodeWriter.
Definition at line 37 of file IRNumbering.cpp.
References mlir::AsmDialectResourceHandle::getDialect(), and mlir::bytecode::detail::IRNumberingState::NumberingDialectWriter::state.
|
inlineoverridevirtual |
Write a signed variable width integer to the output stream.
This should be the preferred method for emitting signed integers whenever possible.
Implements mlir::DialectBytecodeWriter.
Definition at line 43 of file IRNumbering.cpp.
|
inlineoverridevirtual |
Write a reference to the given type.
Implements mlir::DialectBytecodeWriter.
Definition at line 36 of file IRNumbering.cpp.
References mlir::bytecode::detail::IRNumberingState::NumberingDialectWriter::state.
|
inlineoverridevirtual |
Stubbed out methods that are not used for numbering.
Implements mlir::DialectBytecodeWriter.
Definition at line 42 of file IRNumbering.cpp.
llvm::StringMap<std::unique_ptr<DialectVersion> >& mlir::bytecode::detail::IRNumberingState::NumberingDialectWriter::dialectVersionMap |
A map containing dialect version information for each dialect to emit.
Definition at line 70 of file IRNumbering.cpp.
Referenced by mlir::bytecode::detail::IRNumberingState::NumberingDialectWriter::getDialectVersion().
IRNumberingState& mlir::bytecode::detail::IRNumberingState::NumberingDialectWriter::state |
The parent numbering state that is populated by this writer.
Definition at line 67 of file IRNumbering.cpp.
Referenced by mlir::bytecode::detail::IRNumberingState::NumberingDialectWriter::getBytecodeVersion(), mlir::bytecode::detail::IRNumberingState::NumberingDialectWriter::writeAttribute(), mlir::bytecode::detail::IRNumberingState::NumberingDialectWriter::writeOptionalAttribute(), mlir::bytecode::detail::IRNumberingState::NumberingDialectWriter::writeResourceHandle(), and mlir::bytecode::detail::IRNumberingState::NumberingDialectWriter::writeType().