HomePhabricator

CoroSplit: Fix coroutine splitting for retcon and retcon.once

Authored by aschwaighofer on Jun 2 2020, 7:19 AM.

Description

CoroSplit: Fix coroutine splitting for retcon and retcon.once

Summary:
For retcon and retcon.once coroutines we assume that all uses of spills
can be sunk past coro.begin. This simplifies handling of instructions
that escape the address of an alloca.

The current implementation would have issues if the address of the
alloca is escaped before coro.begin. (It also has issues with casts before and
uses of those casts after the coro.begin instruction)

%alloca_addr = alloca ...
%escape  = ptrtoint %alloca_addr
coro.begin
store %escape to %alloca_addr

rdar://60272809

Subscribers: hiraditya, modocache, mgrang, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D81023

Details