[all-commits] [llvm/llvm-project] 2847e1: [PGO] Fix incorrect count threshold calculation wh...

Ken Matsui via All-commits all-commits at lists.llvm.org
Tue Feb 18 12:51:39 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2847e1501e42bce813db10397230b5f33fc96b99
      https://github.com/llvm/llvm-project/commit/2847e1501e42bce813db10397230b5f33fc96b99
  Author: Ken Matsui <26405363+ken-matsui at users.noreply.github.com>
  Date:   2025-02-18 (Tue, 18 Feb 2025)

  Changed paths:
    M llvm/lib/ProfileData/ProfileSummaryBuilder.cpp
    M llvm/test/Analysis/ProfileSummary/basic.ll

  Log Message:
  -----------
  [PGO] Fix incorrect count threshold calculation when 0% cutoff (#117359)

DefaultCutoffsData does not have an entry for the 0th percentile. As a
result, when the getEntryForPercentile method is called with a
percentile argument of 0, it returns a ProfileSummaryEntry for the 1st
percentile instead. This behavior affects the threshold calculations,
such as getHotCountThreshold, causing them to incorrectly identify some
sample profile counts as hot when they should not be.

This patch addresses the issue by handling the 0th percentile case in
the getEntryForPercentile method. This ensures that when the
-profile-summary-cutoff-hot (or -cold) option is set to 0, no sample
counts are treated as hot (or all sample counts are treated as cold).



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