[Mlir-commits] [mlir] [MLIR] Incorrect track of usedKey in setPropertiesFromParsedAttr (PR #144789)
Chao Chen
llvmlistbot at llvm.org
Wed Jun 18 13:25:37 PDT 2025
https://github.com/chencha3 created https://github.com/llvm/llvm-project/pull/144789
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.
>From ec5f6455e5d00459b5218636f94e7b148935cf4e Mon Sep 17 00:00:00 2001
From: Chao Chen <chao.chen at intel.com>
Date: Wed, 18 Jun 2025 20:11:17 +0000
Subject: [PATCH] change the key to attr name
---
mlir/tools/mlir-tblgen/OpFormatGen.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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 "
More information about the Mlir-commits
mailing list