[PATCH] D125291: Introduce @llvm.threadlocal.address intrinsic to access TLS variable (1/3)

Chuanqi Xu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 9 23:41:30 PDT 2022


ChuanqiXu created this revision.
Herald added subscribers: ormris, wenlei, jdoerfert, steven_wu, hiraditya, mgorny.
Herald added a project: All.
ChuanqiXu requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This belongs to a series of patches which try to solve the thread identification problem in coroutines. See https://discourse.llvm.org/t/address-thread-identification-problems-with-coroutine/62015 for a full background.

The problem consists of two concrete problems: TLS variable and readnone functions. This patch tries to convert the TLS problem to readnone problem by converting the access of TLS variable  to an intrinsic which is marked as readnone.

The readnone problem would be addressed in following patches.


https://reviews.llvm.org/D125291

Files:
  clang/lib/CodeGen/CGExpr.cpp
  clang/lib/CodeGen/ItaniumCXXABI.cpp
  clang/test/CodeGen/lto-newpm-pipeline.c
  clang/test/CodeGenCXX/threadlocal_address.cpp
  llvm/docs/LangRef.rst
  llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
  llvm/include/llvm/IR/IRBuilder.h
  llvm/include/llvm/IR/Intrinsics.td
  llvm/include/llvm/Transforms/Scalar/LowerThreadLocalIntrinsic.h
  llvm/lib/IR/IRBuilder.cpp
  llvm/lib/Passes/PassBuilder.cpp
  llvm/lib/Passes/PassBuilderPipelines.cpp
  llvm/lib/Passes/PassRegistry.def
  llvm/lib/Transforms/Scalar/CMakeLists.txt
  llvm/lib/Transforms/Scalar/LowerThreadLocalIntrinsic.cpp
  llvm/test/Other/new-pm-O0-defaults.ll
  llvm/test/Other/new-pm-defaults.ll
  llvm/test/Other/new-pm-thinlto-defaults.ll
  llvm/test/Other/new-pm-thinlto-postlink-pgo-defaults.ll
  llvm/test/Other/new-pm-thinlto-postlink-samplepgo-defaults.ll
  llvm/test/Transforms/LowerThreadLocalIntrinsic/basic.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D125291.428297.patch
Type: text/x-patch
Size: 17159 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220510/b402aeb2/attachment-0001.bin>


More information about the llvm-commits mailing list