Skip to content

Commit 850852e

Browse files
[CodeGen] Avoid repeated hash lookups (NFC) (#124455)
1 parent f09a6f6 commit 850852e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llvm/lib/CodeGen/InlineSpiller.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1578,7 +1578,8 @@ void HoistSpillHelper::runHoistSpills(
15781578
for (auto *const SpillBB : SpillsInSubTree) {
15791579
// When SpillBB is a BB contains original spill, insert the spill
15801580
// to SpillsToRm.
1581-
if (SpillsToKeep.contains(SpillBB) && !SpillsToKeep[SpillBB]) {
1581+
if (auto It = SpillsToKeep.find(SpillBB);
1582+
It != SpillsToKeep.end() && !It->second) {
15821583
MachineInstr *SpillToRm = SpillBBToSpill[SpillBB];
15831584
SpillsToRm.push_back(SpillToRm);
15841585
}

0 commit comments

Comments
 (0)