Skip to content

Commit fa9fb2a

Browse files
[CodeGen] Avoid repeated hash lookups (NFC) (#123447)
1 parent 80e0cba commit fa9fb2a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/CodeGen/MachineSink.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1784,11 +1784,12 @@ bool MachineSinking::SinkInstruction(MachineInstr &MI, bool &SawStore,
17841784
for (auto &MO : MI.all_defs()) {
17851785
if (!MO.getReg().isVirtual())
17861786
continue;
1787-
if (!SeenDbgUsers.count(MO.getReg()))
1787+
auto It = SeenDbgUsers.find(MO.getReg());
1788+
if (It == SeenDbgUsers.end())
17881789
continue;
17891790

17901791
// Sink any users that don't pass any other DBG_VALUEs for this variable.
1791-
auto &Users = SeenDbgUsers[MO.getReg()];
1792+
auto &Users = It->second;
17921793
for (auto &User : Users) {
17931794
MachineInstr *DbgMI = User.getPointer();
17941795
if (User.getInt()) {

0 commit comments

Comments
 (0)