[llvm] [BOLT] Synchronize BBHashMap and YamlBBs in BAT mode (PR #145124)

Jinjie Huang via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 28 05:32:34 PST 2025


Jinjie-Huang wrote:

I also seem unable to reproduce this issue with curl in isolation, and the binary from the scenario where it is reproducible is too large to be shared.

However, I've added some debug prints in both BoltAddressTranslation::saveMetadata() and BoltAddressTranslation::write(). From the output, I can see that after optimization, BOLT does indeed insert 3 BBs into Curl_client_write, which correspond to the original offset 0x1f1, and the hashes is 0:
```
InputOffset: 0x1f1, Index: 42, Hash: 0x0
InputOffset: 0x1f1, Index: 43, Hash: 0x0
InputOffset: 0x1f1, Index: 44, Hash: 0x0
```
This seems to confirm that certain optimizations are inserting new BBs (not from the original binary) with a hash value of 0. While these zero-hash BBs might still be meaningful for BAT's purposes (specifically for regular .fdata), for the YAML profile, the lack of a hash value breaks its ability to perform infer-stale-profile.




https://github.com/llvm/llvm-project/pull/145124


More information about the llvm-commits mailing list