[PATCH] D66230: [coroutine] Fixes "cannot move instruction since its users are not dominated by CoroBegin" problem.

Gor Nishanov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 15 10:39:59 PDT 2019


GorNishanov added a comment.

In D66230#1630874 <https://reviews.llvm.org/D66230#1630874>, @rjmccall wrote:

> Seems reasonable to me.  If we're no longer imposing any *restrictions* for `@llvm.coro.begin`, is it serving any real purpose?  Is it just a way of getting a handle to the coroutine frame?


I think the original reason for the coro.begin is intact. LLVM Coroutines.rst stays "Depending on the alignment requirements of the objects in the coroutine frame and/or on the codegen compactness reasons the pointer returned from coro.begin may be at offset to the %mem argument. "

C++ FE obtains a memory in some way for the coroutine frame and then give it to coro.begin, saying: "Here. Use it for coroutine frame." Lowering of coro.begin may simply return the same pointer or it may do some adjustment to it. One possible adjustment would be, if there are any over-aligned variables with alignment larger than the alignment of the allocator (supplied to coro.id), coro.begin would do (NOT YET IMPLEMENTED) a dynamic adjustment to make sure everything is properly aligned.

That reminded me, there was a brief common C++ coroutine ABI discussion at Cologne and I don't think the results were shared with the interested parties. I'll send an e-mail shortly


Repository:
  rL LLVM

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

https://reviews.llvm.org/D66230





More information about the llvm-commits mailing list