llvm-project
2d3bbb6a - [mlir][Transforms] Dialect conversion: Erase materialized constants instead of rollback (#136489)

Commit
1 year ago
[mlir][Transforms] Dialect conversion: Erase materialized constants instead of rollback (#136489) When illegal (and not legalizable) constant operations are materialized during a dialect conversion as part of op folding, these operations must be deleted again. This used to be implemented via the rollback mechanism. This commit switches the implementation to regular rewriter API usage: simply delete the materialized constants with `eraseOp`. This commit is in preparation of the One-Shot Dialect Conversion refactoring, which will disallow IR rollbacks. This commit also adds a new optional parameter to `OpBuilder::tryFold` to get hold of the materialized constant ops.
Parents
Loading