From f9bb4b70a705ae2e1268d4eb1f9ea983a5e5bce5 Mon Sep 17 00:00:00 2001 From: huangjinjie Date: Wed, 26 Nov 2025 18:11:30 +0800 Subject: [PATCH] discard BB profiles with a hash of 0 --- bolt/lib/Profile/DataAggregator.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bolt/lib/Profile/DataAggregator.cpp b/bolt/lib/Profile/DataAggregator.cpp index 6b969011df589..73baceae7af55 100644 --- a/bolt/lib/Profile/DataAggregator.cpp +++ b/bolt/lib/Profile/DataAggregator.cpp @@ -2417,6 +2417,8 @@ std::error_code DataAggregator::writeBATYAML(BinaryContext &BC, // Skip printing if there's no profile data llvm::erase_if( YamlBF.Blocks, [](const yaml::bolt::BinaryBasicBlockProfile &YamlBB) { + if ((size_t)YamlBB.Hash == 0) + return true; auto HasCount = [](const auto &SI) { return SI.Count; }; bool HasAnyCount = YamlBB.ExecCount || llvm::any_of(YamlBB.Successors, HasCount) ||