it will get the following error:
When callee coroutine function is inlined into caller coroutine function before coro-split pass, llvm will emits "coroutine should have exactly one defining @llvm.coro.begin"
with the following situation:. It seems that coro-early pass can not handle this quiet well.
there are two coroutine functions named A and B, and B is called by A
If there is the chance inline B to A before LLVM called CoroSplit pass, it will get this error.
After checking the LLVM code, we found there are 3 situations to triggle this error:
1. mark B as always inline under O0 levelSo we believe that unsplited coroutine function should not be inlined.
2. mark B as always inline and enable new pm under O0 levelThis patch fix such issue by not inlining function if it has attribute "coroutine.presplit" (it means the function has not been splited) to fix this issue
3. mark B as always inline and set valid sample profile
So we think it will be better disable inline coroutine function before llvm called CoroSplit Pass.test plan: check-all