Skip to content

Commit ebb5856

Browse files
[CodeGen] Avoid repeated hash lookups (NFC) (#123016)
1 parent 94e9813 commit ebb5856

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/CodeGen/CodeGenPrepare.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7690,8 +7690,8 @@ bool CodeGenPrepare::tryToSinkFreeOperands(Instruction *I) {
76907690
// sunk instruction uses, if it is part of a chain that has already been
76917691
// sunk.
76927692
Instruction *OldI = cast<Instruction>(U->getUser());
7693-
if (NewInstructions.count(OldI))
7694-
NewInstructions[OldI]->setOperand(U->getOperandNo(), NI);
7693+
if (auto It = NewInstructions.find(OldI); It != NewInstructions.end())
7694+
It->second->setOperand(U->getOperandNo(), NI);
76957695
else
76967696
U->set(NI);
76977697
Changed = true;

0 commit comments

Comments
 (0)