forked from OSchip/llvm-project
6aa735ceaf
Summary: Gracefully handle binaries with split functions where two fragments are folded into one, resulting in a fragment with two parent functions. This behavior is expected in GCC8+ with -O2 optimization level, where both function splitting and ICF are enabled by default. On the BOLT side, the changes are: - BinaryFunction: allow multiple parent fragments: - `ParentFragment` --> `ParentFragments`, - `setParentFragment` --> `addParentFragment`. - BinaryContext: - `populateJumpTables`: mark fragments to be skipped later, - `registerFragment`: add a name heuristic check, return false if it failed, - `processInterproceduralReferences`: check if `registerFragment` succeeded, otherwise issue a warning, - `skipMarkedFragments`: move out fragment traversal and skipping from `populateJumpTables` into a separate function. This change fixes an issue where unrelated functions might be registered as fragments: ``` BOLT-WARNING: interprocedural reference between unrelated fragments: bad_gs/1(*2) and amd_decode_mce.cold.27/1(*2) ``` (Linux kernel binary) (cherry picked from FBD32786688) |
||
---|---|---|
.. | ||
Core | ||
Passes | ||
Profile | ||
Rewrite | ||
RuntimeLibs | ||
Target | ||
Utils | ||
CMakeLists.txt |