1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00

gold-plugin: Do not set codegen opt level based on LTO opt level.

The LTO opt level should not affect the codegen opt level, and indeed
it does not affect it in lld. Ideally the codegen opt level should
be controlled by an IR-level attribute based on the compile-time opt
level, but that hasn't been implemented yet.

Differential Revision: https://reviews.llvm.org/D43040

llvm-svn: 324557
This commit is contained in:
Peter Collingbourne 2018-02-08 02:41:22 +00:00
parent 64e394debb
commit 31b9403c70

View File

@ -727,20 +727,6 @@ static int getOutputFileName(StringRef InFilename, bool TempOutFile,
return FD;
}
static CodeGenOpt::Level getCGOptLevel() {
switch (options::OptLevel) {
case 0:
return CodeGenOpt::None;
case 1:
return CodeGenOpt::Less;
case 2:
return CodeGenOpt::Default;
case 3:
return CodeGenOpt::Aggressive;
}
llvm_unreachable("Invalid optimization level");
}
/// Parse the thinlto_prefix_replace option into the \p OldPrefix and
/// \p NewPrefix strings, if it was specified.
static void getThinLTOOldAndNewPrefix(std::string &OldPrefix,
@ -767,7 +753,6 @@ static std::unique_ptr<LTO> createLTO(IndexWriteCallback OnIndexWrite) {
Conf.MAttrs = MAttrs;
Conf.RelocModel = RelocationModel;
Conf.CGOptLevel = getCGOptLevel();
Conf.DisableVerify = options::DisableVerify;
Conf.OptLevel = options::OptLevel;
if (options::Parallelism)