Skip to content

Commit a1d57fc

Browse files
committed
[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.
1 parent d351f54 commit a1d57fc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -860,14 +860,15 @@ std::unique_ptr<lto::LTO> createLTO(
860860
// TODO: Handle index-only thin-LTO
861861
Backend =
862862
lto::createInProcessThinBackend(llvm::heavyweight_hardware_concurrency());
863-
Conf.UseDefaultPipeline = true;
864863

865864
Conf.CPU = Arch.str();
866865
Conf.Options = codegen::InitTargetOptionsFromCodeGenFlags(TheTriple);
867866

868867
Conf.MAttrs = getTargetFeatures(TheTriple);
869868
Conf.CGOptLevel = getCGOptLevel(OptLevel[1] - '0');
870869
Conf.OptLevel = OptLevel[1] - '0';
870+
if (Conf.OptLevel > 0)
871+
Conf.UseDefaultPipeline = true;
871872
Conf.DefaultTriple = TheTriple.getTriple();
872873
Conf.DiagHandler = diagnosticHandler;
873874

0 commit comments

Comments
 (0)