aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
diff options
context:
space:
mode:
authorFelix (Ting Wang) <Ting.Wang.SH@ibm.com>2024-04-12 08:18:01 +0800
committerGitHub <noreply@github.com>2024-04-12 08:18:01 +0800
commit09d51a841dcfbc41c3d7f3274b109b5f9fb09bb0 (patch)
tree8fd744c659f86c435238aba0e6047a085687426d /llvm/lib/Target/PowerPC/PPCSubtarget.cpp
parentbf1d7b8df287d69ee265b91be40dec37267b2d5c (diff)
downloadllvm-09d51a841dcfbc41c3d7f3274b109b5f9fb09bb0.zip
llvm-09d51a841dcfbc41c3d7f3274b109b5f9fb09bb0.tar.gz
llvm-09d51a841dcfbc41c3d7f3274b109b5f9fb09bb0.tar.bz2
[PowerPC][AIX] Enable aix-small-local-dynamic-tls target attribute (#86641)
Following the aix-small-local-exec-tls target attribute, this patch adds a target attribute for an AIX-specific option in llc that informs the compiler that it can use a faster access sequence for the local-dynamic TLS model (formally named aix-small-local-dynamic-tls) when TLS variables are less than ~32KB in size. The patch either produces an addi/la with a displacement off of module handle (return value from .__tls_get_mod) when the address is calculated, or it produces an addi/la followed by a load/store when the address is calculated and used for further accesses. --------- Co-authored-by: Amy Kwan <amy.kwan1@ibm.com>
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPCSubtarget.cpp')
-rw-r--r--llvm/lib/Target/PowerPC/PPCSubtarget.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
index 653d9bd..d172255 100644
--- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
@@ -124,22 +124,22 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef TuneCPU,
// Determine endianness.
IsLittleEndian = TM.isLittleEndian();
- if (HasAIXSmallLocalExecTLS) {
+ if (HasAIXSmallLocalExecTLS || HasAIXSmallLocalDynamicTLS) {
if (!TargetTriple.isOSAIX() || !IsPPC64)
- report_fatal_error(
- "The aix-small-local-exec-tls attribute is only supported on AIX in "
- "64-bit mode.\n",
- false);
- // The aix-small-local-exec-tls attribute should only be used with
+ report_fatal_error("The aix-small-local-[exec|dynamic]-tls attribute is "
+ "only supported on AIX in "
+ "64-bit mode.\n",
+ false);
+ // The aix-small-local-[exec|dynamic]-tls attribute should only be used with
// -data-sections, as having data sections turned off with this option
- // is not ideal for performance. Moreover, the small-local-exec-tls region
- // is a limited resource, and should not be used for variables that may
- // be replaced.
+ // is not ideal for performance. Moreover, the
+ // small-local-[exec|dynamic]-tls region is a limited resource, and should
+ // not be used for variables that may be replaced.
if (!TM.getDataSections())
- report_fatal_error(
- "The aix-small-local-exec-tls attribute can only be specified with "
- "-data-sections.\n",
- false);
+ report_fatal_error("The aix-small-local-[exec|dynamic]-tls attribute can "
+ "only be specified with "
+ "-data-sections.\n",
+ false);
}
}