[Mlir-commits] [mlir] [mlir] Walk nested non-symbol table ops in symbol dce (PR #143353)

Mehdi Amini llvmlistbot at llvm.org
Tue Jun 10 13:45:49 PDT 2025


================
@@ -128,13 +159,27 @@ LogicalResult SymbolDCE::computeLiveness(Operation *symbolTableOp,
     }
 
     SmallVector<Operation *, 4> resolvedSymbols;
+    // Get the first parent symbol table op.
+    Operation *parentOp = op->getParentOp();
+    while (parentOp && !parentOp->hasTrait<OpTrait::SymbolTable>()) {
+      parentOp = parentOp->getParentOp();
+    }
----------------
joker-eph wrote:

I'm a bit confused about this code-path.
Shouldn't we expect a symbol here? And so shouldn't the immediate parent be a symbol-table?

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


More information about the Mlir-commits mailing list