[mlir] Add bytecode encodings for the builtin ElementsAttr attributes
This adds bytecode support for DenseArrayAttr, DenseIntOrFpElementsAttr, DenseStringElementsAttr, and SparseElementsAttr. Differential Revision: https://reviews.llvm.org/D133744
This commit is contained in:
@@ -887,6 +887,17 @@ public:
|
||||
return stringReader.parseString(reader, result);
|
||||
}
|
||||
|
||||
LogicalResult readBlob(ArrayRef<char> &result) override {
|
||||
uint64_t dataSize;
|
||||
ArrayRef<uint8_t> data;
|
||||
if (failed(reader.parseVarInt(dataSize)) ||
|
||||
failed(reader.parseBytes(dataSize, data)))
|
||||
return failure();
|
||||
result = llvm::makeArrayRef(reinterpret_cast<const char *>(data.data()),
|
||||
data.size());
|
||||
return success();
|
||||
}
|
||||
|
||||
private:
|
||||
AttrTypeReader &attrTypeReader;
|
||||
StringSectionReader &stringReader;
|
||||
|
||||
Reference in New Issue
Block a user