This is an archive of the discontinued LLVM Phabricator instance.

Refactor AsyncToAsyncRuntime pass to boost understandability.
ClosedPublic

Authored by bakhtiyarneyman on Jul 23 2021, 5:56 PM.

Diff Detail

Event Timeline

bakhtiyarneyman requested review of this revision.Jul 23 2021, 5:56 PM
ezhulenev added inline comments.Jul 25 2021, 8:32 AM
mlir/lib/Dialect/Async/Transforms/AsyncToAsyncRuntime.cpp
295–297

Don't see why nested blocks are needed here

296

coro.entry should always have BranchOp terminator, just a cast should be ok here

323

is it needed here?

ezhulenev added inline comments.Jul 25 2021, 8:34 AM
mlir/lib/Dialect/Async/Transforms/AsyncToAsyncRuntime.cpp
190

As Mehdi mentioned in the previous PR it's better to verify preconditions early, also CondBr is another valid terminator, here it's enough to rewrite only YieldOp, and assume that every other terminator is already verified

bakhtiyarneyman marked 3 inline comments as done.

Addressing comments.

bakhtiyarneyman marked an inline comment as done.Jul 26 2021, 4:38 PM
bakhtiyarneyman added inline comments.
mlir/lib/Dialect/Async/Transforms/AsyncToAsyncRuntime.cpp
295–297

Just so that it's clear to what range of lines the comments apply.

bakhtiyarneyman marked an inline comment as done.

Address comments.

Superflous update.

ezhulenev accepted this revision.Jul 29 2021, 12:01 PM
This revision is now accepted and ready to land.Jul 29 2021, 12:01 PM