llvm-project/clang/test/CodeGenCoroutines
Xun Li 822b92aae4 [Coroutines] Add the newly generated SCCs back to the CGSCC work queue after CoroSplit actually happened
Relevant discussion can be found at: https://lists.llvm.org/pipermail/llvm-dev/2021-January/148197.html
In the existing design, An SCC that contains a coroutine will go through the folloing passes:
Inliner -> CoroSplitPass (fake) -> FunctionSimplificationPipeline -> Inliner -> CoroSplitPass (real) -> FunctionSimplificationPipeline

The first CoroSplitPass doesn't do anything other than putting the SCC back to the queue so that the entire pipeline can repeat.
As you can see, we run Inliner twice on the SCC consecutively without doing any real split, which is unnecessary and likely unintended.
What we really wanted is this:
Inliner -> FunctionSimplificationPipeline -> CoroSplitPass -> FunctionSimplificationPipeline
(note that we don't really need to run Inliner again on the ramp function after split).

Hence the way we do it here is to move CoroSplitPass to the end of the CGSCC pipeline, make it once for real, insert the newly generated SCCs (the clones) back to the pipeline so that they can be optimized, and also add a function simplification pipeline after CoroSplit to optimize the post-split ramp function.

This approach also conforms to how the new pass manager works instead of relying on an adhoc post split cleanup, making it ready for full switch to new pass manager eventually.

By looking at some of the changes to the tests, we can already observe that this changes allows for more optimizations applied to coroutines.

Reviewed By: aeubanks, ChuanqiXu

Differential Revision: https://reviews.llvm.org/D95807
2021-06-30 11:38:14 -07:00
..
Inputs [Coroutine][Sema] Tighten the lifetime of symmetric transfer returned handle 2020-09-11 13:35:37 -07:00
coro-alloc.cpp [Coroutine][Clang] Force emit lifetime intrinsics for Coroutines 2021-03-25 13:46:20 -07:00
coro-always-inline.cpp Revert "[Coroutines] Set presplit attribute in Clang instead of CoroEarly pass" 2021-04-18 17:22:28 -07:00
coro-await-domination.cpp [Coroutines] Ensure co_await promise.final_suspend() does not throw 2020-06-22 15:01:42 -07:00
coro-await-resume-eh.cpp [Coroutine][Clang] Force emit lifetime intrinsics for Coroutines 2021-03-25 13:46:20 -07:00
coro-await.cpp [Coroutine][Clang] Force emit lifetime intrinsics for Coroutines 2021-03-25 13:46:20 -07:00
coro-builtins-err.c
coro-builtins.c
coro-cleanup.cpp [test] Add {{.*}} to make ELF tests immune to dso_local/dso_preemptable/(none) differences 2020-12-31 00:27:11 -08:00
coro-dest-slot.cpp [NFC][Coroutines] Fix two tests by removing hardcoded SSA value. 2021-05-09 19:06:16 -07:00
coro-dwarf.cpp [Clang][Coroutine][DebugInfo] Relax test ordering requirement 2021-04-26 10:07:22 +01:00
coro-eh-cleanup.cpp
coro-gro-nrvo.cpp [test] Add {{.*}} to make ELF tests immune to dso_local/dso_preemptable/(none) differences 2020-12-31 00:27:11 -08:00
coro-gro.cpp [test] Add {{.*}} to make ELF tests immune to dso_local/dso_preemptable/(none) differences 2020-12-31 00:27:11 -08:00
coro-lambda.cpp
coro-newpm-pipeline.cpp [Coroutines] Add the newly generated SCCs back to the CGSCC work queue after CoroSplit actually happened 2021-06-30 11:38:14 -07:00
coro-params.cpp [NFC][Coroutines] Fix two tests by removing hardcoded SSA value. 2021-05-09 19:06:16 -07:00
coro-promise-dtor.cpp [Coroutines] Ensure co_await promise.final_suspend() does not throw 2020-06-22 15:01:42 -07:00
coro-ret-void.cpp [test] Add {{.*}} to make ELF tests immune to dso_local/dso_preemptable/(none) differences 2020-12-31 00:27:11 -08:00
coro-return-voidtype-initlist.cpp [CodeGen] Apply 'nonnull' and 'dereferenceable(N)' to 'this' pointer 2020-11-16 17:39:17 -08:00
coro-return.cpp [CodeGen] Apply 'nonnull' and 'dereferenceable(N)' to 'this' pointer 2020-11-16 17:39:17 -08:00
coro-symmetric-transfer-01.cpp Return "[CGCall] Annotate `this` argument with alignment" 2021-05-13 20:33:14 +03:00
coro-symmetric-transfer-02.cpp [test] Add {{.*}} to make ELF tests immune to dso_local/dso_preemptable/(none) differences 2020-12-31 00:27:11 -08:00
coro-unhandled-exception.cpp [Coroutine][Clang] Force emit lifetime intrinsics for Coroutines 2021-03-25 13:46:20 -07:00
microsoft-abi-operator-coawait.cpp