llvm-project/llvm
Gor Nishanov df3d71a7a9 [coroutines] Spill the result of the invoke instruction correctly
Summary:
When we decide that the result of the invoke instruction need to be spilled, we need to insert the spill into a block that is on the normal edge coming out of the invoke instruction. (Prior to this change the code would insert the spill immediately after the invoke instruction, which breaks the IR, since invoke is a terminator instruction).

In the following example, we will split the edge going into %cont and insert the spill there.

```
  %r = invoke double @print(double 0.0) to label %cont unwind label %pad

  cont:
    %0 = call i8 @llvm.coro.suspend(token none, i1 false)
    switch i8 %0, label %suspend [i8 0, label %resume
                                  i8 1, label %cleanup]
  resume:
    call double @print(double %r)
```

Reviewers: majnemer

Reviewed By: majnemer

Subscribers: mehdi_amini, llvm-commits, EricWF

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

llvm-svn: 293006
2017-01-25 02:25:54 +00:00
..
bindings Fix go bindings after r289702 (hopefully, don't really know how to build 2016-12-15 06:54:29 +00:00
cmake cmake: Only sanitize use-after-scope if the host compiler supports it 2017-01-18 19:01:58 +00:00
docs Revert "r292904 - [lit] Allow boolean expressions in REQUIRES and XFAIL 2017-01-24 16:17:04 +00:00
examples BrainF example: fixing output buffering issue 2017-01-17 13:27:28 +00:00
include AMDGPU add support for spilling to a user sgpr pointed buffers 2017-01-25 01:25:13 +00:00
lib [coroutines] Spill the result of the invoke instruction correctly 2017-01-25 02:25:54 +00:00
projects
resources
runtimes [CMake] Handle common options for runtimes build 2017-01-10 19:47:05 +00:00
test [coroutines] Spill the result of the invoke instruction correctly 2017-01-25 02:25:54 +00:00
tools Add support for the x86_thread_state32_t and 2017-01-23 21:13:29 +00:00
unittests [PM] Introduce a PoisoningVH as a (more expensive) alternative to 2017-01-24 12:34:47 +00:00
utils Revert "r292904 - [lit] Allow boolean expressions in REQUIRES and XFAIL 2017-01-24 16:17:04 +00:00
.arcconfig
.clang-format
.clang-tidy
.gitignore [AVR] Add the integrated testing tool to the .gitignore 2016-12-14 11:47:14 +00:00
CMakeLists.txt Bump trunk version to 5.0.0svn 2017-01-12 21:22:36 +00:00
CODE_OWNERS.TXT
CREDITS.TXT Revert revision 289721. 2016-12-14 21:58:42 +00:00
LICENSE.TXT Bump year to 2017 in LICENSE.txt 2017-01-12 18:02:42 +00:00
LLVMBuild.txt
README.txt
RELEASE_TESTERS.TXT Update the release tester for MIPS. NFC. 2017-01-17 11:00:28 +00:00
configure
llvm.spec.in

README.txt

Low Level Virtual Machine (LLVM)
================================

This directory and its subdirectories contain source code for LLVM,
a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the documentation provided in docs/ for further
assistance with LLVM, and in particular docs/GettingStarted.rst for getting
started with LLVM and docs/README.txt for an overview of LLVM's
documentation setup.

If you are writing a package for LLVM, see docs/Packaging.rst for our
suggestions.