[all-commits] [llvm/llvm-project] 52a479: [mlir][ods] Store the pointer to the anchor elemen...

Jeff Niu via All-commits all-commits at lists.llvm.org
Tue Sep 20 11:08:13 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 52a479de607d2e03ccdd221ac8d4c6422a3f0703
      https://github.com/llvm/llvm-project/commit/52a479de607d2e03ccdd221ac8d4c6422a3f0703
  Author: Jeff Niu <jeff at modular.com>
  Date:   2022-09-20 (Tue, 20 Sep 2022)

  Changed paths:
    M mlir/tools/mlir-tblgen/AttrOrTypeFormatGen.cpp
    M mlir/tools/mlir-tblgen/FormatGen.cpp
    M mlir/tools/mlir-tblgen/FormatGen.h
    M mlir/tools/mlir-tblgen/OpFormatGen.cpp

  Log Message:
  -----------
  [mlir][ods] Store the pointer to the anchor element (NFC)

Instead of its index. There is no benefit to storing the index instead
of the pointer.

Reviewed By: rriddle

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


  Commit: 95a33b455d74b8c0c112ad499c071117361dd403
      https://github.com/llvm/llvm-project/commit/95a33b455d74b8c0c112ad499c071117361dd403
  Author: Jeff Niu <jeff at modular.com>
  Date:   2022-09-20 (Tue, 20 Sep 2022)

  Changed paths:
    M mlir/docs/AttributesAndTypes.md
    M mlir/docs/OpDefinitions.md
    M mlir/test/lib/Dialect/Test/TestOps.td
    M mlir/test/lib/Dialect/Test/TestTypeDefs.td
    M mlir/test/mlir-tblgen/attr-or-type-format.td
    M mlir/test/mlir-tblgen/op-format.mlir
    M mlir/test/mlir-tblgen/op-format.td
    M mlir/tools/mlir-tblgen/AttrOrTypeFormatGen.cpp
    M mlir/tools/mlir-tblgen/FormatGen.cpp
    M mlir/tools/mlir-tblgen/FormatGen.h
    M mlir/tools/mlir-tblgen/OpFormatGen.cpp

  Log Message:
  -----------
  [mlir][ods] Format: allow anchors in the else elements

This patch changes optional groups to allow anchors in the 'else'
element group. When printing, the optional condition is inverted to
decide which group to print. This is useful for parsing concrete
optional elements that don't have a `parseOptional*` method or some
other way to test whether it's present.

Depends on D133805

Reviewed By: rriddle

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


  Commit: 4792f2ab214e2df7875d17d4258bd5eae733e825
      https://github.com/llvm/llvm-project/commit/4792f2ab214e2df7875d17d4258bd5eae733e825
  Author: Jeff Niu <jeff at modular.com>
  Date:   2022-09-20 (Tue, 20 Sep 2022)

  Changed paths:
    M mlir/docs/AttributesAndTypes.md
    M mlir/include/mlir/IR/AttrTypeBase.td
    M mlir/lib/TableGen/AttrOrTypeDef.cpp
    M mlir/test/lib/Dialect/Test/TestTypeDefs.td
    M mlir/test/mlir-tblgen/attr-or-type-format.td
    M mlir/tools/mlir-tblgen/AttrOrTypeFormatGen.cpp

  Log Message:
  -----------
  [mlir][ods] Generalize default/optional parameters

This patch consolidates the notions of an optional parameter and a
default parameter. An optional parameter is a parameter equal to its
default value, which for a "purely optional" parameter is its "null"
value.

This allows the existing `comparator` and `defaultValue` fields to be
used enabled more complex "optional" parameters, such as empty arrays.

Depends on D133812

Reviewed By: rriddle

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


  Commit: daedea39d182c7cac3cf9699ec1f58b471398c3b
      https://github.com/llvm/llvm-project/commit/daedea39d182c7cac3cf9699ec1f58b471398c3b
  Author: Jeff Niu <jeff at modular.com>
  Date:   2022-09-20 (Tue, 20 Sep 2022)

  Changed paths:
    M mlir/include/mlir/IR/AttrTypeBase.td
    M mlir/test/IR/array-of-attr.mlir
    M mlir/test/lib/Dialect/Test/TestAttrDefs.td

  Log Message:
  -----------
  [mlir][ods] Allow empty array ref parameter

This patch "fixes" a longstanding issue where the assembly format for
ArrayRefParameter could not handle an empty list. This is because there
was no way to generically optionally parse the first element of the
array. The only solution was to write a (relatively simple) custom parser.

This patch implements "empty" ArrayRefParameters by using
inverted optional groups and an optional ArrayRefParameter.

Depends on D133816

Reviewed By: rriddle

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


Compare: https://github.com/llvm/llvm-project/compare/4df84ac377df...daedea39d182


More information about the All-commits mailing list