[all-commits] [llvm/llvm-project] 1a5822: [coro] Use C calling convention for C++20 coroutin...

Adrian Vogelsgesang via All-commits all-commits at lists.llvm.org
Wed May 27 17:11:07 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1a5822e3c9421fd0a270e7bad3dff92219dd9da3
      https://github.com/llvm/llvm-project/commit/1a5822e3c9421fd0a270e7bad3dff92219dd9da3
  Author: Adrian Vogelsgesang <avogelsgesang at salesforce.com>
  Date:   2026-05-28 (Thu, 28 May 2026)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/test/CodeGenCoroutines/coro-gro4.cpp
    M clang/test/CodeGenCoroutines/coro-symmetric-transfer-03.cpp
    M clang/test/CodeGenCoroutines/coro-symmetric-transfer-04.cpp
    M clang/test/CodeGenCoroutines/pr65018.cpp
    M llvm/docs/Coroutines.rst
    M llvm/docs/ReleaseNotes.md
    M llvm/include/llvm/Transforms/Coroutines/CoroShape.h
    M llvm/lib/Transforms/Coroutines/CoroCleanup.cpp
    M llvm/lib/Transforms/Coroutines/CoroEarly.cpp
    M llvm/lib/Transforms/Coroutines/CoroSplit.cpp
    M llvm/test/Transforms/Coroutines/coro-alloc-with-param-O0.ll
    M llvm/test/Transforms/Coroutines/coro-alloc-with-param-O2.ll
    M llvm/test/Transforms/Coroutines/coro-alloca-07.ll
    M llvm/test/Transforms/Coroutines/coro-await-suspend-handle-in-ramp.ll
    M llvm/test/Transforms/Coroutines/coro-await-suspend-lower-invoke.ll
    M llvm/test/Transforms/Coroutines/coro-await-suspend-lower.ll
    M llvm/test/Transforms/Coroutines/coro-debug-O2.ll
    M llvm/test/Transforms/Coroutines/coro-debug-coro-frame.ll
    M llvm/test/Transforms/Coroutines/coro-debug-dbg.values-not_used_in_frame.ll
    M llvm/test/Transforms/Coroutines/coro-debug-frame-variable.ll
    M llvm/test/Transforms/Coroutines/coro-debug-spill-dbg.declare.ll
    M llvm/test/Transforms/Coroutines/coro-debug.ll
    M llvm/test/Transforms/Coroutines/coro-eh-aware-edge-split-00.ll
    M llvm/test/Transforms/Coroutines/coro-eh-aware-edge-split-01.ll
    M llvm/test/Transforms/Coroutines/coro-eh-aware-edge-split-02.ll
    M llvm/test/Transforms/Coroutines/coro-frame-arrayalloca.ll
    M llvm/test/Transforms/Coroutines/coro-frame.ll
    M llvm/test/Transforms/Coroutines/coro-noop-pacbti.ll
    M llvm/test/Transforms/Coroutines/coro-noop.ll
    M llvm/test/Transforms/Coroutines/coro-padding.ll
    M llvm/test/Transforms/Coroutines/coro-resume-destroy.ll
    M llvm/test/Transforms/Coroutines/coro-spill-corobegin.ll
    M llvm/test/Transforms/Coroutines/coro-spill-promise-02.ll
    M llvm/test/Transforms/Coroutines/coro-spill-promise.ll
    M llvm/test/Transforms/Coroutines/coro-spill-suspend.ll
    M llvm/test/Transforms/Coroutines/coro-split-dbg-labels-inlined.ll
    M llvm/test/Transforms/Coroutines/coro-split-dbg-labels.ll
    M llvm/test/Transforms/Coroutines/coro-split-eh-00.ll
    M llvm/test/Transforms/Coroutines/coro-split-eh-01.ll
    M llvm/test/Transforms/Coroutines/coro-split-musttail-chain-pgo-counter-promo.ll
    M llvm/test/Transforms/Coroutines/coro-split-musttail.ll
    M llvm/test/Transforms/Coroutines/coro-split-musttail1.ll
    M llvm/test/Transforms/Coroutines/coro-split-musttail2.ll
    M llvm/test/Transforms/Coroutines/coro-split-musttail3.ll
    M llvm/test/Transforms/Coroutines/coro-split-musttail4.ll
    M llvm/test/Transforms/Coroutines/coro-split-musttail5.ll
    M llvm/test/Transforms/Coroutines/coro-split-musttail6.ll
    M llvm/test/Transforms/Coroutines/coro-split-musttail7.ll
    M llvm/test/Transforms/Coroutines/coro-split-sink-lifetime-01.ll
    M llvm/test/Transforms/Coroutines/coro-split-sink-lifetime-02.ll
    M llvm/test/Transforms/Coroutines/coro-split-sink-lifetime-03.ll
    M llvm/test/Transforms/Coroutines/coro-split-sink-lifetime-04.ll
    M llvm/test/Transforms/Coroutines/coro-split-tbaa-md.ll
    M llvm/test/Transforms/Coroutines/coro-zero-alloca.ll

  Log Message:
  -----------
  [coro] Use C calling convention for C++20 coroutines (#198943)

Change the calling convention for resume / destroy functions of C++
coroutines from `fastcc` to the C calling convention.

The resume / destroy functions are exposed as part of the coroutine ABI
and must be compatible with other compilers and other versions of LLVM.
fastcc is an LLVM-internal, unstable calling convention, though.

In practice, fastcc and the C calling convention are in sync for `void
func(void*)` function signatures on almost all platforms. Therefore, I
think we can still do this change without widespread ABI breakage.

`fastcc` and `ccc` do differ for i686 (x86-32), MIPS O32, PowerPC64
ELFv1 and Lanai. Afaik, those are all legacy ABIs and a recent feature
like C++20 coroutines is unlikely to be used by projects still targeting
legacy ABIs.

Historical context: I tried to figure out why `fastcc` was used. It is
around since the original commit f93082e71a94 from 2016, predating the
cross-vendor coroutine ABI work. I could not find any discussion of
whether this should use `fastcc` on the review or on the mailing list.

As a side-effect, this also fixes #91123.

Co-authored-by: Cursor <cursoragent at cursor.com>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list