1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 02:33:06 +01:00
llvm-mirror/lib/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
..
ArchiveEmitter.cpp [yaml2obj][obj2yaml] - Teach tools to work with regular archives. 2020-10-28 15:27:11 +03:00
ArchiveYAML.cpp [yaml2obj][obj2yaml] - Teach tools to work with regular archives. 2020-10-28 15:27:11 +03:00
CMakeLists.txt [yaml2obj] Initial the support of yaml2obj for 32-bit XCOFF. 2021-06-07 04:14:44 +00:00
CodeViewYAMLDebugSections.cpp Revert "Remove redundant "std::move"s in return statements" 2020-02-10 07:07:40 -08:00
CodeViewYAMLSymbols.cpp [COFF][ARM] Fix CodeView for Windows on 32bit ARM targets. 2020-10-19 22:16:16 -07:00
CodeViewYAMLTypeHashing.cpp
CodeViewYAMLTypes.cpp [lld] Fixed CodeView GuidAdapter::format to handle GUID bytes in the right order. 2021-04-09 05:29:14 +04:00
COFFEmitter.cpp [llvm] Don't include StringSwitch.h where unnecessary (NFC) 2021-01-21 19:59:48 -08:00
COFFYAML.cpp
DWARFEmitter.cpp [llvm] Populate std::vector at construction time (NFC) 2021-01-18 10:16:33 -08:00
DWARFYAML.cpp Reland "[yaml2obj][ELF] - Simplify the code that performs sections validation." 2020-10-20 16:25:33 +03:00
ELFEmitter.cpp [LLD][LLVM] CG Graph profile using relocations 2021-06-24 09:09:33 -07:00
ELFYAML.cpp [LLD][LLVM] CG Graph profile using relocations 2021-06-24 09:09:33 -07:00
MachOEmitter.cpp [llvm] Populate std::vector at construction time (NFC) 2021-01-18 10:16:33 -08:00
MachOYAML.cpp Reland "[yaml2obj][ELF] - Simplify the code that performs sections validation." 2020-10-20 16:25:33 +03:00
MinidumpEmitter.cpp Update MinidumpYAML to use minidump::Exception for exception stream 2019-10-18 14:56:19 +00:00
MinidumpYAML.cpp Reland "[yaml2obj][ELF] - Simplify the code that performs sections validation." 2020-10-20 16:25:33 +03:00
ObjectYAML.cpp [yaml2obj] Initial the support of yaml2obj for 32-bit XCOFF. 2021-06-07 04:14:44 +00:00
WasmEmitter.cpp [WebAssembly] Rename event to tag 2021-06-17 20:34:19 -07:00
WasmYAML.cpp [WebAssembly] Rename event to tag 2021-06-17 20:34:19 -07:00
XCOFFEmitter.cpp [yaml2obj] Add support for writing the long symbol name. 2021-06-21 05:09:56 +00:00
XCOFFYAML.cpp [yaml2obj] Initial the support of yaml2obj for 32-bit XCOFF. 2021-06-07 04:14:44 +00:00
yaml2obj.cpp [yaml2obj] Initial the support of yaml2obj for 32-bit XCOFF. 2021-06-07 04:14:44 +00:00
YAML.cpp [FixBB] - Fix one more std::min -> std::min<uint64_t> to make BB happy. 2019-11-11 12:11:54 +03:00