diff --git a/mlir/lib/Dialect/Async/Transforms/AsyncToAsyncRuntime.cpp b/mlir/lib/Dialect/Async/Transforms/AsyncToAsyncRuntime.cpp index c289faaf9983c..8601bb5aaada9 100644 --- a/mlir/lib/Dialect/Async/Transforms/AsyncToAsyncRuntime.cpp +++ b/mlir/lib/Dialect/Async/Transforms/AsyncToAsyncRuntime.cpp @@ -723,8 +723,8 @@ class YieldOpLowering : public OpConversionPattern { // Switch the coroutine completion token to available state. rewriter.create(loc, *coro.asyncToken); - rewriter.eraseOp(op); rewriter.create(loc, coro.cleanup); + rewriter.eraseOp(op); return success(); }