From c71d75d9baca1337ad6104d269df9595da44482f Mon Sep 17 00:00:00 2001 From: Mehdi Amini Date: Mon, 16 Oct 2023 21:38:50 -0700 Subject: [PATCH] [MLIR][Doc] Prepend "Variadic of" in front of variadic operands Table of Operands for operations like: https://mlir.llvm.org/docs/Dialects/MemRef/#operands-6 Don't distinguish variadic ODS operands from others right now. After this change, it'll print: | Operand | Description | | dynamicSizes | Variadic of index | instead of: | Operand | Description | | dynamicSizes | index | --- flang/test/Fir/invalid.fir | 2 +- flang/test/HLFIR/invalid.fir | 4 ++-- mlir/include/mlir/IR/CommonTypeConstraints.td | 3 ++- mlir/test/Dialect/Affine/invalid.mlir | 2 +- mlir/test/Dialect/LLVMIR/invalid.mlir | 2 +- mlir/test/Dialect/Linalg/invalid.mlir | 2 +- mlir/test/IR/operand.mlir | 4 ++-- mlir/test/IR/result.mlir | 4 ++-- 8 files changed, 12 insertions(+), 11 deletions(-) diff --git a/flang/test/Fir/invalid.fir b/flang/test/Fir/invalid.fir index c3bfb6922deda..824aeec28b417 100644 --- a/flang/test/Fir/invalid.fir +++ b/flang/test/Fir/invalid.fir @@ -690,7 +690,7 @@ func.func @bad_array_modify(%arr1 : !fir.ref>, %m : index, % func.func @slice_must_be_integral() { %0 = arith.constant 42 : i32 %1 = fir.field_index field, !fir.type (%0 : i32) - // expected-error@+1 {{'fir.slice' op operand #0 must be any integer, but got '!fir.field'}} + // expected-error@+1 {{'fir.slice' op operand #0 must be variadic of any integer, but got '!fir.field'}} %2 = fir.slice %1, %1, %1 : (!fir.field, !fir.field, !fir.field) -> !fir.slice<1> return } diff --git a/flang/test/HLFIR/invalid.fir b/flang/test/HLFIR/invalid.fir index 49b6c1852b598..09165f09766b9 100644 --- a/flang/test/HLFIR/invalid.fir +++ b/flang/test/HLFIR/invalid.fir @@ -267,7 +267,7 @@ func.func @bad_concat(%arg0: !fir.ref>, %arg1: !fir.ref>>, %arg1: !fir.ref>>) { %c30 = arith.constant 30 : index - // expected-error@+1 {{'hlfir.concat' op operand #0 must be any character scalar type, but got '!fir.ref>>'}} + // expected-error@+1 {{'hlfir.concat' op operand #0 must be variadic of any character scalar type, but got '!fir.ref>>'}} %0 = hlfir.concat %arg0, %arg1 len %c30 : (!fir.ref>>, !fir.ref>>, index) -> (!hlfir.expr<100x!fir.char<1,30>>) return } @@ -275,7 +275,7 @@ func.func @bad_concat_2(%arg0: !fir.ref>>, %arg1: // ----- func.func @bad_concat_3(%arg0: !fir.ref>, %arg1: !fir.ref) { %c30 = arith.constant 30 : index - // expected-error@+1 {{'hlfir.concat' op operand #1 must be any character scalar type, but got '!fir.ref'}} + // expected-error@+1 {{'hlfir.concat' op operand #1 must be variadic of any character scalar type, but got '!fir.ref'}} %0 = hlfir.concat %arg0, %arg1 len %c30 : (!fir.ref>, !fir.ref, index) -> (!hlfir.expr>) return } diff --git a/mlir/include/mlir/IR/CommonTypeConstraints.td b/mlir/include/mlir/IR/CommonTypeConstraints.td index 59249349921a3..b0b5348baaad9 100644 --- a/mlir/include/mlir/IR/CommonTypeConstraints.td +++ b/mlir/include/mlir/IR/CommonTypeConstraints.td @@ -117,7 +117,8 @@ class DialectType : TypeConstraint : TypeConstraint { Type baseType = type; int minSize = 0; diff --git a/mlir/test/Dialect/Affine/invalid.mlir b/mlir/test/Dialect/Affine/invalid.mlir index 1bcb6fc4a365d..72864516b459a 100644 --- a/mlir/test/Dialect/Affine/invalid.mlir +++ b/mlir/test/Dialect/Affine/invalid.mlir @@ -5,7 +5,7 @@ func.func @affine_apply_operand_non_index(%arg0 : i32) { // Custom parser automatically assigns all arguments the `index` so we must // use the generic syntax here to exercise the verifier. - // expected-error@+1 {{op operand #0 must be index, but got 'i32'}} + // expected-error@+1 {{op operand #0 must be variadic of index, but got 'i32'}} %0 = "affine.apply"(%arg0) {map = affine_map<(d0) -> (d0)>} : (i32) -> (index) return } diff --git a/mlir/test/Dialect/LLVMIR/invalid.mlir b/mlir/test/Dialect/LLVMIR/invalid.mlir index 6f119a140ba3c..2d0a68b8b6c94 100644 --- a/mlir/test/Dialect/LLVMIR/invalid.mlir +++ b/mlir/test/Dialect/LLVMIR/invalid.mlir @@ -306,7 +306,7 @@ func.func @call_non_llvm() { // ----- func.func @call_non_llvm_arg(%arg0 : tensor<*xi32>) { - // expected-error@+1 {{'llvm.call' op operand #0 must be LLVM dialect-compatible type}} + // expected-error@+1 {{'llvm.call' op operand #0 must be variadic of LLVM dialect-compatible type}} "llvm.call"(%arg0) : (tensor<*xi32>) -> () llvm.return } diff --git a/mlir/test/Dialect/Linalg/invalid.mlir b/mlir/test/Dialect/Linalg/invalid.mlir index 09acce04cd6a1..56890df3f3ee5 100644 --- a/mlir/test/Dialect/Linalg/invalid.mlir +++ b/mlir/test/Dialect/Linalg/invalid.mlir @@ -345,7 +345,7 @@ func.func @illegal_fill_memref_with_tensor_return func.func @illegal_fill_tensor_with_memref_return (%arg0 : tensor, %arg1 : f32) -> memref { - // expected-error @+1 {{result #0 must be ranked tensor of any type values, but got 'memref'}} + // expected-error @+1 {{result #0 must be variadic of ranked tensor of any type values, but got 'memref'}} %0 = linalg.fill ins(%arg1 : f32) outs(%arg0 : tensor) -> memref return %0 : memref } diff --git a/mlir/test/IR/operand.mlir b/mlir/test/IR/operand.mlir index e44133f6baeef..507e37c775c0b 100644 --- a/mlir/test/IR/operand.mlir +++ b/mlir/test/IR/operand.mlir @@ -13,7 +13,7 @@ func.func @correct_variadic_operand(%arg0: tensor, %arg1: f32) { // ----- func.func @error_in_first_variadic_operand(%arg0: tensor, %arg1: f32) { - // expected-error @+1 {{operand #1 must be tensor of any type}} + // expected-error @+1 {{operand #1 must be variadic of tensor of any type}} "test.mixed_normal_variadic_operand"(%arg0, %arg1, %arg0, %arg0, %arg0) : (tensor, f32, tensor, tensor, tensor) -> () return } @@ -29,7 +29,7 @@ func.func @error_in_normal_operand(%arg0: tensor, %arg1: f32) { // ----- func.func @error_in_second_variadic_operand(%arg0: tensor, %arg1: f32) { - // expected-error @+1 {{operand #3 must be tensor of any type}} + // expected-error @+1 {{operand #3 must be variadic of tensor of any type}} "test.mixed_normal_variadic_operand"(%arg0, %arg0, %arg0, %arg1, %arg0) : (tensor, tensor, tensor, f32, tensor) -> () return } diff --git a/mlir/test/IR/result.mlir b/mlir/test/IR/result.mlir index e7d41a50a38f6..1e4eb3bede4c5 100644 --- a/mlir/test/IR/result.mlir +++ b/mlir/test/IR/result.mlir @@ -13,7 +13,7 @@ func.func @correct_variadic_result() -> tensor { // ----- func.func @error_in_first_variadic_result() -> tensor { - // expected-error @+1 {{result #1 must be tensor of any type}} + // expected-error @+1 {{result #1 must be variadic of tensor of any type}} %0:5 = "test.mixed_normal_variadic_result"() : () -> (tensor, f32, tensor, tensor, tensor) return %0#4 : tensor } @@ -29,7 +29,7 @@ func.func @error_in_normal_result() -> tensor { // ----- func.func @error_in_second_variadic_result() -> tensor { - // expected-error @+1 {{result #3 must be tensor of any type}} + // expected-error @+1 {{result #3 must be variadic of tensor of any type}} %0:5 = "test.mixed_normal_variadic_result"() : () -> (tensor, tensor, tensor, f32, tensor) return %0#4 : tensor }