[clang] [Clang] Access tls_guard via llvm.threadlocal.address (PR #96633)

2024-07-08 Thread John McCall via cfe-commits
https://github.com/rjmccall edited https://github.com/llvm/llvm-project/pull/96633 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Access tls_guard via llvm.threadlocal.address (PR #96633)

2024-07-08 Thread John McCall via cfe-commits
https://github.com/rjmccall edited https://github.com/llvm/llvm-project/pull/96633 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Access tls_guard via llvm.threadlocal.address (PR #96633)

2024-07-08 Thread John McCall via cfe-commits
https://github.com/rjmccall edited https://github.com/llvm/llvm-project/pull/96633 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Access tls_guard via llvm.threadlocal.address (PR #96633)

2024-07-08 Thread John McCall via cfe-commits
@@ -1070,13 +1084,20 @@ CodeGenFunction::GenerateCXXGlobalInitFunc(llvm::Function *Fn, // Mark as initialized before initializing anything else. If the // initializers use previously-initialized thread_local vars, that's // probably supposed to be OK, but the

[clang] [Clang] Access tls_guard via llvm.threadlocal.address (PR #96633)

2024-07-08 Thread via cfe-commits
@@ -1070,13 +1084,20 @@ CodeGenFunction::GenerateCXXGlobalInitFunc(llvm::Function *Fn, // Mark as initialized before initializing anything else. If the // initializers use previously-initialized thread_local vars, that's // probably supposed to be OK, but the

[clang] [Clang] Access tls_guard via llvm.threadlocal.address (PR #96633)

2024-07-05 Thread John McCall via cfe-commits
https://github.com/rjmccall edited https://github.com/llvm/llvm-project/pull/96633 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Access tls_guard via llvm.threadlocal.address (PR #96633)

2024-07-05 Thread John McCall via cfe-commits
https://github.com/rjmccall edited https://github.com/llvm/llvm-project/pull/96633 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Access tls_guard via llvm.threadlocal.address (PR #96633)

2024-07-05 Thread John McCall via cfe-commits
@@ -1070,13 +1084,20 @@ CodeGenFunction::GenerateCXXGlobalInitFunc(llvm::Function *Fn, // Mark as initialized before initializing anything else. If the // initializers use previously-initialized thread_local vars, that's // probably supposed to be OK, but the

[clang] [Clang] Access tls_guard via llvm.threadlocal.address (PR #96633)

2024-07-05 Thread via cfe-commits
@@ -1070,13 +1084,20 @@ CodeGenFunction::GenerateCXXGlobalInitFunc(llvm::Function *Fn, // Mark as initialized before initializing anything else. If the // initializers use previously-initialized thread_local vars, that's // probably supposed to be OK, but the

[clang] [Clang] Access tls_guard via llvm.threadlocal.address (PR #96633)

2024-07-05 Thread John McCall via cfe-commits
@@ -1070,13 +1084,20 @@ CodeGenFunction::GenerateCXXGlobalInitFunc(llvm::Function *Fn, // Mark as initialized before initializing anything else. If the // initializers use previously-initialized thread_local vars, that's // probably supposed to be OK, but the

[clang] [Clang] Access tls_guard via llvm.threadlocal.address (PR #96633)

2024-07-04 Thread via cfe-commits
@@ -1070,13 +1084,20 @@ CodeGenFunction::GenerateCXXGlobalInitFunc(llvm::Function *Fn, // Mark as initialized before initializing anything else. If the // initializers use previously-initialized thread_local vars, that's // probably supposed to be OK, but the

[clang] [Clang] Access tls_guard via llvm.threadlocal.address (PR #96633)

2024-07-03 Thread John McCall via cfe-commits
@@ -2933,7 +2933,8 @@ void ItaniumCXXABI::EmitThreadLocalInitFuncs( Guard->setAlignment(GuardAlign.getAsAlign()); CodeGenFunction(CGM).GenerateCXXGlobalInitFunc( -InitFunc, OrderedInits, ConstantAddress(Guard, CGM.Int8Ty, GuardAlign)); +InitFunc, Order

[clang] [Clang] Access tls_guard via llvm.threadlocal.address (PR #96633)

2024-07-03 Thread John McCall via cfe-commits
@@ -1070,13 +1084,20 @@ CodeGenFunction::GenerateCXXGlobalInitFunc(llvm::Function *Fn, // Mark as initialized before initializing anything else. If the // initializers use previously-initialized thread_local vars, that's // probably supposed to be OK, but the

[clang] [Clang] Access tls_guard via llvm.threadlocal.address (PR #96633)

2024-07-03 Thread John McCall via cfe-commits
@@ -769,9 +777,10 @@ void CodeGenModule::EmitCXXModuleInitFunc(Module *Primary) { CharUnits GuardAlign = CharUnits::One(); Guard->setAlignment(GuardAlign.getAsAlign()); GuardAddr = ConstantAddress(Guard, Int8Ty, GuardAlign); + IsTLS = Guard->isThreadLoca

[clang] [Clang] Access tls_guard via llvm.threadlocal.address (PR #96633)

2024-07-03 Thread John McCall via cfe-commits
@@ -769,9 +777,10 @@ void CodeGenModule::EmitCXXModuleInitFunc(Module *Primary) { CharUnits GuardAlign = CharUnits::One(); Guard->setAlignment(GuardAlign.getAsAlign()); GuardAddr = ConstantAddress(Guard, Int8Ty, GuardAlign); + IsTLS = Guard->isThreadLoca

[clang] [Clang] Access tls_guard via llvm.threadlocal.address (PR #96633)

2024-07-03 Thread via cfe-commits
https://github.com/nikola-tesic-ns edited https://github.com/llvm/llvm-project/pull/96633 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Access tls_guard via llvm.threadlocal.address (PR #96633)

2024-07-03 Thread via cfe-commits
@@ -1059,9 +1059,15 @@ CodeGenFunction::GenerateCXXGlobalInitFunc(llvm::Function *Fn, if (Guard.isValid()) { // If we have a guard variable, check whether we've already performed // these initializations. This happens for TLS initialization functions. - ll

[clang] [Clang] Access tls_guard via llvm.threadlocal.address (PR #96633)

2024-07-03 Thread via cfe-commits
@@ -1059,9 +1059,15 @@ CodeGenFunction::GenerateCXXGlobalInitFunc(llvm::Function *Fn, if (Guard.isValid()) { // If we have a guard variable, check whether we've already performed // these initializations. This happens for TLS initialization functions. - ll

[clang] [Clang] Access tls_guard via llvm.threadlocal.address (PR #96633)

2024-07-03 Thread via cfe-commits
https://github.com/nikola-tesic-ns updated https://github.com/llvm/llvm-project/pull/96633 >From 41427a3de345517025477257bfd4f614f06cbcfe Mon Sep 17 00:00:00 2001 From: Nikola Tesic Date: Tue, 25 Jun 2024 15:58:18 +0300 Subject: [PATCH 1/3] [Clang] Access tls_guard via llvm.threadlocal.address

[clang] [Clang] Access tls_guard via llvm.threadlocal.address (PR #96633)

2024-06-27 Thread John McCall via cfe-commits
@@ -1059,9 +1059,15 @@ CodeGenFunction::GenerateCXXGlobalInitFunc(llvm::Function *Fn, if (Guard.isValid()) { // If we have a guard variable, check whether we've already performed // these initializations. This happens for TLS initialization functions. - ll

[clang] [Clang] Access tls_guard via llvm.threadlocal.address (PR #96633)

2024-06-27 Thread via cfe-commits
@@ -1070,13 +1076,26 @@ CodeGenFunction::GenerateCXXGlobalInitFunc(llvm::Function *Fn, // Mark as initialized before initializing anything else. If the // initializers use previously-initialized thread_local vars, that's // probably supposed to be OK, but the

[clang] [Clang] Access tls_guard via llvm.threadlocal.address (PR #96633)

2024-06-27 Thread Chuanqi Xu via cfe-commits
@@ -1070,13 +1076,26 @@ CodeGenFunction::GenerateCXXGlobalInitFunc(llvm::Function *Fn, // Mark as initialized before initializing anything else. If the // initializers use previously-initialized thread_local vars, that's // probably supposed to be OK, but the

[clang] [Clang] Access tls_guard via llvm.threadlocal.address (PR #96633)

2024-06-27 Thread Chuanqi Xu via cfe-commits
@@ -1059,9 +1059,15 @@ CodeGenFunction::GenerateCXXGlobalInitFunc(llvm::Function *Fn, if (Guard.isValid()) { // If we have a guard variable, check whether we've already performed // these initializations. This happens for TLS initialization functions. - ll

[clang] [Clang] Access tls_guard via llvm.threadlocal.address (PR #96633)

2024-06-27 Thread via cfe-commits
@@ -1059,9 +1059,15 @@ CodeGenFunction::GenerateCXXGlobalInitFunc(llvm::Function *Fn, if (Guard.isValid()) { // If we have a guard variable, check whether we've already performed // these initializations. This happens for TLS initialization functions. - ll

[clang] [Clang] Access tls_guard via llvm.threadlocal.address (PR #96633)

2024-06-27 Thread via cfe-commits
@@ -1070,13 +1076,26 @@ CodeGenFunction::GenerateCXXGlobalInitFunc(llvm::Function *Fn, // Mark as initialized before initializing anything else. If the // initializers use previously-initialized thread_local vars, that's // probably supposed to be OK, but the

[clang] [Clang] Access tls_guard via llvm.threadlocal.address (PR #96633)

2024-06-27 Thread via cfe-commits
@@ -1059,9 +1059,15 @@ CodeGenFunction::GenerateCXXGlobalInitFunc(llvm::Function *Fn, if (Guard.isValid()) { // If we have a guard variable, check whether we've already performed // these initializations. This happens for TLS initialization functions. - ll

[clang] [Clang] Access tls_guard via llvm.threadlocal.address (PR #96633)

2024-06-26 Thread John McCall via cfe-commits
@@ -1059,9 +1059,15 @@ CodeGenFunction::GenerateCXXGlobalInitFunc(llvm::Function *Fn, if (Guard.isValid()) { // If we have a guard variable, check whether we've already performed // these initializations. This happens for TLS initialization functions. - ll

[clang] [Clang] Access tls_guard via llvm.threadlocal.address (PR #96633)

2024-06-26 Thread Chuanqi Xu via cfe-commits
@@ -1059,9 +1059,15 @@ CodeGenFunction::GenerateCXXGlobalInitFunc(llvm::Function *Fn, if (Guard.isValid()) { // If we have a guard variable, check whether we've already performed // these initializations. This happens for TLS initialization functions. - ll

[clang] [Clang] Access tls_guard via llvm.threadlocal.address (PR #96633)

2024-06-26 Thread Chuanqi Xu via cfe-commits
@@ -1070,13 +1076,26 @@ CodeGenFunction::GenerateCXXGlobalInitFunc(llvm::Function *Fn, // Mark as initialized before initializing anything else. If the // initializers use previously-initialized thread_local vars, that's // probably supposed to be OK, but the

[clang] [Clang] Access tls_guard via llvm.threadlocal.address (PR #96633)

2024-06-26 Thread Chuanqi Xu via cfe-commits
@@ -1059,9 +1059,15 @@ CodeGenFunction::GenerateCXXGlobalInitFunc(llvm::Function *Fn, if (Guard.isValid()) { // If we have a guard variable, check whether we've already performed // these initializations. This happens for TLS initialization functions. - ll

[clang] [Clang] Access tls_guard via llvm.threadlocal.address (PR #96633)

2024-06-26 Thread Chuanqi Xu via cfe-commits
@@ -1070,13 +1076,26 @@ CodeGenFunction::GenerateCXXGlobalInitFunc(llvm::Function *Fn, // Mark as initialized before initializing anything else. If the // initializers use previously-initialized thread_local vars, that's // probably supposed to be OK, but the

[clang] [Clang] Access tls_guard via llvm.threadlocal.address (PR #96633)

2024-06-26 Thread Chuanqi Xu via cfe-commits
@@ -1059,9 +1059,15 @@ CodeGenFunction::GenerateCXXGlobalInitFunc(llvm::Function *Fn, if (Guard.isValid()) { // If we have a guard variable, check whether we've already performed // these initializations. This happens for TLS initialization functions. - ll

[clang] [Clang] Access tls_guard via llvm.threadlocal.address (PR #96633)

2024-06-26 Thread via cfe-commits
@@ -1059,9 +1059,10 @@ CodeGenFunction::GenerateCXXGlobalInitFunc(llvm::Function *Fn, if (Guard.isValid()) { // If we have a guard variable, check whether we've already performed // these initializations. This happens for TLS initialization functions. - ll

[clang] [Clang] Access tls_guard via llvm.threadlocal.address (PR #96633)

2024-06-26 Thread via cfe-commits
https://github.com/nikola-tesic-ns updated https://github.com/llvm/llvm-project/pull/96633 >From 41427a3de345517025477257bfd4f614f06cbcfe Mon Sep 17 00:00:00 2001 From: Nikola Tesic Date: Tue, 25 Jun 2024 15:58:18 +0300 Subject: [PATCH 1/2] [Clang] Access tls_guard via llvm.threadlocal.address

[clang] [Clang] Access tls_guard via llvm.threadlocal.address (PR #96633)

2024-06-25 Thread Chuanqi Xu via cfe-commits
@@ -1059,9 +1059,10 @@ CodeGenFunction::GenerateCXXGlobalInitFunc(llvm::Function *Fn, if (Guard.isValid()) { // If we have a guard variable, check whether we've already performed // these initializations. This happens for TLS initialization functions. - ll

[clang] [Clang] Access tls_guard via llvm.threadlocal.address (PR #96633)

2024-06-25 Thread via cfe-commits
nikola-tesic-ns wrote: @nikic @ChuanqiXu9 I couldn't add you to the reviewers list. Please, take a look at this fix. Thanks! https://github.com/llvm/llvm-project/pull/96633 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.or

[clang] [Clang] Access tls_guard via llvm.threadlocal.address (PR #96633)

2024-06-25 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang @llvm/pr-subscribers-clang-codegen Author: None (nikola-tesic-ns) Changes This patch fixes compiler generated code in `tls_init` function to access TLS variable (`tls_guard`) via llvm.threadlocal.address intrinsic. Related discussion: https://dis

[clang] [Clang] Access tls_guard via llvm.threadlocal.address (PR #96633)

2024-06-25 Thread via cfe-commits
github-actions[bot] wrote: Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it

[clang] [Clang] Access tls_guard via llvm.threadlocal.address (PR #96633)

2024-06-25 Thread via cfe-commits
https://github.com/nikola-tesic-ns created https://github.com/llvm/llvm-project/pull/96633 This patch fixes compiler generated code in `tls_init` function to access TLS variable (`tls_guard`) via llvm.threadlocal.address intrinsic. Related discussion: https://discourse.llvm.org/t/address-threa