[Mlir-commits] [mlir] 4bc0916 - [Linalg] Avoid repeated hash lookups (NFC) (#111328)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Mon Oct 7 06:56:26 PDT 2024


Author: Kazu Hirata
Date: 2024-10-07T06:56:22-07:00
New Revision: 4bc0916011c4fc02de29e09905400138cbec909f

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

LOG: [Linalg] Avoid repeated hash lookups (NFC) (#111328)

Added: 
    

Modified: 
    mlir/lib/Dialect/Linalg/IR/LinalgInterfaces.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/Linalg/IR/LinalgInterfaces.cpp b/mlir/lib/Dialect/Linalg/IR/LinalgInterfaces.cpp
index 0b5191664a9e2f..40795879c3026d 100644
--- a/mlir/lib/Dialect/Linalg/IR/LinalgInterfaces.cpp
+++ b/mlir/lib/Dialect/Linalg/IR/LinalgInterfaces.cpp
@@ -521,8 +521,9 @@ struct ConvAccessExprWalker
         unConvolvedDims.erase(dimPos);
         // If a duplicate dim is marked as convolved, the pair of the duplicate
         // dim must be removed from the map as well.
-        if (convolvedDimMapping.contains(dimPos)) {
-          int64_t pairedDim = convolvedDimMapping[dimPos];
+        auto it = convolvedDimMapping.find(dimPos);
+        if (it != convolvedDimMapping.end()) {
+          int64_t pairedDim = it->second;
           convolvedDims.erase(pairedDim);
           unConvolvedDims.erase(pairedDim);
           strideAndDilationMapping.erase(pairedDim);


        


More information about the Mlir-commits mailing list