OSDN Git Service

[Coroutines] Don't move stores for allocator args
authorBrian Gesiak <modocache@gmail.com>
Thu, 15 Feb 2018 19:31:45 +0000 (19:31 +0000)
committerBrian Gesiak <modocache@gmail.com>
Thu, 15 Feb 2018 19:31:45 +0000 (19:31 +0000)
commitadf9928ba42a0a6341d09b99c1ba973b60c7411b
tree7395df19571a3ce26d0339613322a33445ca1847
parentb093e4e65125c255ebf2f90a74df3755a852e1f9
[Coroutines] Don't move stores for allocator args

Summary:
The behavior described in Coroutines TS `[dcl.fct.def.coroutine]/7`
allows coroutine parameters to be passed into allocator functions.
The instructions to store values into the alloca'd parameters must not
be moved past the frame allocation, otherwise uninitialized values are
passed to the allocator.

Test Plan: `check-llvm`

Reviewers: rsmith, GorNishanov, eric_niebler

Reviewed By: GorNishanov

Subscribers: compnerd, EricWF, llvm-commits

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

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