Open Quuxplusone opened 3 years ago
The IR comdat name lowers to (ELF) a signature symbol and (PE-COFF) a leader symbol. For comdat noduplicates
, the group name has no significance to the linker.
We have comdat groups (where a group of e.g. a data and a code section and a debuginfo section can be retained or discarded as a group) at the MC level today. I guess this bug is for hooking up comdat noduplicates
at the IR level to that feature?
I not heard of ELF signature symbols, and I can't seem to find any information on them in the docs.
Thanks for providing PGO as an example of comdat noduplicates
in action. Hopefully we can use that as motivating example to implement this.
Does every single function get its own llvm_prf_cnts and llvm_prf_data? Could the comdat noduplicates
be implemented as symbol with local binding (in which case its name would not matter)?
Regular
comdat any
performs deduplication with the symbol name as the key.comdat noduplicates
is useful to express that a group of sections should be retained or discarded as a unit. This is currently unimplemented for wasm.This feature is useful for certain metadata sections. In the simplest non-value-profiling PGO/coverage case. A function needs two metadata sections: llvm_prf_cnts, llvm_prf_data. The code references llvm_prf_cnts but llvm_prf_data is unreferenced. We can place the pair of cnts/data in a
comdat noduplicates
to let the liveness of cnts retain data.