mirror of
https://github.com/intel/llvm.git
synced 2026-01-13 19:08:21 +08:00
Fix MLIR bytecode reading of i0 IntegerAttr
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
This commit is contained in:
@@ -43,8 +43,6 @@ static unsigned getIntegerBitWidth(DialectBytecodeReader &reader, Type type) {
|
||||
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;
|
||||
}
|
||||
|
||||
5
mlir/test/Bytecode/empty_attr.mlir
Normal file
5
mlir/test/Bytecode/empty_attr.mlir
Normal file
@@ -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 } { }
|
||||
Reference in New Issue
Block a user