[Mlir-commits] [mlir] [mlir] Refactor transform.apply_dce into a eliminateTriviallyDeadOps region-utils helper and expose as a Pass (PR #194041)

Mehdi Amini llvmlistbot at llvm.org
Thu Apr 30 01:13:48 PDT 2026


================
@@ -506,6 +507,78 @@ LogicalResult mlir::runRegionDCE(RewriterBase &rewriter,
   return deleteDeadness(rewriter, regions, liveMap);
 }
 
+bool mlir::eliminateTriviallyDeadOps(RewriterBase &rewriter, Region &region,
+                                     bool includeNestedRegions) {
+  bool changed = false;
+
+  // Step 1: walk each op in reverse program order. If the op is already
----------------
joker-eph wrote:

OK added a test and a fix for the enqueue stage (which needs a walk)

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


More information about the Mlir-commits mailing list