[Mlir-commits] [flang] [mlir] [mlir][CSE] Add pruneDeadOps to CSE pass (PR #193778)

lonely eagle llvmlistbot at llvm.org
Sat May 2 07:13:55 PDT 2026


================
@@ -294,15 +297,38 @@ LogicalResult CSEDriver::simplifyOperation(ScopedMapTy &knownValues,
   return failure();
 }
 
+void CSEDriver::pruneDeadOps(Operation *root, ScopedMapTy &knownValues) {
+  // We use `SetVector` to prevent already inserted ops from being added to the
+  // `worklist` repeatedly, avoiding secondary access to erased operations.
+  llvm::SetVector<Operation *> worklist;
----------------
linuxlonelyeagle wrote:

I believe this PR makes sense. Shall we proceed with it?

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


More information about the Mlir-commits mailing list