[all-commits] [llvm/llvm-project] c1eab5: [mlir] fix Operation::getDiscardableAttrs in absen...

ftynse via All-commits all-commits at lists.llvm.org
Wed Jan 3 07:33:41 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c1eab57673ef3eb2842c0fbe454d7878854cf54c
      https://github.com/llvm/llvm-project/commit/c1eab57673ef3eb2842c0fbe454d7878854cf54c
  Author: Oleksandr "Alex" Zinenko <zinenko at google.com>
  Date:   2024-01-03 (Wed, 03 Jan 2024)

  Changed paths:
    M mlir/include/mlir/IR/Operation.h
    M mlir/lib/CAPI/IR/IR.cpp
    M mlir/lib/IR/AsmPrinter.cpp
    M mlir/unittests/IR/OpPropertiesTest.cpp

  Log Message:
  -----------
  [mlir] fix Operation::getDiscardableAttrs in absence of properties (#76816)

When properties are not enabled in an operation, inherent attributes are
stored in the common dictionary with discardable attributes. However,
`getDiscardableAttrs` and `getDiscardableAttrDictionary` were returning
the entire dictionary, making the caller mistakenly believe that all
inherent attributes are discardable. Fix this by filtering out
attributes whose names are registered with the operation, i.e., inherent
attributes. This requires an API change so `getDiscardableAttrs` returns
a filter range.




More information about the All-commits mailing list