[PATCH] D42183: [LLD] [ELF] Pass CPU string to LTO pipeline.
Pratik Bhatu via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 17 07:09:15 PST 2018
pbhatu created this revision.
pbhatu added reviewers: ruiu, davide.
Herald added subscribers: llvm-commits, inglorion, emaste.
Previously an empty CPU string was passed to the LTO engine which
resulted in a generic CPU for which certain features like NOPL
were disabled. This fixes that.
Repository:
rLLD LLVM Linker
https://reviews.llvm.org/D42183
Files:
Common/TargetOptionsCommandFlags.cpp
ELF/LTO.cpp
include/lld/Common/TargetOptionsCommandFlags.h
Index: include/lld/Common/TargetOptionsCommandFlags.h
===================================================================
--- include/lld/Common/TargetOptionsCommandFlags.h
+++ include/lld/Common/TargetOptionsCommandFlags.h
@@ -18,4 +18,5 @@
namespace lld {
llvm::TargetOptions InitTargetOptionsFromCodeGenFlags();
llvm::Optional<llvm::CodeModel::Model> GetCodeModelFromCMModel();
+std::string GetCPUStr();
}
Index: ELF/LTO.cpp
===================================================================
--- ELF/LTO.cpp
+++ ELF/LTO.cpp
@@ -87,6 +87,7 @@
Conf.DisableVerify = Config->DisableVerify;
Conf.DiagHandler = diagnosticHandler;
Conf.OptLevel = Config->LTOO;
+ Conf.CPU = GetCPUStr();
// Set up a custom pipeline if we've been asked to.
Conf.OptPipeline = Config->LTONewPmPasses;
Index: Common/TargetOptionsCommandFlags.cpp
===================================================================
--- Common/TargetOptionsCommandFlags.cpp
+++ Common/TargetOptionsCommandFlags.cpp
@@ -30,3 +30,7 @@
llvm::Optional<llvm::CodeModel::Model> lld::GetCodeModelFromCMModel() {
return getCodeModel();
}
+
+std::string lld::GetCPUStr() {
+ return ::getCPUStr();
+}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42183.130175.patch
Type: text/x-patch
Size: 1177 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180117/df635722/attachment.bin>
More information about the llvm-commits
mailing list