diff options
author | Jun Ma <JunMa@linux.alibaba.com> | 2020-03-10 18:32:55 +0800 |
---|---|---|
committer | Jun Ma <JunMa@linux.alibaba.com> | 2020-03-24 13:41:55 +0800 |
commit | a44de12ab2193c14b6f0ff8cbea8f276cbf10159 (patch) | |
tree | c93b1ff7a45b8018cbb9fc44f91f76f7dd48b1ed /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | d0f4af8f3088f72df7fea9983127cbeeebbef6a1 (diff) | |
download | llvm-a44de12ab2193c14b6f0ff8cbea8f276cbf10159.zip llvm-a44de12ab2193c14b6f0ff8cbea8f276cbf10159.tar.gz llvm-a44de12ab2193c14b6f0ff8cbea8f276cbf10159.tar.bz2 |
[Coroutines] Also check lifetime intrinsic for local variable when build
coroutine frame
Currently we move all allocas into the frame when build coroutine frame in
CoroSplit pass. However, this can be relaxed.
Since CoroSplit pass run after Inline pass, we can use lifetime intrinsic to
do such analysis: If the scope of lifetime intrinsic is not across any suspend
point, rather than move the allocas to frame, we can just move them to entry bb
of corresponding function. This reduce the frame size.
More importantly, this also avoid data race in multithread environment.
Consider one inline function by coroutine: it starts a thread which access
local variables, while after inline the movement of allocs to frame also access
them. cause data race.
Differential Revision: https://reviews.llvm.org/D75664
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions