Currently we move all allocas into the frame when build coroutine frame in CoroSplit pass. However, this can be relaxed.
Since CoroSplit pass run after Inline pass, we can use lifetime intrinsic to do such analysis: If the scope of lifetime intrinsic is
not across any suspend point, rather than move the allocas to frame, we can just move them to entry bb of corresponding function. This reduce the frame size.
More importantly, this also avoid data race in multithread environment. Consider one inline function by coroutine: it starts a thread which access local variables, while after inline the movement of allocs to frame also access them. cause data race.
TestPlan: check-llvm, cppcoro
Nit-pick: I think the LLVM coding style would have you remove these for loop braces. There's only a single statement in the for loop, the if statement above, so you technically don't need these here.