[OpenMP] Do not use the default pipeline without optimizations

Summary:
A previous patch added the option to use the default pipeline when
perfomring LTO rather than the regular LTO pipeline. This greatly
improved performance regressions we were observing with the LTO
pipeline. However, this should not be used if the user explicitly
disables optimizations as the default pipeline expects some
optimizatoins to be perfomed.
This commit is contained in:
Joseph Huber
2022-04-11 17:26:33 -04:00
parent d351f54a07
commit a1d57fc225

View File

@@ -860,7 +860,6 @@ std::unique_ptr<lto::LTO> createLTO(
// TODO: Handle index-only thin-LTO
Backend =
lto::createInProcessThinBackend(llvm::heavyweight_hardware_concurrency());
Conf.UseDefaultPipeline = true;
Conf.CPU = Arch.str();
Conf.Options = codegen::InitTargetOptionsFromCodeGenFlags(TheTriple);
@@ -868,6 +867,8 @@ std::unique_ptr<lto::LTO> createLTO(
Conf.MAttrs = getTargetFeatures(TheTriple);
Conf.CGOptLevel = getCGOptLevel(OptLevel[1] - '0');
Conf.OptLevel = OptLevel[1] - '0';
if (Conf.OptLevel > 0)
Conf.UseDefaultPipeline = true;
Conf.DefaultTriple = TheTriple.getTriple();
Conf.DiagHandler = diagnosticHandler;