We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0bcc37c commit f892dc7Copy full SHA for f892dc7
llvm/include/llvm/Transforms/Utils/SampleProfileLoaderBaseImpl.h
@@ -646,14 +646,13 @@ void SampleProfileLoaderBaseImpl<BT>::findEquivalenceClasses(FunctionT &F) {
646
BasicBlockT *BB1 = &BB;
647
648
// Compute BB1's equivalence class once.
649
- if (EquivalenceClass.count(BB1)) {
+ // By default, blocks are in their own equivalence class.
650
+ auto [It, Inserted] = EquivalenceClass.try_emplace(BB1, BB1);
651
+ if (!Inserted) {
652
LLVM_DEBUG(printBlockEquivalence(dbgs(), BB1));
653
continue;
654
}
655
- // By default, blocks are in their own equivalence class.
- EquivalenceClass[BB1] = BB1;
656
-
657
// Traverse all the blocks dominated by BB1. We are looking for
658
// every basic block BB2 such that:
659
//
0 commit comments