[LICM] [Coroutines] Don't hoist threadlocals within presplit coroutines
authorChuanqi Xu <yedeng.yd@linux.alibaba.com>
Wed, 7 Jun 2023 02:16:19 +0000 (10:16 +0800)
committerChuanqi Xu <yedeng.yd@linux.alibaba.com>
Wed, 7 Jun 2023 02:25:47 +0000 (10:25 +0800)
commit84c033d9ba37ef51c0ca6e637ef954ed41d8c32d
tree124d12da566c767b5aba055cde5720be7e97a6e9
parentdb61927951078deeb0b4a2d8914fb9ed9924cd58
[LICM] [Coroutines] Don't hoist threadlocals within presplit coroutines

Close https://github.com/llvm/llvm-project/issues/63022

This is the following of https://reviews.llvm.org/D135550, which is
discussed in
https://discourse.llvm.org/t/rfc-unify-memory-effect-attributes/65579.
In my imagination, we could fix the issue fundamentally after we
introduces new memory kind thread id. But I am not very sure if we can
fix the issue fundamentally in time.

Besides that, I think the correctness is the most important. So it
should not be bad to land this given it is innocent.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D151774
llvm/lib/Transforms/Scalar/LICM.cpp
llvm/test/Transforms/LICM/sink-with-coroutine.ll