[all-commits] [llvm/llvm-project] 82140a: [mlir] Add method to populate default attributes

Jacques Pienaar via All-commits all-commits at lists.llvm.org
Fri Jul 8 11:31:28 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 82140ad72814f5544e68643c64e528fa5b734fad
      https://github.com/llvm/llvm-project/commit/82140ad72814f5544e68643c64e528fa5b734fad
  Author: Jacques Pienaar <jpienaar at google.com>
  Date:   2022-07-08 (Fri, 08 Jul 2022)

  Changed paths:
    M mlir/include/mlir/IR/ExtensibleDialect.h
    M mlir/include/mlir/IR/OpDefinition.h
    M mlir/include/mlir/IR/Operation.h
    M mlir/include/mlir/IR/OperationSupport.h
    M mlir/lib/IR/ExtensibleDialect.cpp
    M mlir/lib/IR/MLIRContext.cpp
    M mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
    M mlir/unittests/IR/OperationSupportTest.cpp

  Log Message:
  -----------
  [mlir] Add method to populate default attributes

Previously default attributes were only usable by way of the ODS generated
accessors, but this was undesirable as
1. The ODS getters could construct Attribute each get request;
2. For non-C++ uses this would require either duplicating some of tee default
   attribute generating or generating additional bindings to generate methods;
3. Accessing op.getAttr("foo") and op.getFoo() would return different results;
Generate method to populate default attributes that can be used to address
these.

This merely adds this facility but does not employ by default on any path.

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




More information about the All-commits mailing list