summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/AArch64/AArch64TargetMachine.cpp
diff options
context:
space:
mode:
authorKAWASHIMA Takahiro <t-kawashima@fujitsu.com>2020-01-13 09:28:02 +0000
committerPeter Smith <peter.smith@linaro.org>2020-01-13 10:16:53 +0000
commit10c11e4e2d05cf0e8f8251f50d84ce77eb1e9b8d (patch)
tree77ec95e71e5e339ea077bf172e895f2de8dcb451 /llvm/lib/Target/AArch64/AArch64TargetMachine.cpp
parent96b8e1ac4674dd3035b6cc7b1b7ed8b946208ab1 (diff)
downloadbcm5719-llvm-10c11e4e2d05cf0e8f8251f50d84ce77eb1e9b8d.tar.gz
bcm5719-llvm-10c11e4e2d05cf0e8f8251f50d84ce77eb1e9b8d.zip
This option allows selecting the TLS size in the local exec TLS model,
which is the default TLS model for non-PIC objects. This allows large/ many thread local variables or a compact/fast code in an executable. Specification is same as that of GCC. For example, the code model option precedes the TLS size option. TLS access models other than local-exec are not changed. It means supoort of the large code model is only in the local exec TLS model. Patch By KAWASHIMA Takahiro (kawashima-fj <t-kawashima@fujitsu.com>) Reviewers: dmgreen, mstorsjo, t.p.northover, peter.smith, ostannard Reviewd By: peter.smith Committed by: peter.smith Differential Revision: https://reviews.llvm.org/D71688
Diffstat (limited to 'llvm/lib/Target/AArch64/AArch64TargetMachine.cpp')
-rw-r--r--llvm/lib/Target/AArch64/AArch64TargetMachine.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64TargetMachine.cpp b/llvm/lib/Target/AArch64/AArch64TargetMachine.cpp
index 68f4ee08048..6048010ee0c 100644
--- a/llvm/lib/Target/AArch64/AArch64TargetMachine.cpp
+++ b/llvm/lib/Target/AArch64/AArch64TargetMachine.cpp
@@ -288,6 +288,17 @@ AArch64TargetMachine::AArch64TargetMachine(const Target &T, const Triple &TT,
this->Options.TrapUnreachable = true;
}
+ if (this->Options.TLSSize == 0) // default
+ this->Options.TLSSize = 24;
+ if ((getCodeModel() == CodeModel::Small ||
+ getCodeModel() == CodeModel::Kernel) &&
+ this->Options.TLSSize > 32)
+ // for the small (and kernel) code model, the maximum TLS size is 4GiB
+ this->Options.TLSSize = 32;
+ else if (getCodeModel() == CodeModel::Tiny && this->Options.TLSSize > 24)
+ // for the tiny code model, the maximum TLS size is 1MiB (< 16MiB)
+ this->Options.TLSSize = 24;
+
// Enable GlobalISel at or below EnableGlobalISelAt0, unless this is
// MachO/CodeModel::Large, which GlobalISel does not support.
if (getOptLevel() <= EnableGlobalISelAtO &&
OpenPOWER on IntegriCloud