[Mlir-commits] [mlir] [mlir][SymbolTable] Handle unknown symbol users in SymbolUserMap (PR #227918)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu Oct 1 11:00:53 PDT 2026


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions h,cpp -- mlir/include/mlir/IR/SymbolTable.h mlir/lib/IR/SymbolTable.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/mlir/lib/IR/SymbolTable.cpp b/mlir/lib/IR/SymbolTable.cpp
index b02bcc2db..80ce4139f 100644
--- a/mlir/lib/IR/SymbolTable.cpp
+++ b/mlir/lib/IR/SymbolTable.cpp
@@ -1059,7 +1059,7 @@ SymbolUserMap::SymbolUserMap(SymbolTableCollection &symbolTable,
           symbolsWithAllUsesVisible.insert(&nestedOp);
       }
       auto symbolUses = SymbolTable::getSymbolUses(&nestedOp);
-      
+
       if (!symbolUses) {
         // An unknown op with a region may reference any symbol visible from
         // this table, so we cannot know all users. Record it and move on.
@@ -1082,8 +1082,9 @@ SymbolUserMap::SymbolUserMap(SymbolTableCollection &symbolTable,
 }
 
 bool SymbolUserMap::areAllUsesVisible(Operation *symbol) const {
-  for (Operation *parent = symbol->getParentOp(); parent; parent = parent->getParentOp()){
-    if(symbolTablesWithUnknownUsers.contains(parent)){
+  for (Operation *parent = symbol->getParentOp(); parent;
+       parent = parent->getParentOp()) {
+    if (symbolTablesWithUnknownUsers.contains(parent)) {
       return false;
     }
   }

``````````

</details>


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


More information about the Mlir-commits mailing list