Skip to content

Commit 4bc0916

Browse files
[Linalg] Avoid repeated hash lookups (NFC) (#111328)
1 parent 4c9c2d6 commit 4bc0916

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -521,8 +521,9 @@ struct ConvAccessExprWalker
521521
unConvolvedDims.erase(dimPos);
522522
// If a duplicate dim is marked as convolved, the pair of the duplicate
523523
// dim must be removed from the map as well.
524-
if (convolvedDimMapping.contains(dimPos)) {
525-
int64_t pairedDim = convolvedDimMapping[dimPos];
524+
auto it = convolvedDimMapping.find(dimPos);
525+
if (it != convolvedDimMapping.end()) {
526+
int64_t pairedDim = it->second;
526527
convolvedDims.erase(pairedDim);
527528
unConvolvedDims.erase(pairedDim);
528529
strideAndDilationMapping.erase(pairedDim);

0 commit comments

Comments
 (0)