[Coroutines] Allow FramePtr to be an Argument
authorNikita Popov <npopov@redhat.com>
Fri, 4 Mar 2022 14:09:57 +0000 (15:09 +0100)
committerNikita Popov <npopov@redhat.com>
Mon, 7 Mar 2022 09:58:56 +0000 (10:58 +0100)
commit9bca4ea364dd6fd31ad1ca827631760c21ffd93f
treeb1d03b2e31e700d167fbabc59ad7955d7dc90804
parentb45888e959ad2d6562b8d321166e6387facdd412
[Coroutines] Allow FramePtr to be an Argument

With opaque pointers, after splitRetconCoroutine() the FramePtr
may be an Argument rather than an Instruction. With typed pointers,
this currently doesn't happen because the FramePtr would be a
bitcast instruction.

Fix this by making FramePtr a Value and adding a helper for the
"after FramePtr" insertion point, which would be the start of the
function in the Argument case.

Differential Revision: https://reviews.llvm.org/D120994
llvm/lib/Transforms/Coroutines/CoroFrame.cpp
llvm/lib/Transforms/Coroutines/CoroInternal.h
llvm/lib/Transforms/Coroutines/CoroSplit.cpp
llvm/test/Transforms/Coroutines/coro-retcon-opaque-ptr.ll [new file with mode: 0644]