Lower async.func with async.coro and async.runtime operations
- This patch modifies AsyncToAsyncRuntime pass to add lowering async.func ops with coroutine cfg.
Example:
async.func @foo() -> !async.value<f32> { %cst = arith.constant 42.0 : f32 return %cst: f32 }
After lowering:
func.func @foo() -> !async.value<f32> attributes {passthrough = ["presplitcoroutine"]} { %0 = async.runtime.create : !async.value<f32> %1 = async.coro.id %2 = async.coro.begin %1 cf.br ^bb1 ^bb1: // pred: ^bb0 %cst = arith.constant 4.200000e+01 : f32 async.runtime.store %cst, %0 : <f32> async.runtime.set_available %0 : !async.value<f32> cf.br ^bb2 ^bb2: // pred: ^bb1 async.coro.free %1, %2 cf.br ^bb3 ^bb3: // pred: ^bb2 async.coro.end %2 return %0 : !async.value<f32> }
mega-nit: use T here for consistency with execute, or use f32 later