1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 20:23:11 +01:00
llvm-mirror/include/llvm/ObjectYAML
Alexander Yermolovich d12ae1eaf8 [LLD][LLVM] CG Graph profile using relocations
Currently when .llvm.call-graph-profile is created by llvm it explicitly encodes the symbol indices. This section is basically a black box for post processing tools. For example, if we run strip -s on the object files the symbol table changes, but indices in that section do not. In non-visible behavior indices point to wrong symbols. The visible behavior indices point outside of Symbol table: "invalid symbol index".

This patch changes the format by using R_*_NONE relocations to indicate the from/to symbols. The Frequency (Weight) will still be in the .llvm.call-graph-profile, but symbol information will be in relocation section. In LLD information from both sections is used to reconstruct call graph profile. Relocations themselves will never be applied.

With this approach post processing tools that handle relocations correctly work for this section also. Tools can add/remove symbols and as long as they handle relocation sections with this approach information stays correct.

Doing a quick experiment with clang-13.
The size went up from 107KB to 322KB, aggregate of all the input sections. Size of clang-13 binary is ~118MB. For users of -fprofile-use/-fprofile-sample-use the size of object files will go up slightly, it will not impact final binary size.

Reviewed By: jhenderson, MaskRay

Differential Revision: https://reviews.llvm.org/D104080
2021-06-24 09:09:33 -07:00
..
ArchiveYAML.h
CodeViewYAMLDebugSections.h
CodeViewYAMLSymbols.h
CodeViewYAMLTypeHashing.h [llvm] Fix header guards (NFC) 2021-02-05 21:02:06 -08:00
CodeViewYAMLTypes.h
COFFYAML.h
DWARFEmitter.h
DWARFYAML.h
ELFYAML.h [LLD][LLVM] CG Graph profile using relocations 2021-06-24 09:09:33 -07:00
MachOYAML.h
MinidumpYAML.h
ObjectYAML.h [yaml2obj] Initial the support of yaml2obj for 32-bit XCOFF. 2021-06-07 04:14:44 +00:00
WasmYAML.h [WebAssembly] Rename event to tag 2021-06-17 20:34:19 -07:00
XCOFFYAML.h [yaml2obj] Initial the support of yaml2obj for 32-bit XCOFF. 2021-06-07 04:14:44 +00:00
yaml2obj.h [yaml2obj] Initial the support of yaml2obj for 32-bit XCOFF. 2021-06-07 04:14:44 +00:00
YAML.h