[llvm] [ModuleSummary] Avoid redundant domtree/BFI computations (PR #176646)
Aiden Grossman via llvm-commits
llvm-commits at lists.llvm.org
Sun Jan 18 12:04:08 PST 2026
boomanaiden154 wrote:
> Now, the BFI is only fetched from the FAM if it is already available, avoiding the duplicate computation.
If it's not cached but the function has profile data, we're still manually computing the BFI though from what I can see (lines 1066-1071)? I see the difference now though (in either case we are only doing a computation if the function has profile data now whereas before it was unconditional). That would explain the difference in the test. The function does not have profile data, so we return zero instead of a dummy BFI value. Probably wouldn't hurt to update the test to make the function have profile data (an entry count should be sufficient given there's no control flow).
I think only computing BFI for functions that have profile data probably makes sense, but in that case I'm thinking it probably makes more sense to only invoke the GetBFI callback if the function has profile data (although maybe that is pessimizing in the legacy PM?).
https://github.com/llvm/llvm-project/pull/176646
More information about the llvm-commits
mailing list