Skip to content

Commit 44b61e0

Browse files
[Analysis] Avoid repeated hash lookups (NFC) (#127024)
1 parent d096f45 commit 44b61e0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

llvm/lib/Analysis/PhiValues.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,10 @@ void PhiValues::processPhi(const PHINode *Phi,
6767
}
6868
// If the phi did not become part of a component then this phi and that
6969
// phi are part of the same component, so adjust the depth number.
70-
if (!ReachableMap.count(OpDepthNumber))
71-
DepthMap[Phi] = std::min(DepthMap[Phi], OpDepthNumber);
70+
if (!ReachableMap.count(OpDepthNumber)) {
71+
unsigned &Depth = DepthMap[Phi];
72+
Depth = std::min(Depth, OpDepthNumber);
73+
}
7274
} else {
7375
TrackedValues.insert(PhiValuesCallbackVH(PhiOp, this));
7476
}

0 commit comments

Comments
 (0)