mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-14 07:31:47 +00:00
a1184492ba
Summary: If heap allocation of a coroutine is elided, we need to make sure that we will update an address stored in the coroutine frame from f.destroy to f.cleanup. Before this change, CoroSplit synthesized these stores after coro.begin: ``` store void (%f.Frame*)* @f.resume, void (%f.Frame*)** %resume.addr store void (%f.Frame*)* @f.destroy, void (%f.Frame*)** %destroy.addr ``` In those cases where we did heap elision, but were not able to devirtualize all indirect calls, destroy call will attempt to "free" the coroutine frame stored on the stack. Oops. Now we use select to put an appropriate coroutine subfunction in the destroy slot. As bellow: ``` store void (%f.Frame*)* @f.resume, void (%f.Frame*)** %resume.addr %0 = select i1 %need.alloc, void (%f.Frame*)* @f.destroy, void (%f.Frame*)* @f.cleanup store void (%f.Frame*)* %0, void (%f.Frame*)** %destroy.addr ``` Reviewers: majnemer Subscribers: mehdi_amini, llvm-commits Differential Revision: https://reviews.llvm.org/D25377 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283625 91177308-0d34-0410-b5e6-96231b3b80d8 |
||
---|---|---|
.. | ||
ArgAddr.ll | ||
coro-cleanup.ll | ||
coro-early.ll | ||
coro-elide.ll | ||
coro-heap-elide.ll | ||
coro-split-00.ll | ||
coro-split-01.ll | ||
coro-split-02.ll | ||
coro-split-dbg.ll | ||
ex0.ll | ||
ex1.ll | ||
ex2.ll | ||
ex3.ll | ||
ex4.ll | ||
ex5.ll | ||
no-suspend.ll | ||
phi-coro-end.ll | ||
restart-trigger.ll | ||
smoketest.ll |