[all-commits] [llvm/llvm-project] 0abd74: [PGO] Use the sum of profile counts to fix the fun...

xur-llvm via All-commits all-commits at lists.llvm.org
Wed Dec 16 13:38:16 PST 2020


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0abd744597ee502b6424e5a99fb940ca0f866fe9
      https://github.com/llvm/llvm-project/commit/0abd744597ee502b6424e5a99fb940ca0f866fe9
  Author: Rong Xu <xur at google.com>
  Date:   2020-12-16 (Wed, 16 Dec 2020)

  Changed paths:
    M llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
    A llvm/test/Transforms/PGOProfile/Inputs/fix_bfi.proftext
    M llvm/test/Transforms/PGOProfile/bfi_verification.ll
    A llvm/test/Transforms/PGOProfile/fix_bfi.ll

  Log Message:
  -----------
  [PGO] Use the sum of profile counts to fix the function entry count

Raw profile count values for each BB are not kept after profile
annotation. We record function entry count and branch weights
and use them to compute the count when needed.  This mechanism
works well in a perfect world, but often breaks in real programs,
because of number prevision, inconsistent profile, or bugs in
BFI). This patch uses sum of profile count values to fix
function entry count to make the BFI count close to real profile
counts.

Differential Revision: https://reviews.llvm.org/D61540




More information about the All-commits mailing list