Skip to content

Commit f9bb4b7

Browse files
committed
discard BB profiles with a hash of 0
1 parent e493e90 commit f9bb4b7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

bolt/lib/Profile/DataAggregator.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2417,6 +2417,8 @@ std::error_code DataAggregator::writeBATYAML(BinaryContext &BC,
24172417
// Skip printing if there's no profile data
24182418
llvm::erase_if(
24192419
YamlBF.Blocks, [](const yaml::bolt::BinaryBasicBlockProfile &YamlBB) {
2420+
if ((size_t)YamlBB.Hash == 0)
2421+
return true;
24202422
auto HasCount = [](const auto &SI) { return SI.Count; };
24212423
bool HasAnyCount = YamlBB.ExecCount ||
24222424
llvm::any_of(YamlBB.Successors, HasCount) ||

0 commit comments

Comments
 (0)