Skip to content

Commit fe9f1a2

Browse files
[Affine] Avoid repeated hash lookups (NFC) (#111226)
1 parent 8aa76d3 commit fe9f1a2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,8 +350,7 @@ void PipelineDataTransfer::runOnAffineForOp(AffineForOp forOp) {
350350
}
351351
// Everything else (including compute ops and dma finish) are shifted by one.
352352
for (auto &op : forOp.getBody()->without_terminator())
353-
if (!instShiftMap.contains(&op))
354-
instShiftMap[&op] = 1;
353+
instShiftMap.try_emplace(&op, 1);
355354

356355
// Get shifts stored in map.
357356
SmallVector<uint64_t, 8> shifts(forOp.getBody()->getOperations().size());

0 commit comments

Comments
 (0)