aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/LTO/LTOBackend.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/LTO/LTOBackend.cpp')
-rw-r--r--llvm/lib/LTO/LTOBackend.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/LTO/LTOBackend.cpp b/llvm/lib/LTO/LTOBackend.cpp
index 29e2887..ccc4276 100644
--- a/llvm/lib/LTO/LTOBackend.cpp
+++ b/llvm/lib/LTO/LTOBackend.cpp
@@ -225,7 +225,12 @@ createTargetMachine(const Config &Conf, const Target *TheTarget, Module &M) {
std::unique_ptr<TargetMachine> TM(TheTarget->createTargetMachine(
TheTriple, Conf.CPU, Features.getString(), Conf.Options, RelocModel,
CodeModel, Conf.CGOptLevel));
+
assert(TM && "Failed to create target machine");
+
+ if (std::optional<uint64_t> LargeDataThreshold = M.getLargeDataThreshold())
+ TM->setLargeDataThreshold(*LargeDataThreshold);
+
return TM;
}