[all-commits] [llvm/llvm-project] 476ca0: [mlir][ods] Adding attribute setters generation

Alexandre Eichenberger via All-commits all-commits at lists.llvm.org
Wed Feb 19 08:49:40 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 476ca094c846a0b6d4d9f37710aba21a6b0b265a
      https://github.com/llvm/llvm-project/commit/476ca094c846a0b6d4d9f37710aba21a6b0b265a
  Author: Alexandre Eichenberger <alexe at us.ibm.com>
  Date:   2020-02-19 (Wed, 19 Feb 2020)

  Changed paths:
    M mlir/test/mlir-tblgen/op-attribute.td
    M mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp

  Log Message:
  -----------
  [mlir][ods] Adding attribute setters generation

In some dialects, attributes may have default values that may be
determined only after shape inference. For example, attributes that
are dependent on the rank of the input cannot be assigned a default
value until the rank of the tensor is inferred.

While we can set attributes without explicit setters, referring to
the attributes via accessors instead of having to use the string
interface is better for compile time verification.

The proposed patch add one method per operation attribute that let us
set its value. The code is a very small modification of the existing
getter methods.

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




More information about the All-commits mailing list