diff options
| author | yijiagu <yijiagu@google.com> | 2022-11-02 11:27:26 -0700 |
|---|---|---|
| committer | Eugene Zhulenev <ezhulenev@google.com> | 2022-11-02 11:34:08 -0700 |
| commit | 145d2a50b86fabe220284ca4a28b67cb8d26f1f1 (patch) | |
| tree | 0ef966682c5ef9ba8aac0bf42cf6cf0deb9e59e6 /lldb/source/Plugins/ScriptInterpreter/Python/ScriptedThreadPythonInterface.cpp | |
| parent | 65b130e32cad56e5f11d6d172eb90437e1cedbf6 (diff) | |
Add Async Function to the Async Dialect
Add Async Function to the Async Dialect
Today `async.execute` operation semantics requires attached region to be executed in a thread managed by the runtime, and always returns an `!async.token` result. We need to model async functions that are not necessarily executed in a runtime-managed threads, but eventually lowered to llvm coroutines.
Example:
```
async.func @foo(%arg0: !async.value<f32>) -> !async.token {
%0 = async.await %arg0: !async.value<f32>
"do_something_with_f32"(%0)
return
}
```
If `arg0` is available this function will be executed in the caller thread. If it's not available it will be suspended and resumed later later on a thread managed by the async runtime. Currently this is not representable with `async.execute` operations.
The longer term goal is to make async dialect more like https://github.com/lewissbaker/cppcoro to be able to represent structured host concurrency in MLIR.
(1) Add async.func, async.call, and async.return operations in Async Dialect
Reviewed By: ezhulenev, rriddle
Differential Revision: https://reviews.llvm.org/D137189
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptedThreadPythonInterface.cpp')
0 files changed, 0 insertions, 0 deletions
