[llvm] [BOLT][ICP] Propagate parent hash to newly inserted BBs for BAT (PR #171044)
Jinjie Huang via llvm-commits
llvm-commits at lists.llvm.org
Sat Dec 13 10:54:36 PST 2025
Jinjie-Huang wrote:
@aaupov HI, thanks for the suggestion!
There's a subtle detail here: in ICP, the `InputOffset` for inserted BB is derived from the original call instruction by default([code](https://github.com/llvm/llvm-project/blob/llvmorg-22-init/bolt/lib/Passes/IndirectCallPromotion.cpp#L786-L791)). This seems to make it difficult in BoltAddressTranslation::write() to look up the original BB's hash/index using the inserted/copied BB's InputOffset.
So, I'd like to propose that we could directly reuse the InputOffset of the original BB for any inserted/copied BBs(not sure how other passes handle this, but perhaps they should all be consistent). This would be also natively compatible with the final BAT writing process, and the hash/index of the original BB will then be automatically looked up in the BBHashMap, WDYT?
https://github.com/llvm/llvm-project/pull/171044
More information about the llvm-commits
mailing list