[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
Sun Jul 18 19:23:40 PDT 2021


ChuanqiXu created this revision.
ChuanqiXu added reviewers: ychen, lxfind, rjmccall.
Herald added a subscriber: hiraditya.
ChuanqiXu requested review of this revision.
Herald added subscribers: llvm-commits, jdoerfert.
Herald added a project: LLVM.

This is an alternative to D97915 <https://reviews.llvm.org/D97915>.

The main differences for this diff with D97915 <https://reviews.llvm.org/D97915> are:

- Add only one extra optional coroutine intrinsics in switch style.
- Make the main work to over-align coroutine frame in CoroFrame.cpp.

The first point may be more important. Since coroutine language intrinsics is a language itself. Although it looks like that the switch style is used by C++ coroutine only, from the design it could and should be used by other languages easily. So less the intrinsics we add, the more clear the coroutine intrinsics would be. And I guess the extra intrinsic added in this diff may be more easy for user to use. If the user need to over align the frame due to limited allocator's alignment, it could emit one `coro.overalign` for the allocated memory and set the corresponding limited alignment. And every thing would be the same if the user doesn't need it.

The second point makes this diff more easy to review and edit.

Test Plan: check-llvm, https://gcc.godbolt.org/z/rGzaco, https://gcc.godbolt.org/z/W3ocj778M

---

Another question: if it is possible that we add the tests into the llvm? It looks like the test and unit test can't check the runtime behavior. I know there are slow tests in CI system, how could I edit that?


https://reviews.llvm.org/D106248

Files:
  clang/lib/CodeGen/CGCoroutine.cpp
  clang/test/CodeGenCoroutines/coro-alloc.cpp
  clang/test/CodeGenCoroutines/coro-gro-nrvo.cpp
  llvm/docs/Coroutines.rst
  llvm/include/llvm/IR/Intrinsics.td
  llvm/lib/Transforms/Coroutines/CoroFrame.cpp
  llvm/lib/Transforms/Coroutines/CoroInstr.h
  llvm/lib/Transforms/Coroutines/CoroInternal.h
  llvm/lib/Transforms/Coroutines/CoroSplit.cpp
  llvm/lib/Transforms/Coroutines/Coroutines.cpp
  llvm/test/Transforms/Coroutines/coro-alloca-overalign.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106248.359662.patch
Type: text/x-patch
Size: 22274 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210719/78ab1b84/attachment.bin>


More information about the llvm-commits mailing list