[PATCH] D115790: [Coroutines] Set presplit attribute in Clang

Eugene Zhulenev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 17 07:25:58 PST 2021


ezhulenev added a subscriber: mehdi_amini.
ezhulenev added a comment.

There are two places where in MLIR you can put an attribute to coroutine functions:

1. https://github.com/llvm/llvm-project/blob/main/mlir/lib/Dialect/Async/Transforms/AsyncToAsyncRuntime.cpp#L126

This is the point when coroutine functions are created, and you can attach attribute to the `func` argument

2. https://github.com/llvm/llvm-project/blob/main/mlir/lib/Conversion/AsyncToLLVM/AsyncToLLVM.cpp#L325

Another options is to attach attribute to the `op->getParentOfType<FuncOp>` when async runtime operations lowered to `coro.id` intrinsic.

/cc @mehdi_amini to chime in what option is better. I'm not sure though what type of MLIR attribute will be translated to LLVM `"coroutine.presplit"="0"`, `UnitAttr`? Or it must be `IntegerAttr`.

I'm on vacation with limjted access to computer until the end of the year, I can take a look at it myself ~late Dec or early Jan.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115790/new/

https://reviews.llvm.org/D115790



More information about the llvm-commits mailing list