From 569ca0f69876ffbf7f27494b4bf212e8d236f7e9 Mon Sep 17 00:00:00 2001 From: Matthias Springer Date: Tue, 1 Jul 2025 17:25:21 +0200 Subject: [PATCH] [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.) --- mlir/lib/Dialect/Async/Transforms/AsyncToAsyncRuntime.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mlir/lib/Dialect/Async/Transforms/AsyncToAsyncRuntime.cpp b/mlir/lib/Dialect/Async/Transforms/AsyncToAsyncRuntime.cpp index c289faaf9983..8601bb5aaada 100644 --- a/mlir/lib/Dialect/Async/Transforms/AsyncToAsyncRuntime.cpp +++ b/mlir/lib/Dialect/Async/Transforms/AsyncToAsyncRuntime.cpp @@ -723,8 +723,8 @@ public: // 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(); }