Skip to content

Commit ef436f3

Browse files
[mlir] Avoid repeated hash lookups (NFC) (#112158)
1 parent 23c8340 commit ef436f3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

mlir/lib/Transforms/SROA.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,11 @@ computeDestructuringInfo(DestructurableMemorySlot &slot,
100100
mlir::getForwardSlice(slot.ptr, &forwardSlice);
101101
for (Operation *user : forwardSlice) {
102102
// If the next operation has no blocking uses, everything is fine.
103-
if (!info.userToBlockingUses.contains(user))
103+
auto it = info.userToBlockingUses.find(user);
104+
if (it == info.userToBlockingUses.end())
104105
continue;
105106

106-
SmallPtrSet<OpOperand *, 4> &blockingUses = info.userToBlockingUses[user];
107+
SmallPtrSet<OpOperand *, 4> &blockingUses = it->second;
107108
auto promotable = dyn_cast<PromotableOpInterface>(user);
108109

109110
// An operation that has blocking uses must be promoted. If it is not

0 commit comments

Comments
 (0)