Skip to content

Commit 36fb886

Browse files
[Analysis] Avoid repeated hash lookups (NFC) (#125462)
1 parent 546d03c commit 36fb886

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -944,10 +944,11 @@ class SCEVLoopAddRecRewriter
944944
Operands.push_back(visit(Op));
945945

946946
const Loop *L = Expr->getLoop();
947-
if (0 == Map.count(L))
947+
auto It = Map.find(L);
948+
if (It == Map.end())
948949
return SE.getAddRecExpr(Operands, L, Expr->getNoWrapFlags());
949950

950-
return SCEVAddRecExpr::evaluateAtIteration(Operands, Map[L], SE);
951+
return SCEVAddRecExpr::evaluateAtIteration(Operands, It->second, SE);
951952
}
952953

953954
private:

0 commit comments

Comments
 (0)