Skip to content

Commit 76f2fa8

Browse files
[Transforms] Avoid repeated hash lookups (NFC) (#110400)
1 parent 19e5a52 commit 76f2fa8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/include/llvm/Transforms/Utils/SampleProfileInference.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,9 +247,10 @@ FlowFunction SampleProfileInference<BT>::createFlowFunction(
247247
// Create FlowBlocks
248248
for (const auto *BB : BasicBlocks) {
249249
FlowBlock Block;
250-
if (SampleBlockWeights.contains(BB)) {
250+
auto It = SampleBlockWeights.find(BB);
251+
if (It != SampleBlockWeights.end()) {
251252
Block.HasUnknownWeight = false;
252-
Block.Weight = SampleBlockWeights[BB];
253+
Block.Weight = It->second;
253254
} else {
254255
Block.HasUnknownWeight = true;
255256
Block.Weight = 0;

0 commit comments

Comments
 (0)