1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-18 18:42:46 +02:00

[CSSPGO][NFC] Fix a debug dump issue.

During context promotion, intermediate nodes that are on a call path but do not come with a profile can be promoted together with their parent nodes. Do not print sample context string for such nodes since they do not have profile.

Reviewed By: wenlei

Differential Revision: https://reviews.llvm.org/D99441
This commit is contained in:
Hongtao Yu 2021-03-26 13:18:26 -07:00
parent 20b2eb8304
commit 515f49499f

View File

@ -542,8 +542,11 @@ ContextTrieNode &SampleContextTracker::promoteMergeContextSamplesTree(
} else {
// Destination node exists, merge samples for the context tree
mergeContextNode(FromNode, *ToNode, ContextStrToRemove);
LLVM_DEBUG(dbgs() << " Context promoted and merged to: "
<< ToNode->getFunctionSamples()->getContext() << "\n");
LLVM_DEBUG({
if (ToNode->getFunctionSamples())
dbgs() << " Context promoted and merged to: "
<< ToNode->getFunctionSamples()->getContext() << "\n";
});
// Recursively promote and merge children
for (auto &It : FromNode.getAllChildContext()) {