diff --git a/mlir/lib/IR/BuiltinDialectBytecode.cpp b/mlir/lib/IR/BuiltinDialectBytecode.cpp --- a/mlir/lib/IR/BuiltinDialectBytecode.cpp +++ b/mlir/lib/IR/BuiltinDialectBytecode.cpp @@ -43,8 +43,6 @@ static LogicalResult readAPIntWithKnownWidth(DialectBytecodeReader &reader, Type type, FailureOr &val) { unsigned bitWidth = getIntegerBitWidth(reader, type); - if (bitWidth == 0) - return failure(); val = reader.readAPIntWithKnownWidth(bitWidth); return val; } diff --git a/mlir/test/Bytecode/empty_attr.mlir b/mlir/test/Bytecode/empty_attr.mlir new file mode 100644 --- /dev/null +++ b/mlir/test/Bytecode/empty_attr.mlir @@ -0,0 +1,5 @@ +// RUN: mlir-opt -emit-bytecode %s | mlir-opt | FileCheck %s + +// CHECK: module +// CHECK: foo.asdf = 0 : i0 +module attributes { foo.asdf = 0 : i0 } { }