Wrap deallocation code with:
if (auto *mem = coro.free()) Deallocate
When backend decides to elide allocations it will replace coro.free with nullptr to suppress deallocation code.
Paths
| Differential D31590
[coroutines] Add support for deallocation elision ClosedPublic Authored by GorNishanov on Apr 2 2017, 8:34 PM. Tokens "Mountain of Wealth" token, awarded by GorNishanov.
Details
Summary Wrap deallocation code with: if (auto *mem = coro.free()) Deallocate When backend decides to elide allocations it will replace coro.free with nullptr to suppress deallocation code.
Diff Detail Event TimelineGorNishanov awarded a token. GorNishanov added a parent revision: D31586: [coroutines] Replace all coro.frame builtins with an SSA value of coro.begin. GorNishanov added a child revision: D31608: [coroutines] Add emission of initial and final suspends.Apr 3 2017, 10:38 AM This revision is now accepted and ready to land.May 22 2017, 9:46 PM
Revision Contents
Diff 93822 lib/CodeGen/CGCoroutine.cpp
test/CodeGenCoroutines/coro-alloc.cpp
|