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

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 1 10:47:32 PDT 2017


pcc added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/PassManagerBuilder.cpp:425
+      // globals in the object file.
+      MPM.add(createEliminateAvailableExternallyPass());
+      MPM.add(createGlobalDCEPass());
----------------
tejohnson wrote:
> 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?
Yes, otherwise we can end up with a situation like in `Inputs/dead-strip-fulllto.ll` where `odr` is keeping `dead3` alive. If `dead3` contained references to other dead symbols, that would cause an undefined symbol error.


https://reviews.llvm.org/D39484





More information about the llvm-commits mailing list