Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 30 Aug 2025 09:58:34 GMT
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 99ea229c697a - stable/14 - Merge commit cf721e29c6a3 from llvm git (by Amy Kwan):
Message-ID:  <202508300958.57U9wYeG011182@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/14 has been updated by dim:

URL: https://cgit.FreeBSD.org/src/commit/?id=99ea229c697a6b96c689ed6d9031527c4d229b06

commit 99ea229c697a6b96c689ed6d9031527c4d229b06
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2025-08-27 18:51:58 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2025-08-30 09:58:07 +0000

    Merge commit cf721e29c6a3 from llvm git (by Amy Kwan):
    
      [PowerPC] Do not merge TLS constants within PPCMergeStringPool.cpp (#94059)
    
      This patch prevents thread-local constants to be merged within
      PPCMergeStringPool.cpp.
    
      The PPCMergeStringPool pass primarily merges non-thread-local constants
      together, and thread-local constants should not be mixed together with
      other (non-thread-local) constants. In the event that thread-local and
      other non-thread-local constants are pooled together, the
      llvm.threadlocal.address intrinsic can fail as it expects its argument
      to be a thread-local global value, but the merged string structure
      created by the PPCMergeStringPool pass is not thread-local as a whole.
    
    This fixes an error "llvm.threadlocal.address first argument must be a
    GlobalValue" when building the math/nauty port on PowerPC architectures.
    
    PR:             289122
    Reported by:    pkubaj
    MFC after:      3 days
    
    (cherry picked from commit cb2887746f8b9dd4ad6b1e757cdc053a08b25a2e)
---
 contrib/llvm-project/llvm/lib/Target/PowerPC/PPCMergeStringPool.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCMergeStringPool.cpp b/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCMergeStringPool.cpp
index 309938accdf4..daf6a0e65d54 100644
--- a/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCMergeStringPool.cpp
+++ b/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCMergeStringPool.cpp
@@ -170,8 +170,9 @@ void PPCMergeStringPool::collectCandidateConstants(Module &M) {
     LLVM_DEBUG(dbgs() << "hasInitializer() " << Global.hasInitializer()
                       << "\n");
 
-    // We can only pool constants.
-    if (!Global.isConstant() || !Global.hasInitializer())
+    // We can only pool non-thread-local constants.
+    if (!Global.isConstant() || !Global.hasInitializer() ||
+        Global.isThreadLocal())
       continue;
 
     // If a global constant has a section we do not try to pool it because



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202508300958.57U9wYeG011182>