15 #include "llvm/ADT/APFloat.h"
16 #include "llvm/ADT/SmallVector.h"
17 #include "llvm/ADT/TypeSwitch.h"
30 val = valOr->convertToDouble();
34 #include "mlir/Dialect/Quant/IR/QuantDialectBytecode.cpp.inc"
38 QuantDialectBytecodeInterface(
Dialect *dialect)
48 LogicalResult writeAttribute(
Attribute attr,
50 return ::writeAttribute(attr, writer);
60 LogicalResult writeType(
Type type,
62 return ::writeType(type, writer);
68 dialect->addInterfaces<QuantDialectBytecodeInterface>();
static MLIRContext * getContext(OpFoldResult val)
Attributes are known-constant values of operations.
This class defines a virtual interface for reading a bytecode stream, providing hooks into the byteco...
virtual FailureOr< APFloat > readAPFloatWithKnownSemantics(const llvm::fltSemantics &semantics)=0
Read an APFloat that is known to have been encoded with the given semantics.
This class defines a virtual interface for writing to a bytecode stream, providing hooks into the byt...
Dialects are groups of MLIR operations, types and attributes, as well as behavior associated with the...
Instances of the Type class are uniqued, have an immutable identifier and an optional mutable compone...
void addBytecodeInterface(QuantDialect *dialect)
Add the interfaces necessary for encoding the quantization dialect components in bytecode.
Include the generated interface declarations.