[PATCH] D39484: LTO: Apply global DCE to ThinLTO modules at LTO opt level 0.

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 1 07:52:09 PDT 2017


tejohnson added inline comments.


================
Comment at: llvm/lib/LTO/LTO.cpp:1101
 
-  if (Conf.OptLevel > 0) {
+  if (Conf.OptLevel > 0)
     ComputeCrossModuleImport(ThinLTO.CombinedIndex, ModuleToDefinedGVSummaries,
----------------
I think it is worth a comment about why we are doing the other summary based optimizations such as internalization at -O0, so someone doesn't go back later and make those conditional.


================
Comment at: llvm/lib/Transforms/IPO/PassManagerBuilder.cpp:425
+      // globals in the object file.
+      MPM.add(createEliminateAvailableExternallyPass());
+      MPM.add(createGlobalDCEPass());
----------------
Just to ensure I understand correctly - needing to remove the non-prevailing linkonce_odr is in turn due to the change to do internalization/DCE at -O0?


================
Comment at: llvm/test/LTO/Resolution/X86/dead-strip-fulllto.ll:21
 
 ; THIN-NOT: dead
 ; THIN: T live1
----------------
add a check that we don't have @odr either?


https://reviews.llvm.org/D39484





More information about the llvm-commits mailing list