[mlir][async] Allow to call async.execute inside async.func
authoryijiagu <yijiagu@google.com>
Fri, 13 Jan 2023 23:56:17 +0000 (15:56 -0800)
committerEugene Zhulenev <ezhulenev@google.com>
Sat, 14 Jan 2023 00:04:24 +0000 (16:04 -0800)
commita5ddd92035042204d42e108631142694692eabf1
treed02fbf0f12202202a3a9d57afa4cb7862a31616c
parentd1fbe2ba6d40e5066060f37093b029a48c49aea7
[mlir][async] Allow to call async.execute inside async.func

This change added support of calling async execute inside async.func.
Ex.

```
async.func @async_func_call_func() -> !async.token {
  %token = async.execute {
    %c0 = arith.constant 0 : index
    memref.store %arg0, %arg1[%c0] : memref<1xf32>
    async.yield
  }
  async.await %token : !async.token
  return
}
```

Reviewed By: ezhulenev

Differential Revision: https://reviews.llvm.org/D141730
mlir/lib/Dialect/Async/Transforms/AsyncToAsyncRuntime.cpp
mlir/test/Dialect/Async/async-to-async-runtime.mlir
mlir/test/mlir-cpu-runner/async-func.mlir