OSDN Git Service

[Coroutines] Part12: Handle alloca address-taken
authorGor Nishanov <GorNishanov@gmail.com>
Mon, 5 Sep 2016 23:45:45 +0000 (23:45 +0000)
committerGor Nishanov <GorNishanov@gmail.com>
Mon, 5 Sep 2016 23:45:45 +0000 (23:45 +0000)
commit5b6d16cd6c113d2d16b102c77eaf4e30f7db3b1a
tree2b18004bdcdd2181f546a71904f4a4deb66d4839
parent47e6904fe1bba337709bfa57fc3d57376bb27cb8
[Coroutines] Part12: Handle alloca address-taken

Summary:
Move early uses of spilled variables after CoroBegin.

For example, if a parameter had address taken, we may end up with the code
like:
        define @f(i32 %n) {
          %n.addr = alloca i32
          store %n, %n.addr
          ...
          call @coro.begin

This patch fixes the problem by moving uses of spilled variables after CoroBegin.

Reviewers: majnemer

Subscribers: mehdi_amini, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280678 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Coroutines/CoroFrame.cpp
test/Transforms/Coroutines/ArgAddr.ll [new file with mode: 0644]