Skip to content

Commit a2661a9

Browse files
[mlir] Avoid repeated hash lookups (NFC) (#132332)
1 parent e97a4cd commit a2661a9

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

mlir/lib/Dialect/Affine/Utils/LoopFusionUtils.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -612,11 +612,8 @@ bool mlir::affine::getFusionComputeCost(AffineForOp srcForOp,
612612
// 'insertPointParent'.
613613
getAffineForIVs(*user, &loops);
614614
if (llvm::is_contained(loops, cast<AffineForOp>(insertPointParent))) {
615-
if (auto forOp = dyn_cast_or_null<AffineForOp>(user->getParentOp())) {
616-
if (computeCostMap.count(forOp) == 0)
617-
computeCostMap[forOp] = 0;
618-
computeCostMap[forOp] -= 1;
619-
}
615+
if (auto forOp = dyn_cast_or_null<AffineForOp>(user->getParentOp()))
616+
--computeCostMap[forOp];
620617
}
621618
}
622619
}

0 commit comments

Comments
 (0)