]> granicus.if.org Git - llvm/commit
[coroutines] Add support for symmetric control transfer (musttail on coro.resumes...
authorGor Nishanov <GorNishanov@gmail.com>
Fri, 25 Aug 2017 02:25:10 +0000 (02:25 +0000)
committerGor Nishanov <GorNishanov@gmail.com>
Fri, 25 Aug 2017 02:25:10 +0000 (02:25 +0000)
commit8970bfadd272fc5e24a444f6fa0024a30e5764f1
tree08a60f4ab3e498aeb3dc2685ac6691d1c8ef19d5
parent5872ccc6286ae0b345e2a6965e7ecde1b6cd8a4d
[coroutines] Add support for symmetric control transfer (musttail on coro.resumes followed by a suspend)

Summary:
Add musttail to any resume instructions that is immediately followed by a
suspend (i.e. ret). We do this even in -O0 to support guaranteed tail call
for symmetrical coroutine control transfer (C++ Coroutines TS extension).
This transformation is done only in the resume part of the coroutine that has
identical signature and calling convention as the coro.resume call.

Reviewers: GorNishanov

Reviewed By: GorNishanov

Subscribers: EricWF, majnemer, llvm-commits

Differential Revision: https://reviews.llvm.org/D37125

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311751 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Coroutines/CoroSplit.cpp
test/Transforms/Coroutines/coro-split-musttail.ll [new file with mode: 0644]