llvm-project/llvm/lib/Object
Rahman Lavaee 0aa6df6575 [Propeller] Encode address offsets of basic blocks relative to the end of the previous basic blocks.
This is a resurrection of D106421 with the change that it keeps backward-compatibility. This means decoding the previous version of `LLVM_BB_ADDR_MAP` will work. This is required as the profile mapping tool is not released with LLVM (AutoFDO). As suggested by @jhenderson we rename the original  section type value to `SHT_LLVM_BB_ADDR_MAP_V0` and assign a new value to the `SHT_LLVM_BB_ADDR_MAP` section type. The new encoding adds a version byte to each function entry to specify the encoding version for that function.  This patch also adds a feature byte to be used with more flexibility in the future. An use-case example for the feature field is encoding multi-section functions more concisely using a different format.

Conceptually, the new encoding emits basic block offsets and sizes as label differences between each two consecutive basic block begin and end label. When decoding, offsets must be aggregated along with basic block sizes to calculate the final offsets of basic blocks relative to the function address.

This encoding uses smaller values compared to the existing one (offsets relative to function symbol).
Smaller values tend to occupy fewer bytes in ULEB128 encoding. As a result, we get about 17% total reduction in the size of the bb-address-map section (from about 11MB to 9MB for the clang PGO binary).
The extra two bytes (version and feature fields) incur a small 3% size overhead to the `LLVM_BB_ADDR_MAP` section size.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D121346
2022-06-28 07:42:54 -07:00
..
Archive.cpp [Object][Archive] Support a new archive member /<ECSYMBOLS>/ 2022-06-06 17:20:56 -07:00
ArchiveWriter.cpp [Object] Fix updating darwin archives 2022-05-19 10:56:26 -07:00
Binary.cpp [Binary] Promote OffloadBinary to inherit from Binary 2022-06-01 18:40:57 -04:00
CMakeLists.txt [Object][DX] Initial DXContainer parsing support 2022-05-02 13:56:33 -05:00
COFFImportFile.cpp
COFFModuleDefinition.cpp
COFFObjectFile.cpp [Object][COFF] Improve section name parsing 2022-06-16 17:01:10 -07:00
DXContainer.cpp [DX][ObjYAML] Support for parsing DXIL part 2022-06-06 18:46:19 -05:00
Decompressor.cpp
ELF.cpp [Propeller] Encode address offsets of basic blocks relative to the end of the previous basic blocks. 2022-06-28 07:42:54 -07:00
ELFObjectFile.cpp [Propeller] Encode address offsets of basic blocks relative to the end of the previous basic blocks. 2022-06-28 07:42:54 -07:00
Error.cpp [COFF] Check table ptr more thoroughly and ignore empty sections 2022-06-03 18:31:01 +03:00
FaultMapParser.cpp
IRObjectFile.cpp Cleanup includes: DebugInfo & CodeGen 2022-03-12 17:26:40 +01:00
IRSymtab.cpp
MachOObjectFile.cpp [llvm] Fix MachO exports trie parsing. 2022-06-15 09:28:58 -07:00
MachOUniversal.cpp
MachOUniversalWriter.cpp Apply clang-tidy fixes for readability-redundant-smartptr-get in MachOUniversalWriter.cpp (NFC) 2022-03-28 09:18:35 -07:00
Minidump.cpp
ModuleSymbolTable.cpp
Object.cpp [Binary] Promote OffloadBinary to inherit from Binary 2022-06-01 18:40:57 -04:00
ObjectFile.cpp [Binary] Promote OffloadBinary to inherit from Binary 2022-06-01 18:40:57 -04:00
OffloadBinary.cpp [Binary] Further improve malformed input handling for the OffloadBinary 2022-06-24 09:57:44 -04:00
RecordStreamer.cpp
RecordStreamer.h [MC] De-capitalize MCStreamer functions 2022-06-07 00:31:02 -07:00
RelocationResolver.cpp [Object] Support relocation resolver for CSKY 2022-05-13 13:38:17 +08:00
SymbolSize.cpp
SymbolicFile.cpp Cleanup includes: DebugInfo & CodeGen 2022-03-12 17:26:40 +01:00
TapiFile.cpp
TapiUniversal.cpp Apply clang-tidy fixes for readability-redundant-smartptr-get in TapiUniversal.cpp (NFC) 2022-03-28 09:18:36 -07:00
WasmObjectFile.cpp [WebAssembly][Object] Remove requirement that objects must have code sections 2022-06-23 13:56:17 -07:00
WindowsMachineFlag.cpp
WindowsResource.cpp
XCOFFObjectFile.cpp [llvm] Don't use Optional::getValue (NFC) 2022-06-20 22:45:45 -07:00