[PATCH] D130142: [Coroutines] Introduce @llvm.coro.tls.wrapper to block optimizations

Chuanqi Xu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 20 19:17:17 PDT 2022


ChuanqiXu added a comment.

In D130142#3666355 <https://reviews.llvm.org/D130142#3666355>, @ychen wrote:

> John mentioned this test case,
>
>   thread_local int x = 0;
>   void helper(int *x, int y);
>   my_coro coroutine() {
>     helper(&x, co_await something_suspending());
>   }
>
> Is replacing the TLS variable with `llvm.coro.tls.wrapper` in CoroEarly too late to fix the issue?

This example may be fine since C++ standard specifies that the order of evaluation of function arguments is unspecified: https://en.cppreference.com/w/cpp/language/eval_order.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130142/new/

https://reviews.llvm.org/D130142



More information about the llvm-commits mailing list