[all-commits] [llvm/llvm-project] d50571: [mlir][OpDSL] Add default value to index attributes.

Tobias Gysi via All-commits all-commits at lists.llvm.org
Mon Feb 14 04:38:24 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d50571ab07e1fc1761cf2a884459fe4892ec75f1
      https://github.com/llvm/llvm-project/commit/d50571ab07e1fc1761cf2a884459fe4892ec75f1
  Author: gysit <gysit at google.com>
  Date:   2022-02-14 (Mon, 14 Feb 2022)

  Changed paths:
    M mlir/docs/Dialects/Linalg/OpDSL.md
    M mlir/include/mlir/Dialect/Linalg/IR/LinalgNamedStructuredOps.yaml
    M mlir/python/mlir/dialects/linalg/opdsl/lang/comprehension.py
    M mlir/python/mlir/dialects/linalg/opdsl/lang/config.py
    M mlir/python/mlir/dialects/linalg/opdsl/lang/emitter.py
    M mlir/python/mlir/dialects/linalg/opdsl/ops/core_named_ops.py
    M mlir/test/Dialect/Linalg/named-ops.mlir
    M mlir/test/mlir-linalg-ods-gen/test-linalg-ods-yaml-gen.yaml
    M mlir/test/python/dialects/linalg/opdsl/arguments.py
    M mlir/test/python/dialects/linalg/opdsl/emit_convolution.py
    M mlir/test/python/dialects/linalg/opdsl/emit_pooling.py
    M mlir/test/python/integration/dialects/linalg/opsrun.py
    M mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-yaml-gen.cpp

  Log Message:
  -----------
  [mlir][OpDSL] Add default value to index attributes.

Index attributes had no default value, which means the attribute values had to be set on the operation. This revision adds a default parameter to `IndexAttrDef`. After the change, every index attribute has to define a default value. For example, we may define the following strides attribute:
```

```
When using the operation the default stride is used if the strides attribute is not set. The mechanism is implemented using `DefaultValuedAttr`.

Additionally, the revision uses the naming index attribute instead of attribute more consistently, which is a preparation for follow up revisions that will introduce function attributes.

Depends On D119125

Reviewed By: stellaraccident

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




More information about the All-commits mailing list