[all-commits] [llvm/llvm-project] 51d5d7: Extend `retcon.once` coroutines lowering to option...
Anton Korobeynikov via All-commits
all-commits at lists.llvm.org
Fri Sep 15 09:54:51 PDT 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 51d5d7bbae92493a5bfa7cc6b519de8a5bb32fdb
https://github.com/llvm/llvm-project/commit/51d5d7bbae92493a5bfa7cc6b519de8a5bb32fdb
Author: Anton Korobeynikov <anton at korobeynikov.info>
Date: 2023-09-15 (Fri, 15 Sep 2023)
Changed paths:
M clang/lib/CodeGen/CGCoroutine.cpp
M clang/test/CodeGenCoroutines/coro-builtins.c
M clang/test/CodeGenCoroutines/coro-eh-cleanup.cpp
M llvm/docs/Coroutines.rst
M llvm/include/llvm/IR/Intrinsics.td
M llvm/lib/IR/AutoUpgrade.cpp
M llvm/lib/Transforms/Coroutines/CoroInstr.h
M llvm/lib/Transforms/Coroutines/CoroSplit.cpp
M llvm/test/Assembler/auto_upgrade_intrinsics.ll
M llvm/test/Transforms/Coroutines/ArgAddr.ll
M llvm/test/Transforms/Coroutines/coro-align16.ll
M llvm/test/Transforms/Coroutines/coro-align32.ll
M llvm/test/Transforms/Coroutines/coro-align64-02.ll
M llvm/test/Transforms/Coroutines/coro-align64.ll
M llvm/test/Transforms/Coroutines/coro-align8-02.ll
M llvm/test/Transforms/Coroutines/coro-align8.ll
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-01.ll
M llvm/test/Transforms/Coroutines/coro-alloca-02.ll
M llvm/test/Transforms/Coroutines/coro-alloca-03.ll
M llvm/test/Transforms/Coroutines/coro-alloca-04.ll
M llvm/test/Transforms/Coroutines/coro-alloca-05.ll
M llvm/test/Transforms/Coroutines/coro-alloca-06.ll
M llvm/test/Transforms/Coroutines/coro-alloca-07.ll
M llvm/test/Transforms/Coroutines/coro-alloca-08.ll
M llvm/test/Transforms/Coroutines/coro-alloca-09.ll
M llvm/test/Transforms/Coroutines/coro-alloca-loop-carried-address.ll
M llvm/test/Transforms/Coroutines/coro-async-addr-lifetime-infinite-loop-bug.ll
M llvm/test/Transforms/Coroutines/coro-async-addr-lifetime-start-bug.ll
M llvm/test/Transforms/Coroutines/coro-async-dyn-align.ll
M llvm/test/Transforms/Coroutines/coro-async.ll
M llvm/test/Transforms/Coroutines/coro-byval-param.ll
M llvm/test/Transforms/Coroutines/coro-catchswitch-cleanuppad.ll
M llvm/test/Transforms/Coroutines/coro-catchswitch.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-dbg.values.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-reuse-alloca-00.ll
M llvm/test/Transforms/Coroutines/coro-frame-reuse-alloca-01.ll
M llvm/test/Transforms/Coroutines/coro-frame-reuse-alloca-02.ll
M llvm/test/Transforms/Coroutines/coro-frame-reuse-alloca-03.ll
M llvm/test/Transforms/Coroutines/coro-frame-reuse-alloca-04.ll
M llvm/test/Transforms/Coroutines/coro-frame-reuse-alloca-05.ll
M llvm/test/Transforms/Coroutines/coro-frame-unreachable.ll
M llvm/test/Transforms/Coroutines/coro-frame.ll
M llvm/test/Transforms/Coroutines/coro-materialize.ll
M llvm/test/Transforms/Coroutines/coro-noalias-param.ll
M llvm/test/Transforms/Coroutines/coro-padding.ll
M llvm/test/Transforms/Coroutines/coro-param-copy.ll
M llvm/test/Transforms/Coroutines/coro-preserve-final.ll
M llvm/test/Transforms/Coroutines/coro-readnone-02.ll
M llvm/test/Transforms/Coroutines/coro-readnone.ll
M llvm/test/Transforms/Coroutines/coro-retcon-alloca-opaque-ptr.ll
M llvm/test/Transforms/Coroutines/coro-retcon-alloca.ll
M llvm/test/Transforms/Coroutines/coro-retcon-frame.ll
M llvm/test/Transforms/Coroutines/coro-retcon-once-private.ll
M llvm/test/Transforms/Coroutines/coro-retcon-once-value.ll
M llvm/test/Transforms/Coroutines/coro-retcon-once-value2.ll
M llvm/test/Transforms/Coroutines/coro-retcon-opaque-ptr.ll
M llvm/test/Transforms/Coroutines/coro-retcon-remat.ll
M llvm/test/Transforms/Coroutines/coro-retcon-resume-values.ll
M llvm/test/Transforms/Coroutines/coro-retcon-resume-values2.ll
M llvm/test/Transforms/Coroutines/coro-retcon-unreachable.ll
M llvm/test/Transforms/Coroutines/coro-retcon-value.ll
M llvm/test/Transforms/Coroutines/coro-retcon.ll
M llvm/test/Transforms/Coroutines/coro-spill-after-phi.ll
M llvm/test/Transforms/Coroutines/coro-spill-corobegin.ll
M llvm/test/Transforms/Coroutines/coro-spill-defs-before-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-split-00.ll
M llvm/test/Transforms/Coroutines/coro-split-01.ll
M llvm/test/Transforms/Coroutines/coro-split-02.ll
M llvm/test/Transforms/Coroutines/coro-split-alloc.ll
M llvm/test/Transforms/Coroutines/coro-split-dbg.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-final-suspend.ll
M llvm/test/Transforms/Coroutines/coro-split-hidden.ll
M llvm/test/Transforms/Coroutines/coro-split-musttail-ppc64le.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-musttail10.ll
M llvm/test/Transforms/Coroutines/coro-split-musttail11.ll
M llvm/test/Transforms/Coroutines/coro-split-musttail12.ll
M llvm/test/Transforms/Coroutines/coro-split-musttail13.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-musttail8.ll
M llvm/test/Transforms/Coroutines/coro-split-musttail9.ll
M llvm/test/Transforms/Coroutines/coro-split-no-lieftime.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-swifterror.ll
M llvm/test/Transforms/Coroutines/coro-zero-alloca.ll
M llvm/test/Transforms/Coroutines/ex0.ll
M llvm/test/Transforms/Coroutines/ex1.ll
M llvm/test/Transforms/Coroutines/ex2.ll
M llvm/test/Transforms/Coroutines/ex3.ll
M llvm/test/Transforms/Coroutines/ex4.ll
M llvm/test/Transforms/Coroutines/ex5.ll
M llvm/test/Transforms/Coroutines/no-suspend.ll
M llvm/test/Transforms/Coroutines/phi-coro-end.ll
M llvm/test/Transforms/Coroutines/remarks.ll
M llvm/test/Transforms/FunctionAttrs/noreturn.ll
M llvm/test/Transforms/LICM/sink-with-coroutine.ll
M mlir/include/mlir/Dialect/LLVMIR/LLVMIntrinsicOps.td
M mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
M mlir/lib/Conversion/AsyncToLLVM/AsyncToLLVM.cpp
M mlir/lib/Target/LLVMIR/ModuleImport.cpp
M mlir/test/Target/LLVMIR/Import/intrinsic.ll
M mlir/test/Target/LLVMIR/llvmir-intrinsics.mlir
Log Message:
-----------
Extend `retcon.once` coroutines lowering to optionally produce a normal result (#66333)
One of the main user of these kind of coroutines is swift. There yield-once (`retcon.once`) coroutines are used to temporary "expose" pointers to internal fields of various objects creating borrow scopes.
However, in some cases it might be useful also to allow these coroutines to produce a normal result, but there is no convenient way to represent this (as compared to switched-resume kind of coroutines where C++ `co_return`
is transformed to a member / callback call on promise object).
The extension is simple: we allow continuation function to have a non-void result and accept optional extra arguments via a special `llvm.coro.end.result` intrinsic that would essentially forward them as normal results.
More information about the All-commits
mailing list