Skip to content

Commit 69ffd49

Browse files
[mlir] Use {DenseSet,DenseMap,SemallDenseSet}::contains (NFC)
1 parent d791fa2 commit 69ffd49

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -929,8 +929,7 @@ isVectorizableLoopPtrFactory(const DenseSet<Operation *> &parallelLoops,
929929
int fastestVaryingMemRefDimension) {
930930
return [&parallelLoops, fastestVaryingMemRefDimension](Operation &forOp) {
931931
auto loop = cast<AffineForOp>(forOp);
932-
auto parallelIt = parallelLoops.find(loop);
933-
if (parallelIt == parallelLoops.end())
932+
if (!parallelLoops.contains(loop))
934933
return false;
935934
int memRefDim = -1;
936935
auto vectorizableBody =

mlir/lib/Dialect/Async/Transforms/AsyncToAsyncRuntime.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,7 @@ void AsyncToAsyncRuntimePass::runOnOperation() {
812812
runtimeTarget.addDynamicallyLegalOp<cf::AssertOp>(
813813
[&](cf::AssertOp op) -> bool {
814814
auto func = op->getParentOfType<func::FuncOp>();
815-
return coros->find(func) == coros->end();
815+
return !coros->contains(func);
816816
});
817817

818818
if (failed(applyPartialConversion(module, runtimeTarget,
@@ -842,7 +842,7 @@ void mlir::populateAsyncFuncToAsyncRuntimeConversionPatterns(
842842
[coros](Operation *op) {
843843
auto exec = op->getParentOfType<ExecuteOp>();
844844
auto func = op->getParentOfType<func::FuncOp>();
845-
return exec || coros->find(func) == coros->end();
845+
return exec || !coros->contains(func);
846846
});
847847
}
848848

mlir/lib/Dialect/Shape/Transforms/OutlineShapeComputation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ getInputsOfCluster(const llvm::SmallVector<Operation *, 8> &cluster) {
4949
for (Operation *op : cluster) {
5050
for (Value operand : op->getOperands()) {
5151
Operation *operandOp = operand.getDefiningOp();
52-
if (opSet.find(operandOp) != opSet.end()) {
52+
if (opSet.contains(operandOp)) {
5353
// Skip if defining op is in the cluster.
5454
continue;
5555
}

0 commit comments

Comments
 (0)