[Mlir-commits] [mlir] [MLIR] Incorrect track of usedKey in setPropertiesFromParsedAttr (PR #144789)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Wed Jun 18 13:26:09 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-mlir-core

Author: Chao Chen (chencha3)

<details>
<summary>Changes</summary>

Currently, the generated `setPropertiesFromParsedAttr` uses `usrdKey` to track "true" or "false" instead of attribute name, e.g., `usedKeys.insert(StringAttr::get(ctx, "true"));`. I am not sure whether it is a typo or designed to retire the use of attribute for property. Can someone help to check?

I will create a test if it is confirmed a typo. Otherwise, I will drop the PR.

---
Full diff: https://github.com/llvm/llvm-project/pull/144789.diff


1 Files Affected:

- (modified) mlir/tools/mlir-tblgen/OpFormatGen.cpp (+1-1) 


``````````diff
diff --git a/mlir/tools/mlir-tblgen/OpFormatGen.cpp b/mlir/tools/mlir-tblgen/OpFormatGen.cpp
index 0a9d14d6603a8..0777d8c7ad9ce 100644
--- a/mlir/tools/mlir-tblgen/OpFormatGen.cpp
+++ b/mlir/tools/mlir-tblgen/OpFormatGen.cpp
@@ -1365,7 +1365,7 @@ if (attr && ::mlir::failed(setFromAttr(prop.{1}, attr, emitError)))
 auto &propStorage = prop.{0};
 auto {0}AttrName = StringAttr::get(ctx, "{0}");
 auto attr = dict.get({0}AttrName);
-usedKeys.insert(StringAttr::get(ctx, "{1}"));
+usedKeys.insert({0}AttrName);
 if (attr || /*isRequired=*/{1}) {{
   if (!attr) {{
     emitError() << "expected key entry for {0} in DictionaryAttr to set "

``````````

</details>


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


More information about the Mlir-commits mailing list