[llvm] [AIX][TLS] Optimize the small local-exec access sequence for non-zero offsets (PR #71485)

Amy Kwan via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 24 08:47:35 PST 2024


================
@@ -0,0 +1,160 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 3
----------------
amy-kwan wrote:

Good point, but I did add this test case because I wanted to show the layout of the disassembly section specifically for when we have a mix of local-exec and other TLS variables (in this case, a global dynamic variable represented by `MyTLSGDVar`.

Adding an additional TLS variable from a different access model can change the disassembly of the test and the addresses of the TLS variables, for example this test has specifically the following for the TLS addresses.
```
; DIS:      Disassembly of section .tdata:
; DIS:      0000000000000000 (idx: 17) mySmallLocalExecTLS2[TL]:
; DIS:      0000000000005dc0 (idx: 19) MyTLSGDVar[TL]:
; DIS:      00000000000076c0 (idx: 21) mySmallLocalExecTLS3[TL]:
; DIS:      000000000000d480 (idx: 23) mySmallLocalExecTLS4[TL]:
; DIS:      0000000000013240 (idx: 25) mySmallLocalExecTLS5[TL]:
; DIS:      0000000000019000 (idx: 27) mySmallLocalExecTLS[TL]:
```
So I think I just thought adding an additional test can help test the address computation portion I added in `PPCAsmPrinter.cpp`:
``` C++
      TLSVarAddress = alignTo(TLSVarAddress, getGVAlignment(&G, DL));
      TLSVarsToAddressMapping[&G] = TLSVarAddress;
      TLSVarAddress += DL.getTypeAllocSize(G.getValueType());
```

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


More information about the llvm-commits mailing list