forked from OSchip/llvm-project
822b92aae4
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 |
||
---|---|---|
.. | ||
Inputs | ||
coro-alloc.cpp | ||
coro-always-inline.cpp | ||
coro-await-domination.cpp | ||
coro-await-resume-eh.cpp | ||
coro-await.cpp | ||
coro-builtins-err.c | ||
coro-builtins.c | ||
coro-cleanup.cpp | ||
coro-dest-slot.cpp | ||
coro-dwarf.cpp | ||
coro-eh-cleanup.cpp | ||
coro-gro-nrvo.cpp | ||
coro-gro.cpp | ||
coro-lambda.cpp | ||
coro-newpm-pipeline.cpp | ||
coro-params.cpp | ||
coro-promise-dtor.cpp | ||
coro-ret-void.cpp | ||
coro-return-voidtype-initlist.cpp | ||
coro-return.cpp | ||
coro-symmetric-transfer-01.cpp | ||
coro-symmetric-transfer-02.cpp | ||
coro-unhandled-exception.cpp | ||
microsoft-abi-operator-coawait.cpp |