[Mlir-commits] [mlir] fe9f1a2 - [Affine] Avoid repeated hash lookups (NFC) (#111226)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Sat Oct 5 09:50:17 PDT 2024


Author: Kazu Hirata
Date: 2024-10-05T09:50:14-07:00
New Revision: fe9f1a215e0bdb5308f0dc5021bd02b173a45dbc

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

LOG: [Affine] Avoid repeated hash lookups (NFC) (#111226)

Added: 
    

Modified: 
    mlir/lib/Dialect/Affine/Transforms/PipelineDataTransfer.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/Affine/Transforms/PipelineDataTransfer.cpp b/mlir/lib/Dialect/Affine/Transforms/PipelineDataTransfer.cpp
index deb530b4cf1c95..4be99aa1973805 100644
--- a/mlir/lib/Dialect/Affine/Transforms/PipelineDataTransfer.cpp
+++ b/mlir/lib/Dialect/Affine/Transforms/PipelineDataTransfer.cpp
@@ -350,8 +350,7 @@ void PipelineDataTransfer::runOnAffineForOp(AffineForOp forOp) {
   }
   // Everything else (including compute ops and dma finish) are shifted by one.
   for (auto &op : forOp.getBody()->without_terminator())
-    if (!instShiftMap.contains(&op))
-      instShiftMap[&op] = 1;
+    instShiftMap.try_emplace(&op, 1);
 
   // Get shifts stored in map.
   SmallVector<uint64_t, 8> shifts(forOp.getBody()->getOperations().size());


        


More information about the Mlir-commits mailing list