Skip to content

Commit 2461bc1

Browse files
[Convergence] Avoid repeated hash lookups (NFC) (#107515)
1 parent bd15595 commit 2461bc1

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

llvm/include/llvm/IR/GenericConvergenceVerifierImpl.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,11 +210,10 @@ void GenericConvergenceVerifier<ContextT>::verify(const DominatorTreeT &DT) {
210210
// Propagate token liveness
211211
for (auto *Succ : successors(BB)) {
212212
auto *SuccNode = DT.getNode(Succ);
213-
auto LTIt = LiveTokenMap.find(Succ);
214-
if (LTIt == LiveTokenMap.end()) {
213+
auto [LTIt, Inserted] = LiveTokenMap.try_emplace(Succ);
214+
if (Inserted) {
215215
// We're the first predecessor: all tokens which dominate the
216216
// successor are live for now.
217-
LTIt = LiveTokenMap.try_emplace(Succ).first;
218217
for (auto LiveToken : LiveTokens) {
219218
if (!DT.dominates(DT.getNode(LiveToken->getParent()), SuccNode))
220219
break;

0 commit comments

Comments
 (0)