[Mlir-commits] [mlir] [mlir] add a way to query non-property attributes (PR #76959)

Oleksandr Alex Zinenko llvmlistbot at llvm.org
Thu Jan 4 06:56:12 PST 2024


================
@@ -500,6 +500,12 @@ class alignas(8) Operation final
                                llvm::to_vector(getDiscardableAttrs()));
   }
 
+  /// Return all attributes that are not stored as properties.
+  DictionaryAttr getNonPropertyAttrDictionary() {
+    return getPropertiesStorage() ? getDiscardableAttrDictionary()
+                                  : getAttrDictionary();
----------------
ftynse wrote:

I think it's inverted: when properties are used, this only returns the discardable attributes (`getAttrDictionary` will include properties into the dictionary in that case). I think this is equivalent to `return attrs`.

https://github.com/llvm/llvm-project/pull/76959


More information about the Mlir-commits mailing list