The move of the bytecode serialization to be tablegen driven in
https://reviews.llvm.org/D144820 added a new condition in the reading
path that forbid 0-sized integer, even though we still produce them.
Fix #62920
Differential Revision: https://reviews.llvm.org/D151372
static LogicalResult readAPIntWithKnownWidth(DialectBytecodeReader &reader,
Type type, FailureOr<APInt> &val) {
unsigned bitWidth = getIntegerBitWidth(reader, type);
- if (bitWidth == 0)
- return failure();
val = reader.readAPIntWithKnownWidth(bitWidth);
return val;
}
--- /dev/null
+// RUN: mlir-opt -emit-bytecode %s | mlir-opt | FileCheck %s
+
+// CHECK: module
+// CHECK: foo.asdf = 0 : i0
+module attributes { foo.asdf = 0 : i0 } { }