An alloca that escaped, might be accessed after resume via code external to the coroutine.
Therefore even if we do not see a use of an alloca after resume in the coroutine body,
we still need to place it into the coroutine frame.
In the follwoing example, %sneaky needs to go into the coroutine frame.
%sneaky = alloca i32 ... %hideit = ptrtoint i32* %sneaky to i64 call void @escape(i64 %hideit) ... %tok = call i8 @llvm.coro.suspend(token none, i1 false) ... not used after suspend ...
Does this mean that passing the address of any allocad memory to a function call will cause it to be spilled even if its lifetime does not extend past a suspension point?
I'm thinking of cases where we have:
Am I correct in understanding that with the proposed logic that x would be spilled to the frame even thought its lifetime does not cross a suspension-point? Can we avoid that?
Should we be checking for llvm.lifetime.start / llvm.lifetime.end intrinsics and if found only considering the result of allocaEscapes(&I) if the lifetime start/end span contains a suspension point?