Skip to content

Commit 5fdda41

Browse files
[Transforms] Avoid repeated hash lookups (NFC) (#111329)
1 parent 0614b3c commit 5fdda41

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

mlir/lib/Transforms/Mem2Reg.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,10 +285,11 @@ LogicalResult MemorySlotPromotionAnalyzer::computeBlockingUses(
285285
mlir::getForwardSlice(slot.ptr, &forwardSlice);
286286
for (Operation *user : forwardSlice) {
287287
// If the next operation has no blocking uses, everything is fine.
288-
if (!userToBlockingUses.contains(user))
288+
auto it = userToBlockingUses.find(user);
289+
if (it == userToBlockingUses.end())
289290
continue;
290291

291-
SmallPtrSet<OpOperand *, 4> &blockingUses = userToBlockingUses[user];
292+
SmallPtrSet<OpOperand *, 4> &blockingUses = it->second;
292293

293294
SmallVector<OpOperand *> newBlockingUses;
294295
// If the operation decides it cannot deal with removing the blocking uses,

0 commit comments

Comments
 (0)