Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -1571,7 +1571,8 @@ void BlockFrequencyInfoImpl<BT>::initTransitionProbabilities(
SmallPtrSet<const BlockT *, 2> UniqueSuccs;
for (const auto SI : children<const BlockT *>(BB)) {
// Ignore cold blocks
if (!BlockIndex.contains(SI))
auto BlockIndexIt = BlockIndex.find(SI);
if (BlockIndexIt == BlockIndex.end())
continue;
// Ignore parallel edges between BB and SI blocks
if (!UniqueSuccs.insert(SI).second)
Expand All @@ -1583,7 +1584,7 @@ void BlockFrequencyInfoImpl<BT>::initTransitionProbabilities(

auto EdgeProb =
Scaled64::getFraction(EP.getNumerator(), EP.getDenominator());
size_t Dst = BlockIndex.find(SI)->second;
size_t Dst = BlockIndexIt->second;
Succs[Src].push_back(std::make_pair(Dst, EdgeProb));
SumProb[Src] += EdgeProb;
}
Expand Down