With this patch, compiler generated profile variables will have its own COMDAT name for ELF format, which syncs the behavior with COFF.
Tested with clang PGO bootstrap. This shows a modest reduction in object sizes in ELF format.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
lgtm, glad it saves object size.
This should remove the last call to getInstrProfComdatPrefix, so you can remove that too.
Comment Actions
I think a potentially better approach is to reuse an existing symbol name as the comdat name (D84723). The state before this patch was inferior because __profv_ created a symbol which might waste .strtab space. By reusing an existing symbol (I picked __profd_), we don't waste .strtab space and can do better than this patch: we don't need to create one or two additional section groups (.group, sizeof(Elf64_Shdr)=64).