[PATCH] D136932: [Coroutines] Use default attributes for some coro intrinsics

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 28 03:21:49 PDT 2022


nikic added a comment.

In D136932#3891356 <https://reviews.llvm.org/D136932#3891356>, @ChuanqiXu wrote:

> Thanks for doing this! I'll try to look at the other intrinsics. For this patch, coro.id looks OK to be marked as Default. But llvm.coro.subfn.addr can't be marked as `nofree` and I am not sure if it is good to be marked as `nosync`. Since `coro.subfn.addr` comes from either `coro.destroy(Frame*)` or `coro.resume(Frame*)`. And `destroy(Frame*)` is clearly not good for `nofree`. And we can think `coro.resume(Frame*)` is general call to any function (if we don't apply IPA). So it looks not good to mark it as `nosync` if I don't misunderstand `nosync`.

I was looking at this lowering of `coro.subfn.addr`: https://github.com/llvm/llvm-project/blob/dc39819915eeba7fa26663fddedf4ed90748ee0f/llvm/lib/Transforms/Coroutines/CoroCleanup.cpp#L30-L45 It seems to be lowered to a simple (non-atomic) load at an offset of the frame, so I would expect it to be both nofree and nosync.


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

https://reviews.llvm.org/D136932



More information about the llvm-commits mailing list