[BOLT][BAT] Fix handling of split functions
Move BAT parent function lookup outside `getLocationName`, to the scope where we retrieve `FuncBranchData` linked with the function. Previously DataAggregator would store branch profile recorded in the split fragment in `FuncBranchData` associated with the fragment, and perform name translation in `getLocationName` for symbol name only. This works for fdata profile which is printed out as-is, but doesn't work with BAT YAML profile writer which requires a combined profile. The issue necessitated `fixupBATProfile` which partially addressed the issue (reassigned inter-fragment calls back into intra-function branches). However, `fixupBATProfile` fails to address disjoint profiles (i.e. doesn't merge `FuncBranchData` for fragments back into parent). This diff eliminates the need for `fixupBATProfile` by removing the root cause of the issue. Test Plan: NFC for existing tests Reviewers: ayermolo, dcci, rafaelauler, maksfb Reviewed By: maksfb Pull Request: https://github.com/llvm/llvm-project/pull/87569
parent
a5eaec83
Please register or sign in to comment