[all-commits] [llvm/llvm-project] fbf3c1: [BOLT] Include indirect calls/branches in basic bl...

AJMullen via All-commits all-commits at lists.llvm.org
Wed Sep 23 19:25:27 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fbf3c11ccd65fee37c80c9c00c0c4ab638388fe0
      https://github.com/llvm/llvm-project/commit/fbf3c11ccd65fee37c80c9c00c0c4ab638388fe0
  Author: AJMullen <andreas.mullen at arm.com>
  Date:   2026-09-23 (Wed, 23 Sep 2026)

  Changed paths:
    M bolt/lib/Core/BinaryFunctionProfile.cpp
    A bolt/test/AArch64/fix-block-count-multiple.s
    A bolt/test/AArch64/fix-block-counts-indirect-branch.s
    A bolt/test/AArch64/fix-block-counts-indirect-call.s
    A bolt/test/RISCV/fix-block-count-multiple.s
    A bolt/test/RISCV/fix-block-counts-indirect-branch.s
    A bolt/test/RISCV/fix-block-counts-indirect-call.s
    A bolt/test/X86/fix-block-count-multiple.s
    A bolt/test/X86/fix-block-counts-indirect-branch.s
    A bolt/test/X86/fix-block-counts-indirect-call.s

  Log Message:
  -----------
  [BOLT] Include indirect calls/branches in basic block count estimation (#225104)

**Before:** When BOLT adjusts basic block counts in LBR mode it
considers outgoing branch counts when `--fix-block-counts` is enabled.
This adjustment was made according to the counts of direct calls and
branches which are recorded in the `Count` annotation made in
`DataReader::convertBranchData`. Indirect calls and branches are also
recorded within the `CallProfile` annotation, however they do not
contribute to the adjustment of basic block counts.

**After:** When making this adjustment to basic block counts, also
consider the counts of indirect calls and branches within the
`CallProfile` annotation. Do this by summing the execution counts of the
targets from this call/branch and considering them in determining the
maximum execution count of the basic block.

Assisted by: Codex. This was to write the tests for `x86` and `RISCV`
targets.



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