Skip to content

Conversation

@matthias-springer
Copy link
Member

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.)

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.
@llvmbot
Copy link
Member

llvmbot commented Jul 1, 2025

@llvm/pr-subscribers-mlir-async

@llvm/pr-subscribers-mlir

Author: Matthias Springer (matthias-springer)

Changes

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.)


Full diff: https://github.com/llvm/llvm-project/pull/146516.diff

1 Files Affected:

  • (modified) mlir/lib/Dialect/Async/Transforms/AsyncToAsyncRuntime.cpp (+1-1)
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<async::YieldOp> { // 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(); } 
@matthias-springer matthias-springer merged commit 569ca0f into main Jul 1, 2025
10 checks passed
@matthias-springer matthias-springer deleted the users/matthias-springer/ip_async branch July 1, 2025 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

5 participants