diff --git a/mlir/lib/Parser/Token.cpp b/mlir/lib/Parser/Token.cpp --- a/mlir/lib/Parser/Token.cpp +++ b/mlir/lib/Parser/Token.cpp @@ -60,9 +60,7 @@ assert(getKind() == inttype); unsigned bitwidthStart = (spelling[0] == 'i' ? 1 : 2); unsigned result = 0; - if (spelling[bitwidthStart] == '0' || - spelling.drop_front(bitwidthStart).getAsInteger(10, result) || - result == 0) + if (spelling.drop_front(bitwidthStart).getAsInteger(10, result)) return None; return result; } diff --git a/mlir/test/Dialect/Quant/parse-any-invalid.mlir b/mlir/test/Dialect/Quant/parse-any-invalid.mlir --- a/mlir/test/Dialect/Quant/parse-any-invalid.mlir +++ b/mlir/test/Dialect/Quant/parse-any-invalid.mlir @@ -36,9 +36,9 @@ !qalias = type !quant.any:f32> // ----- -// Unrecognized storage type: storage size == 0 +// Unrecognized storage type: storage size // expected-error@+1 {{invalid integer width}} -!qalias = type !quant.any:f32> +!qalias = type !quant.any:f32> // ----- // Illegal storage min/max: max - min < 0 diff --git a/mlir/test/Dialect/Quant/parse-uniform-invalid.mlir b/mlir/test/Dialect/Quant/parse-uniform-invalid.mlir --- a/mlir/test/Dialect/Quant/parse-uniform-invalid.mlir +++ b/mlir/test/Dialect/Quant/parse-uniform-invalid.mlir @@ -56,9 +56,9 @@ !qalias = type !quant.uniform:f32, 0.99872:127> // ----- -// Unrecognized storage type: storage size == 0 +// Unrecognized storage type: storage size // expected-error@+1 {{invalid integer width}} -!qalias = type !quant.uniform:f32, 0.99872:127> +!qalias = type !quant.uniform:f32, 0.99872:127> // ----- // Illegal storage min/max: max - min < 0 diff --git a/mlir/test/IR/invalid.mlir b/mlir/test/IR/invalid.mlir --- a/mlir/test/IR/invalid.mlir +++ b/mlir/test/IR/invalid.mlir @@ -201,7 +201,7 @@ // ----- -func @illegaltype(i0) // expected-error {{invalid integer width}} +func @illegaltype(i21312312323120) // expected-error {{invalid integer width}} // ----- diff --git a/mlir/test/IR/parser.mlir b/mlir/test/IR/parser.mlir --- a/mlir/test/IR/parser.mlir +++ b/mlir/test/IR/parser.mlir @@ -58,8 +58,8 @@ // CHECK: func private @missingReturn() func private @missingReturn() -// CHECK: func private @int_types(i1, i2, i4, i7, i87) -> (i1, index, i19) -func private @int_types(i1, i2, i4, i7, i87) -> (i1, index, i19) +// CHECK: func private @int_types(i0, i1, i2, i4, i7, i87) -> (i1, index, i19) +func private @int_types(i0, i1, i2, i4, i7, i87) -> (i1, index, i19) // CHECK: func private @sint_types(si2, si4) -> (si7, si1023) func private @sint_types(si2, si4) -> (si7, si1023)