Skip to content

Commit 569ca0f

Browse files
[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.)
1 parent 0c124be commit 569ca0f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mlir/lib/Dialect/Async/Transforms/AsyncToAsyncRuntime.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -723,8 +723,8 @@ class YieldOpLowering : public OpConversionPattern<async::YieldOp> {
723723
// Switch the coroutine completion token to available state.
724724
rewriter.create<RuntimeSetAvailableOp>(loc, *coro.asyncToken);
725725

726-
rewriter.eraseOp(op);
727726
rewriter.create<cf::BranchOp>(loc, coro.cleanup);
727+
rewriter.eraseOp(op);
728728

729729
return success();
730730
}

0 commit comments

Comments
 (0)