[llvm-branch-commits] [mlir] [mlir][Transforms] `remove-dead-values`: Rely on canonicalizer for region simplification (PR #173505)

Renato Golin via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Jan 1 13:30:55 PST 2026


================
@@ -975,7 +811,27 @@ void RemoveDeadValues::runOnOperation() {
     }
   });
 
-  cleanUpDeadVals(finalCleanupList);
+  MLIRContext *context = module->getContext();
+  cleanUpDeadVals(context, finalCleanupList);
----------------
rengolin wrote:

> One way to think about this: in case of `RegionBranchOpInterface` ops, we don't erase any values anymore. Instead, we just augment the IR with liveness information (by swapping operands with `ub.poison`). This simplifies the IR good enough for the canonicalization patterns to (incrementally) perform the cleanup.

Ack. Clearer. Thanks!

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


More information about the llvm-branch-commits mailing list