aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp
diff options
context:
space:
mode:
authorAmy Kwan <amy.kwan1@ibm.com>2024-02-01 09:29:21 -0500
committerGitHub <noreply@github.com>2024-02-01 09:29:21 -0500
commit2a50921553798d2db52ca6330c89f0f8a5bc2215 (patch)
tree6a42384680e29b8998d1b17cdfc000a45e424575 /llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp
parent15295d01352c922f1dfe564d801d556cf5fe01b3 (diff)
downloadllvm-2a50921553798d2db52ca6330c89f0f8a5bc2215.zip
llvm-2a50921553798d2db52ca6330c89f0f8a5bc2215.tar.gz
llvm-2a50921553798d2db52ca6330c89f0f8a5bc2215.tar.bz2
[AIX][TLS] Optimize the small local-exec access sequence for non-zero offsets (#71485)
This patch utilizes the -maix-small-local-exec-tls option to produce a faster, non-TOC-based access sequence for the local-exec TLS model. Specifically, for when the offsets from the TLS variable are non-zero. In particular, this patch produces either a single: - addi/la with a displacement off of R13 plus a non-zero offset for when an address is calculated, or - load or store off of R13 plus a non-zero offset for when an address is calculated and used for further access where R13 is the thread pointer, respectively. In order to produce a single addi or load/store off of the thread pointer with a non-zero offset, this patch also adds the necessary support in the assembly printer when printing these instructions. Specifically: - The non-zero offset is added to the TLS variable address when the address of the TLS variable + it's offset is less than 32KB. - Otherwise, when the address of the TLS variable + its offset is greater than 32KB, the non-zero offset (and a multiple of 64KB) is subtracted from the TLS address. This handling in the assembly printer is necessary to ensure that the TLS address + the non-zero offset is between [-32768, 32768), so that the total displacement can fit within the addi/load/store instructions. This patch is meant to be a follow-up to 3f46e5453d9310b15d974e876f6132e3cf50c4b1 (where the optimization occurs for when the offset is zero).
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp')
0 files changed, 0 insertions, 0 deletions