[PATCH] D106248: [Coroutines] Overalign coroutine frame when frame alignment exceeds the alignment limit

Chuanqi Xu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 20 23:12:11 PDT 2021


ChuanqiXu added a comment.

In D106248#2892459 <https://reviews.llvm.org/D106248#2892459>, @ychen wrote:

> Thanks for the patch. Does it make more sense to compare this with D100739 <https://reviews.llvm.org/D100739> (The implementation details are slightly different but the idea is similar: generating code to handle the overaligned frame in the backend. )?

Yeah, compared with D100739 <https://reviews.llvm.org/D100739>, the overall idea may be similar. The main overall difference may be the design for introduced intrinsics, `llvm.coro.overalign` in this diff and `llvm.coro.size.aligned` in D100739 <https://reviews.llvm.org/D100739>. The intrinsic `llvm.coro.overalign` emitted by the frontend returns the address of allocated space. It gives more control to users. What I mean is that the user may be available to touch the allocated space once `coroutine frame` and `allocated space` don't refer to the same thing anymore.  And the design for `llvm.coro.size` and `llvm.coro.size.aligned` may be odd to me slightly. Since the LLVM coroutine intrinsics is language itself. I think it matters.

> I think a consensus is needed about where to implement this: LLVM or Clang. My preference would be Clang however I think implementing this in LLVM is simpler. I'd appreciate other reviewer's comments.

My preference would be LLVM. First, it is more simpler. Second, it should be the responsibility in the middle end. Since Clang/LLVM coroutine leaves the work for manipulating the coroutine memories to the middle end by design. And I don't know what's the benefit we could get to implement it in clang. After all, we still need some work in the middle end.


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

https://reviews.llvm.org/D106248



More information about the llvm-commits mailing list