[Mlir-commits] [mlir] ef436f3 - [mlir] Avoid repeated hash lookups (NFC) (#112158)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Mon Oct 14 06:55:33 PDT 2024


Author: Kazu Hirata
Date: 2024-10-14T06:55:30-07:00
New Revision: ef436f3f60c14935d244d73f11d008f272d123e1

URL: https://github.com/llvm/llvm-project/commit/ef436f3f60c14935d244d73f11d008f272d123e1
DIFF: https://github.com/llvm/llvm-project/commit/ef436f3f60c14935d244d73f11d008f272d123e1.diff

LOG: [mlir] Avoid repeated hash lookups (NFC) (#112158)

Added: 
    

Modified: 
    mlir/lib/Transforms/SROA.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Transforms/SROA.cpp b/mlir/lib/Transforms/SROA.cpp
index aca252b01dce7b..db8be38a51443e 100644
--- a/mlir/lib/Transforms/SROA.cpp
+++ b/mlir/lib/Transforms/SROA.cpp
@@ -100,10 +100,11 @@ computeDestructuringInfo(DestructurableMemorySlot &slot,
   mlir::getForwardSlice(slot.ptr, &forwardSlice);
   for (Operation *user : forwardSlice) {
     // If the next operation has no blocking uses, everything is fine.
-    if (!info.userToBlockingUses.contains(user))
+    auto it = info.userToBlockingUses.find(user);
+    if (it == info.userToBlockingUses.end())
       continue;
 
-    SmallPtrSet<OpOperand *, 4> &blockingUses = info.userToBlockingUses[user];
+    SmallPtrSet<OpOperand *, 4> &blockingUses = it->second;
     auto promotable = dyn_cast<PromotableOpInterface>(user);
 
     // An operation that has blocking uses must be promoted. If it is not


        


More information about the Mlir-commits mailing list