[Mlir-commits] [mlir] [mlir][Transforms] `remove-dead-values`: Rely on canonicalizer for region simplification (PR #173505)
Matthias Springer
llvmlistbot at llvm.org
Thu Jan 1 03:50:53 PST 2026
================
@@ -246,7 +246,17 @@ def RemoveDeadValues : Pass<"remove-dead-values"> {
do = square_and_double_of_y(5)
print(do)
```
+
+ Note: If `canonicalize` is set to "false", this pass does not remove any
+ block arguments / op results from ops that implement the
+ RegionBranchOpInterface. Instead, it just sets dead operands to
+ "ub.poison".
----------------
matthias-springer wrote:
There is no fixed-point iteration / greedy pattern rewrite with `canonicalize=false`. This flag is mainly for testing/debugging purposes. You can see the output of `-remove-dead-values` before the canonicalization patterns are applied.
If you run `-remove-dead-values="canonicalize=false" -remove-dead-values="canonicalize=true"`, some checks will be performed multiple times. By "checks" I mean mainly the liveness analysis, which is computed at the beginning of every pass invocation. There used to be additional checks/analyses for `RegionBranchOpInterface` ops, but these were deleted in this PR. (They are no longer needed because the IR is rewritten incrementally by the canonicalization patterns.)
https://github.com/llvm/llvm-project/pull/173505
More information about the Mlir-commits
mailing list