[PATCH] D42183: [LLD] [ELF] Pass CPU string to LTO pipeline.
Rafael Avila de Espindola via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 17 09:58:39 PST 2018
Can you add a testcase?
Cheers,
Rafael
Pratik Bhatu via Phabricator via llvm-commits
<llvm-commits at lists.llvm.org> writes:
> 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();
> +}
>
>
> 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();
> +}
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list