llvm.org GIT mirror llvm / 7edf726
Revert r324557, "gold-plugin: Do not set codegen opt level based on LTO opt level." It was reported that this change measurably regressed -plugin-opt=O3 performance. There is an ongoing discussion on llvm-dev about the correct way to set the CG opt level, see thread "[llvm-dev] [RFC] Adding function attributes to represent codegen optimization level". git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329458 91177308-0d34-0410-b5e6-96231b3b80d8 Peter Collingbourne 2 years ago
1 changed file(s) with 15 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
778778 return FD;
779779 }
780780
781 static CodeGenOpt::Level getCGOptLevel() {
782 switch (options::OptLevel) {
783 case 0:
784 return CodeGenOpt::None;
785 case 1:
786 return CodeGenOpt::Less;
787 case 2:
788 return CodeGenOpt::Default;
789 case 3:
790 return CodeGenOpt::Aggressive;
791 }
792 llvm_unreachable("Invalid optimization level");
793 }
794
781795 /// Parse the thinlto_prefix_replace option into the \p OldPrefix and
782796 /// \p NewPrefix strings, if it was specified.
783797 static void getThinLTOOldAndNewPrefix(std::string &OldPrefix,
809823
810824 Conf.MAttrs = MAttrs;
811825 Conf.RelocModel = RelocationModel;
826 Conf.CGOptLevel = getCGOptLevel();
812827 Conf.DisableVerify = options::DisableVerify;
813828 Conf.OptLevel = options::OptLevel;
814829 if (options::Parallelism)