Skip to content

Commit 01a0e85

Browse files
[Conversion] Avoid repeated hash lookups (NFC) (#111637)
1 parent c911b0a commit 01a0e85

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

mlir/lib/Conversion/SCFToGPU/SCFToGPU.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -509,12 +509,11 @@ static LogicalResult processParallelLoop(
509509
ensureLaunchIndependent(cloningMap.lookupOrDefault(step))});
510510
// todo(herhut,ravishankarm): Update the behavior of setMappingAttr
511511
// when this condition is relaxed.
512-
if (bounds.contains(processor)) {
512+
if (!bounds.try_emplace(processor, launchBound).second) {
513513
return rewriter.notifyMatchFailure(
514514
parallelOp, "cannot redefine the bound for processor " +
515515
Twine(static_cast<int64_t>(processor)));
516516
}
517-
bounds[processor] = launchBound;
518517
}
519518
if (!boundIsPrecise) {
520519
// We are using an approximation, create a surrounding conditional.

0 commit comments

Comments
 (0)