[Coroutines] Do not add allocas for retcon coroutines
authorSebastian Neubauer <Sebastian.Neubauer@amd.com>
Mon, 14 Nov 2022 09:46:46 +0000 (10:46 +0100)
committerSebastian Neubauer <Sebastian.Neubauer@amd.com>
Mon, 14 Nov 2022 09:46:46 +0000 (10:46 +0100)
commitce879a03c9798aac0c3f246a250241087fb49e5c
treeed0170957ef4ec1fb7d420115ee18340ee51a44a
parent0387679e3ea2adfa12098a0ba1817180e56c4555
[Coroutines] Do not add allocas for retcon coroutines

Same as for async-style lowering, if there are no resume points in a
function, the coroutine frame pointer will be replaced by an undef,
making all accesses to the frame undefinde behavior.

Fix this by not adding allocas to the coroutine frame if there are no
resume points.

Differential Revision: https://reviews.llvm.org/D137866
llvm/lib/Transforms/Coroutines/CoroFrame.cpp
llvm/test/Transforms/Coroutines/coro-retcon.ll