[PATCH] D37112: [coroutines] Always place escaped allocas into the coroutine frame
Gor Nishanov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 24 08:56:54 PDT 2017
GorNishanov created this revision.
Herald added subscribers: EricWF, qcolombet.
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 ...
https://reviews.llvm.org/D37112
Files:
lib/Transforms/Coroutines/CoroFrame.cpp
test/Transforms/Coroutines/coro-spill-escape.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D37112.112570.patch
Type: text/x-patch
Size: 4764 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170824/2a502d6c/attachment.bin>
More information about the llvm-commits
mailing list