Go to file
Gor Nishanov dce9b02677 [Coroutines] Part 9: Add cleanup subfunction.
Summary:
[Coroutines] Part 9: Add cleanup subfunction.

This patch completes coroutine heap allocation elision. Now, the heap elision example from docs\Coroutines.rst compiles and produces expected result (see test/Transform/Coroutines/ex3.ll)

Intrinsic Changes:
* coro.free gets a token parameter tying it to coro.id to allow reliably discovering all coro.frees associated with a particular coroutine.
* coro.id gets an extra parameter that points back to a coroutine function. This allows to check whether a coro.id describes the enclosing function or it belongs to a different function that was later inlined.

CoroSplit now creates three subfunctions:
# f$resume - resume logic
# f$destroy - cleanup logic, followed by a deallocation code
# f$cleanup - just the cleanup code

CoroElide pass during devirtualization replaces coro.destroy with either f$destroy or f$cleanup depending whether heap elision is performed or not.

Other fixes, improvements:
* Fixed buglet in Shape::buildFrame that was not creating coro.save properly if coroutine has more than one suspend point.

* Switched to using variable width suspend index field (no longer limited to 32 bit index field can be as little as i1 or as large as i<whatever-size_t-is>)

Reviewers: majnemer

Subscribers: llvm-commits, mehdi_amini

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

llvm-svn: 279971
2016-08-29 14:34:12 +00:00
clang [Coverage] Prevent creating a redundant counter if a nested body ends with a macro. 2016-08-29 11:48:50 +00:00
clang-tools-extra Fix some typos in the doc 2016-08-28 20:33:42 +00:00
compiler-rt Revert "Start reifying error descriptions. Second try: Try to appease Visual Studio." 2016-08-28 10:42:21 +00:00
debuginfo-tests New round of fixes for "Always compile debuginfo-tests for the host triple" 2014-10-18 23:47:59 +00:00
libclc amdgcn: Fix return type of get_num_groups 2016-08-25 07:31:40 +00:00
libcxx Fix pair::operator=(TupleLike&&). 2016-08-29 01:43:41 +00:00
libcxxabi [CMake] Be more consistent about naming targets and components in libc++abi 2016-08-28 18:28:51 +00:00
libunwind EHABI: fail on WMMX vops without WMMX support 2016-08-28 20:10:33 +00:00
lld Implement support for --build-id=uuid switch 2016-08-26 09:55:37 +00:00
lldb Fix some build bot breakages. 2016-08-27 16:38:11 +00:00
llgo [llgo] add llgo source path to LLVM_GO_PACKAGES 2016-07-27 03:01:00 +00:00
llvm [Coroutines] Part 9: Add cleanup subfunction. 2016-08-29 14:34:12 +00:00
openmp cleanup: fixed names of dummy arguments of Fortran interfaces declarations, no functional changes done 2016-08-17 18:18:21 +00:00
parallel-libs [StreamExecutor] Fix KernelSpec Doxygen 2016-08-26 19:55:32 +00:00
polly Add space between access string and follow-up. 2016-08-26 15:43:52 +00:00