[llvm] [PowerPC] Do not merge TLS constants within PPCMergeStringPool.cpp (PR #94059)
Amy Kwan via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 12 06:50:42 PDT 2024
================
@@ -0,0 +1,260 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
+; RUN: llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff -mcpu=pwr8 \
+; RUN: -ppc-asm-full-reg-names < %s | FileCheck %s \
+; RUN: --check-prefix=CHECK64
+; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff -mcpu=pwr8 \
+; RUN: -ppc-asm-full-reg-names < %s | FileCheck %s \
+; RUN: --check-prefix=CHECK32
+; RUN: llc -verify-machineinstrs -mtriple powerpc64le-unknown-linux -mcpu=pwr8 \
+; RUN: -ppc-asm-full-reg-names < %s | FileCheck %s \
+; RUN: --check-prefix=LINUX64LE
+; RUN: llc -verify-machineinstrs -mtriple powerpc64-unknown-linux -mcpu=pwr8 \
+; RUN: -ppc-asm-full-reg-names < %s | FileCheck %s \
+; RUN: --check-prefix=LINUX64BE
+
+ at .str = private unnamed_addr constant [47 x i8] c"TLS variable 1, 2 and non-TLS var: %s, %s, %s\0A\00", align 1
+ at a = internal thread_local constant [5 x i8] c"tls1\00", align 1
+ at b = internal thread_local constant [5 x i8] c"tls2\00", align 1
+ at c = internal constant [15 x i8] c"Regular global\00", align 1
+ at d = internal constant [10 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10], align 4
+ at e = internal constant [4 x float] [float 0x4055F33340000000, float 0x4056333340000000, float 0x40567999A0000000, float 0x4056B33340000000], align 4
+
+declare noundef signext i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #0
+declare nonnull ptr @llvm.threadlocal.address.p0(ptr nonnull) #1
+declare void @callee(ptr noundef) local_unnamed_addr #3
+declare void @callee2(ptr noundef) local_unnamed_addr #3
+
+define void @print_tls_func() {
+; CHECK64-LABEL: print_tls_func:
+; CHECK64: # %bb.0: # %entry
+; CHECK64-NEXT: mflr r0
+; CHECK64-NEXT: stdu r1, -112(r1)
+; CHECK64-NEXT: ld r3, L..C0(r2) # target-flags(ppc-tlsldm) @"_$TLSML"
+; CHECK64-NEXT: std r0, 128(r1)
+; CHECK64-NEXT: ld r6, L..C1(r2) # @__ModuleStringPool
+; CHECK64-NEXT: bla .__tls_get_mod[PR]
+; CHECK64-NEXT: ld r4, L..C2(r2) # target-flags(ppc-tlsld) @a
----------------
amy-kwan wrote:
Thanks, Digger. I have added this at the end of the test case.
https://github.com/llvm/llvm-project/pull/94059
More information about the llvm-commits
mailing list