The patch adds a canonicalization pattern that removes the unused results of scf.if operation. As a result, cse may remove unused computations in the then and else regions of the scf.if operation.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
- exit early if the pattern does not apply
- update terminators of then and else bodies in place using the setOperands method
mlir/lib/Dialect/SCF/SCF.cpp | ||
---|---|---|
529 | Thanks for the hint! I was not aware that the pattern rewriter has this in place update functionality. |
Nit: if op -> IfOp