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

Reid Kleckner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 4 11:38:50 PDT 2021


rnk added a comment.

I think MachO doesn't have comdats, so we need to leave the `__profd_` linkage as it was. I think private linkage also prevents atomization, which inhibits GC / dead stripping. I don't think this change really makes sense for MachO, so you could reasonably reland with that change.



================
Comment at: llvm/test/Instrumentation/InstrProfiling/linkage.ll:64
 ; MACHO: @__profc_foo_inline = linkonce_odr hidden global
-; MACHO: @__profd_foo_inline = linkonce_odr hidden global
+; MACHO: @__profd_foo_inline = private global
 ; COFF: @__profc_foo_inline = linkonce_odr hidden global{{.*}} section ".lprfc$M", align 8
----------------
I think we don't want this change for macho. If we make `__profd_` private on Mac, the linker won't be able to deduplicate these `__profd` globals, and there will be multiple copies pointing to the same counters.


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