This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Add async.await operation to async dialect
ClosedPublic

Authored by ezhulenev on Oct 9 2020, 8:54 AM.

Details

Summary

Add async.await operation to "unwrap" async.values

Diff Detail

Event Timeline

ezhulenev created this revision.Oct 9 2020, 8:54 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 9 2020, 8:54 AM
ezhulenev requested review of this revision.Oct 9 2020, 8:54 AM
mehdi_amini added inline comments.Oct 9 2020, 6:35 PM
mlir/lib/Dialect/Async/IR/Async.cpp
277

Can't this use the declarative assembly?

309

Typo: unwraps

Fix typo

mlir/lib/Dialect/Async/IR/Async.cpp
277

Declarative assembly will require typing unwrapped type, something like %0 = async.await %av :!async.value<type> -> type? Or is it possible to register just the type inference for parser?

csigg added inline comments.Oct 12 2020, 1:46 AM
mlir/lib/Dialect/Async/IR/Async.cpp
277

custom<> might work.

ezhulenev updated this revision to Diff 297605.Oct 12 2020, 8:43 AM

Use assembly format with custom directives.

ezhulenev marked 2 inline comments as done.Oct 12 2020, 8:44 AM
ezhulenev added inline comments.
mlir/lib/Dialect/Async/IR/Async.cpp
277

Thanks, didn't see it before, it indeed works quite nice in this case.

herhut added inline comments.Oct 12 2020, 8:57 AM
mlir/include/mlir/Dialect/Async/IR/AsyncOps.td
99

nit: becomes

114

Would Optional<AnyType>:$value work?

mlir/lib/Dialect/Async/IR/Async.cpp
263

Would it make sense to have one builder that either extracts the result type if it is an async.value or otherwise builds an await without result?

312

These errors are missing tests.

ezhulenev updated this revision to Diff 297617.Oct 12 2020, 9:48 AM
ezhulenev marked 4 inline comments as done.

Change return type to optional + add verification tests.

ezhulenev marked an inline comment as done.Oct 12 2020, 9:48 AM
ezhulenev updated this revision to Diff 297693.Oct 12 2020, 2:39 PM

Update function parameter names to match declaration.

mehdi_amini accepted this revision.Oct 12 2020, 4:40 PM
This revision is now accepted and ready to land.Oct 12 2020, 4:40 PM
This revision was automatically updated to reflect the committed changes.