[PATCH] D97414: [ThinLTO][NewPM] Clean up dead code under -O0

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 24 16:38:20 PST 2021


tejohnson accepted this revision.
tejohnson added a comment.
This revision is now accepted and ready to land.

lgtm



================
Comment at: llvm/lib/Passes/PassBuilder.cpp:1542
 
-  if (Level == OptimizationLevel::O0)
+  if (Level == OptimizationLevel::O0) {
+    // Drop available_externally and unreferenced globals. This is necessary
----------------
aeubanks wrote:
> tejohnson wrote:
> > aeubanks wrote:
> > > tejohnson wrote:
> > > > Looking at the old PM, we also call:
> > > > MPM.add(createLowerTypeTestsPass(nullptr, nullptr, true));
> > > > 
> > > > to drop any leftover type tests. Thinking that should probably get added here too (it's normally done below in the ModuleSimplificationPipeline, but of course that doesn't get reached for O0).
> > > It's already added right above, but only when we have an ImportSummary. Should another be added when we don't have an ImportSummary?
> > Note the args are different - LTT needs to be called a second time with the third parameter set to true to remove all the type tests that the first call leaves behind for potential use in optimization.
> ah I didn't notice that, done
Can you add a comment? Just use the one used where we do the same thing for O0 in the regular LTO pipeline:
    // Run a second time to clean up any type tests left behind by WPD for use
    // in ICP.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D97414



More information about the llvm-commits mailing list