[Mlir-commits] [mlir] [MLIR] Handle materializeConstant failure in GreedyPatternRewriteDriver (PR #77258)

Matthias Springer llvmlistbot at llvm.org
Mon Jan 8 04:02:28 PST 2024


================
@@ -462,18 +463,38 @@ bool GreedyPatternRewriteDriver::processWorklist() {
           // Materialize Attributes as SSA values.
           Operation *constOp = op->getDialect()->materializeConstant(
               *this, ofr.get<Attribute>(), resultType, op->getLoc());
----------------
matthias-springer wrote:

`materializeConstant` will send a `notifyOperationInserted` which is not correct if we erase the ops again. We need a new temporary `OpBuilder` instead of `*this` and if all constants materialized successfully, trigger a manual `this->notifyOperationInserted` for each materialized constant.


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


More information about the Mlir-commits mailing list