[PATCH] D122133: [LTO] Add configuartion option to use default optimization pipeline

Joseph Huber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 22 06:28:58 PDT 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG5856f30b5ae0: [LTO] Add configuartion option to use default optimization pipeline (authored by jhuber6).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D122133/new/

https://reviews.llvm.org/D122133

Files:
  clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
  llvm/include/llvm/LTO/Config.h
  llvm/lib/LTO/LTOBackend.cpp


Index: llvm/lib/LTO/LTOBackend.cpp
===================================================================
--- llvm/lib/LTO/LTOBackend.cpp
+++ llvm/lib/LTO/LTOBackend.cpp
@@ -298,6 +298,8 @@
       report_fatal_error(Twine("unable to parse pass pipeline description '") +
                          Conf.OptPipeline + "': " + toString(std::move(Err)));
     }
+  } else if (Conf.UseDefaultPipeline) {
+    MPM.addPass(PB.buildPerModuleDefaultPipeline(OL));
   } else if (IsThinLTO) {
     MPM.addPass(PB.buildThinLTODefaultPipeline(OL, ImportSummary));
   } else {
Index: llvm/include/llvm/LTO/Config.h
===================================================================
--- llvm/include/llvm/LTO/Config.h
+++ llvm/include/llvm/LTO/Config.h
@@ -60,6 +60,9 @@
   /// Use the new pass manager
   bool UseNewPM = LLVM_ENABLE_NEW_PASS_MANAGER;
 
+  /// Use the standard optimization pipeline.
+  bool UseDefaultPipeline = false;
+
   /// Flag to indicate that the optimizer should not assume builtins are present
   /// on the target.
   bool Freestanding = false;
Index: clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
===================================================================
--- clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
+++ clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
@@ -860,6 +860,7 @@
   // TODO: Handle index-only thin-LTO
   Backend = lto::createInProcessThinBackend(
       llvm::heavyweight_hardware_concurrency(1));
+  Conf.UseDefaultPipeline = true;
 
   Conf.CPU = Arch.str();
   Conf.Options = codegen::InitTargetOptionsFromCodeGenFlags(TheTriple);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D122133.417276.patch
Type: text/x-patch
Size: 1599 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220322/b8c511cc/attachment.bin>


More information about the llvm-commits mailing list