summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/AArch64/AArch64TargetMachine.cpp
diff options
context:
space:
mode:
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