[llvm] [PowerPC] Support local-dynamic TLS relocation on AIX (PR #66316)

Ting Wang via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 18 00:05:21 PDT 2023


================
@@ -156,10 +156,11 @@ define void @storesTIInit(double %Val) #0 {
 ; SMALL32:       # %bb.0: # %entry
 ; SMALL32-NEXT:    mflr 0
 ; SMALL32-NEXT:    stwu 1, -32(1)
-; SMALL32-NEXT:    lwz 3, L..C4(2) # target-flags(ppc-lo) @TIInit
-; SMALL32-NEXT:    lwz 4, L..C5(2) # target-flags(ppc-tlsgd) @TIInit
 ; SMALL32-NEXT:    stw 0, 40(1)
-; SMALL32-NEXT:    bla .__tls_get_addr[PR]
+; SMALL32-NEXT:    lwz 6, L..C4(2) # target-flags(ppc-tlsld) @TIInit
----------------
orcguru wrote:

I'm afraid `generaldynamic` is not a valid explicit mode according to document: https://llvm.org/docs/LangRef.html
```
A variable may be defined as thread_local, which means that it will not be shared by threads (each thread will have a separated copy of the variable). Not all targets support thread-local variables. Optionally, a TLS model may be specified:

localdynamic

    For variables that are only used within the current shared library.
initialexec

    For variables in modules that will not be loaded dynamically.
localexec

    For variables defined in the executable and only used within it.

If no explicit model is given, the “general dynamic” model is used.
```

https://github.com/llvm/llvm-project/pull/66316


More information about the llvm-commits mailing list