Skip to content

Commit d82eccc

Browse files
committed
[RegAllocFast] Avoid duplicate hash lookup (NFC)
1 parent 658b260 commit d82eccc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/CodeGen/RegAllocFast.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,9 @@ class InstrPosIndexes {
8181
/// instructions index has been reassigned.
8282
bool getIndex(const MachineInstr &MI, uint64_t &Index) {
8383
assert(MI.getParent() == CurMBB && "MI is not in CurMBB");
84-
if (Instr2PosIndex.count(&MI)) {
85-
Index = Instr2PosIndex[&MI];
84+
auto It = Instr2PosIndex.find(&MI);
85+
if (It != Instr2PosIndex.end()) {
86+
Index = It->second;
8687
return false;
8788
}
8889

0 commit comments

Comments
 (0)