[PATCH] D146776: [llvm] Preliminary fat-lto-objects support

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 12 14:56:26 PDT 2023


nikic requested changes to this revision.
nikic added inline comments.
This revision now requires changes to proceed.
Herald added a subscriber: StephenFan.


================
Comment at: llvm/lib/Passes/PassBuilderPipelines.cpp:1414
+                                                    OptimizationLevel Level,
+                                                    bool LTOPreLink) {
+  assert(Level != OptimizationLevel::O0 &&
----------------
Splitting out this method should not be necessary, you can add one MPM to another.


================
Comment at: llvm/lib/Passes/PassBuilderPipelines.cpp:1461
+  MPM.addPass(EmbedBitcodePass(ThinLTOPreLink, EmitUseList, EmitSummary));
+  addPerModuleDefaultPipelinePasses(MPM, Level, /*LTOPreLink=*/false);
   return MPM;
----------------
Running the full default pipeline after the pre-link pipeline doesn't make a lot of sense. You should only run the module optimization pipeline here. For ThinLTO, the pre-link pipeline + module optimization will give you pretty much exactly the default pipeline. For FatLTO, it will run module optimization twice, at least until D148010 lands.

This will still have some problems though, such as running the optimization pipeline extension points twice.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D146776



More information about the llvm-commits mailing list