Skip to content

Commit e838ca1

Browse files
[CodeGen] Avoid repeated hash lookups (NFC) (llvm#131067)
1 parent ca641b2 commit e838ca1

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

llvm/lib/CodeGen/RDFLiveness.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -687,10 +687,8 @@ void Liveness::computePhiInfo() {
687687

688688
if (MidDefs.hasCoverOf(UR))
689689
continue;
690-
if (Subs.find(MidDefs) == Subs.end()) {
691-
Subs.insert({MidDefs, SubMap(1, RefHash(), RefEqual(PRI))});
692-
}
693-
SubMap &SM = Subs.at(MidDefs);
690+
SubMap &SM = Subs.try_emplace(MidDefs, 1, RefHash(), RefEqual(PRI))
691+
.first->second;
694692

695693
// General algorithm:
696694
// for each (R,U) : U is use node of R, U is reached by PA

0 commit comments

Comments
 (0)