[all-commits] [llvm/llvm-project] b727cf: [MLIR][LinAlg] Use AnyTypeOf for LinalgOperand for...

Ruizhe Zhao via All-commits all-commits at lists.llvm.org
Wed Aug 5 11:14:05 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: b727cfed5e765d099f47e6785f962695408977c0
      https://github.com/llvm/llvm-project/commit/b727cfed5e765d099f47e6785f962695408977c0
  Author: Vincent Zhao <vincentzhaorz at gmail.com>
  Date:   2020-08-05 (Wed, 05 Aug 2020)

  Changed paths:
    M mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td

  Log Message:
  -----------
  [MLIR][LinAlg] Use AnyTypeOf for LinalgOperand for better error msg.

Previously, `LinalgOperand` is defined with `Type<Or<..,>>`, which produces
not very readable error messages when it is not matched, e.g.,

```
'linalg.generic' op operand #0 must be anonymous_326, but got ....
```

It is simply because the `description` property is not properly set.

This diff switches to use `AnyTypeOf` for `LinalgOperand`, which automatically
generates a description based on the allowed types provided.

As a result, the error message now becomes:

```
'linalg.generic' op operand #0 must be ranked tensor of any type values or strided memref of any type values, but got ...
```

Which is clearer and more informative.

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D84428




More information about the All-commits mailing list