[llvm] [mlir] [mlir] Add symbol user attribute interface. (PR #153206)

Mehdi Amini via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 17 03:13:43 PDT 2025


================
@@ -511,7 +511,14 @@ LogicalResult detail::verifySymbolTable(Operation *op) {
   SymbolTableCollection symbolTable;
   auto verifySymbolUserFn = [&](Operation *op) -> std::optional<WalkResult> {
     if (SymbolUserOpInterface user = dyn_cast<SymbolUserOpInterface>(op))
-      return WalkResult(user.verifySymbolUses(symbolTable));
+      if (failed(user.verifySymbolUses(symbolTable)))
+        return WalkResult::interrupt();
+    for (auto &attr : op->getAttrs()) {
----------------
joker-eph wrote:

```suggestion
    for (auto &attr : op->getDiscardableAttrs()) {
```

As we're splitting properties and attributes, I don't think we need more dependencies here!

But that also question the usefulness of this and how it'll work in practice: I assume an attribue that is part of the properties would also want to be verified.
However that should be handled through the SymbolUserOpInterface (which may just have to forward to the attribute).

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


More information about the llvm-commits mailing list