[all-commits] [llvm/llvm-project] 9a6084: [PGO][profcheck] ignore explicitly cold functions ...
Mircea Trofin via All-commits
all-commits at lists.llvm.org
Sun Aug 3 18:54:12 PDT 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 9a60841dc446e954cd81d33da96e6566d617a810
https://github.com/llvm/llvm-project/commit/9a60841dc446e954cd81d33da96e6566d617a810
Author: Mircea Trofin <mtrofin at google.com>
Date: 2025-08-04 (Mon, 04 Aug 2025)
Changed paths:
M llvm/lib/Transforms/Utils/ProfileVerify.cpp
A llvm/test/Transforms/PGOProfile/prof-inject-existing.ll
M llvm/test/Transforms/PGOProfile/prof-verify-as-needed.ll
M llvm/test/Transforms/PGOProfile/prof-verify-existing.ll
A llvm/test/Transforms/PGOProfile/prof-verify-known-cold.ll
A llvm/test/Transforms/PGOProfile/prof-verify-no-entrycount.ll
M llvm/test/Transforms/PGOProfile/prof-verify.ll
Log Message:
-----------
[PGO][profcheck] ignore explicitly cold functions (#151778)
There is a case when branch profile metadata is OK to miss, namely, cold functions. The goal of the RFC (see the referenced issue) is to avoid accidental omission (and, at a later date, corruption) of profile metadata. However, asking cold functions to have all their conditional branches marked with "0" probabilities would be overdoing it. We can just ask cold functions to have an explicit 0 entry count.
This patch:
- injects an entry count for functions, unless they have one (synthetic or not)
- if the entry count is 0, doesn't inject, nor does it verify the rest of the metadata
- at verification, if the entry count is missing, it reports an error
Issue #147390
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