[all-commits] [llvm/llvm-project] 884099: [BOLT][BAT] Fix handling of split functions

Amir Ayupov via All-commits all-commits at lists.llvm.org
Thu Apr 11 12:07:58 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8840992667180d327ff40ee24354ab8b49605aae
      https://github.com/llvm/llvm-project/commit/8840992667180d327ff40ee24354ab8b49605aae
  Author: Amir Ayupov <aaupov at fb.com>
  Date:   2024-04-11 (Thu, 11 Apr 2024)

  Changed paths:
    M bolt/include/bolt/Profile/DataAggregator.h
    M bolt/lib/Profile/DataAggregator.cpp
    M bolt/test/X86/yaml-secondary-entry-discriminator.s

  Log Message:
  -----------
  [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



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list