Skip to content

Commit

Permalink
[CodeGen] Avoid repeated hash lookups (NFC) (llvm#123016)
Browse files Browse the repository at this point in the history
  • Loading branch information
kazutakahirata authored Jan 15, 2025
1 parent 94e9813 commit ebb5856
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions llvm/lib/CodeGen/CodeGenPrepare.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7690,8 +7690,8 @@ bool CodeGenPrepare::tryToSinkFreeOperands(Instruction *I) {
// sunk instruction uses, if it is part of a chain that has already been
// sunk.
Instruction *OldI = cast<Instruction>(U->getUser());
if (NewInstructions.count(OldI))
NewInstructions[OldI]->setOperand(U->getOperandNo(), NI);
if (auto It = NewInstructions.find(OldI); It != NewInstructions.end())
It->second->setOperand(U->getOperandNo(), NI);
else
U->set(NI);
Changed = true;
Expand Down

0 comments on commit ebb5856

Please sign in to comment.