[Mlir-commits] [mlir] [mlir][Transforms] Add dead code elimination pass (PR #106258)

Mehdi Amini llvmlistbot at llvm.org
Tue Aug 27 11:52:33 PDT 2024


================
@@ -93,6 +93,20 @@ def CSE : Pass<"cse"> {
   ];
 }
 
+def DeadCodeElimination : Pass<"dce"> {
+  let summary = "Remove dead operations and blocks";
+  let description = [{
+    This pass eliminates dead operations and blocks.
+
+    Operations are eliminated if they have no users and no side effects. Blocks
+    are eliminated if they are not reachable.
+
+    Note: Graph regions are currently not supported and skipped by this pass.
----------------
joker-eph wrote:

Graph regions are trivial to support though I believe, can we just add them? Completeness is nice :)

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


More information about the Mlir-commits mailing list