[Mlir-commits] [mlir] [mlir] Walk nested non-symbol table ops in symbol dce (PR #143353)
Jacques Pienaar
llvmlistbot at llvm.org
Tue Jun 24 02:38:32 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();
+ }
----------------
jpienaar wrote:
You are correct previously we only got here with symbols, with the above change we can also hit intermediate ops here. I've done a filter so that we only get here if symbol/potentially symbol op.
https://github.com/llvm/llvm-project/pull/143353
More information about the Mlir-commits
mailing list