[PATCH] D122383: [Coroutines] [Retcon] Replace CoroBegin with FramePtr after

John McCall via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 29 21:36:48 PDT 2022


rjmccall added a comment.

It seems very likely to me that you could contrive a situation under C++ coroutines where the frame pointer is a parameter to the ramp function by the time you run coro splitting, at least under optimization.  For example, https://godbolt.org/z/cGnjTbzrY, which is a reasonable implementation if you need to guarantee non-allocation and intend to assert that the size fits in the buffer.  This isn't an oddity of retcon lowering, it's a general problem that emerges from the special way that the frame pointer value is assumed to be live throughout the function, which requires it to be protected against this undef'ing of arguments which would otherwise be reasonable.

Thinking about it further, you'll probably have to introduce an intermediate value to do that protection, since the cloner will not be happy if you don't map all the arguments.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D122383/new/

https://reviews.llvm.org/D122383



More information about the llvm-commits mailing list