[PATCH] D103372: [InstrProfiling] If no value profiling, make data variable private and (for Windows) use one comdat

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 4 13:44:19 PDT 2021


MaskRay added inline comments.


================
Comment at: llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp:935
+  // data variables can be private. This optimization applies on COFF and ELF.
+  if (!DataReferencedByCode && !TT.isOSBinFormatMachO()) {
+    Linkage = GlobalValue::PrivateLinkage;
----------------
I am conservative here. For ELF `__profd_*` can be unconditionally private, even in `DataReferencedByCode == true` mode. This will decrease object file sizes for regular PGO.

But there may be too many changes now. I'll postpone doing this after this proves to be stable.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103372



More information about the cfe-commits mailing list