[Mlir-commits] [mlir] [mlir] Use getAttr to replace getInherentAttr in the test-symbol-uses pass (PR #172675)

lonely eagle llvmlistbot at llvm.org
Wed Dec 17 07:22:02 PST 2025


================
@@ -59,7 +59,7 @@ struct SymbolUsesPass
               symbolUse.getUser()->getParentOp(), symbolUse.getSymbolRef())) {
         symbolUse.getUser()->emitRemark()
             << "found use of symbol : " << symbolUse.getSymbolRef() << " : "
-            << *symbol->getInherentAttr(SymbolTable::getSymbolAttrName());
+            << symbol->getAttr(SymbolTable::getSymbolAttrName());
----------------
linuxlonelyeagle wrote:

To be honest with you, I'm a bit confused. Using getAttr surprisingly works.I looked at the implementation of getAttr. Isn't it because getProperties Storage Size() returned 0? I thought dict-attr was not used when defining 'launch_func'. If there is anything wrong, I hope to point it out. I am sure there are some areas that I am not very clear about.😂
```
  Attribute getAttr(StringRef name) {
    if (getPropertiesStorageSize()) {
      if (std::optional<Attribute> inherentAttr = getInherentAttr(name))
        return *inherentAttr;
    }
    return attrs.get(name);
  }
```

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


More information about the Mlir-commits mailing list