[PATCH] D125291: Introduce @llvm.threadlocal.address intrinsic to access TLS variable

Yuanfang Chen via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 14 17:43:44 PDT 2022


ychen added inline comments.


================
Comment at: llvm/docs/LangRef.rst:24541
+
+      declare ptr @llvm.threadlocal.address(ptr) nounwind readnone willreturn
+
----------------
Like @jyknight already did, any idea what it would take to change the parameter type from pointer to token? Looking at the test changes, it looks like OpenMP is impacted a lot. I suggest splitting this patch into Clang and LLVM parts to gain insights from the frontend experts.


================
Comment at: llvm/lib/IR/IRBuilder.cpp:533
+  if (!isa<GlobalValue>(Ptr) || !cast<GlobalValue>(Ptr)->isThreadLocal()) {
+    llvm::outs() << "Non Global Value wanted.\n";
+    Ptr->dump();
----------------
Here and below `llvm::outs()` are for debugging and should be removed?


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

https://reviews.llvm.org/D125291



More information about the cfe-commits mailing list