[mlir][async] Erase op later to preserve insertion point (#146516)

Delay the erasure of an op, so that the insertion point of the rewriter
remains valid.

This commit is in preparation of the One-Shot Dialect Conversion
refactoring. (The current implementation works with the current dialect
conversion driver because op erasure is delayed.)
This commit is contained in:
Matthias Springer
2025-07-01 17:25:21 +02:00
committed by GitHub
parent 0c124be33f
commit 569ca0f698

View File

@@ -723,8 +723,8 @@ public:
// Switch the coroutine completion token to available state.
rewriter.create<RuntimeSetAvailableOp>(loc, *coro.asyncToken);
rewriter.eraseOp(op);
rewriter.create<cf::BranchOp>(loc, coro.cleanup);
rewriter.eraseOp(op);
return success();
}