[PATCH] D103372: [InstrProfiling] If no value profiling, make data variable private and (for Windows) use one comdat
    Reid Kleckner via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Thu Jun  3 11:05:41 PDT 2021
    
    
  
rnk accepted this revision.
rnk added a comment.
lgtm
This reduced object file size of base_unittests.exe, compiled with coverage, optimizations, and gmlt debug info by 10%:
  #BEFORE
  
  $ find . -iname '*.obj' | xargs du -b | awk '{ sum += $1 } END { print sum}'
  1047758867
  
  $ du -cksh base_unittests.exe
  82M     base_unittests.exe
  82M     total
  
  
  # AFTER
  
  $ find . -iname '*.obj' | xargs du -b | awk '{ sum += $1 } END { print sum}'
  937886499
  
  $ du -cksh base_unittests.exe
  78M     base_unittests.exe
  78M     total
I should've precisely measured executable size in bytes, but the exe size reduction is roughly 5%. Linker GC was enabled, so I'm assuming that 5% is from dropping profile data for unreferenced counters.
Inspecting a random object file shows that we are still adding `__covrec_*` to llvm.used, and that accounts for lots of /include: directives.
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D103372/new/
https://reviews.llvm.org/D103372
    
    
More information about the llvm-commits
mailing list