Skip to content

Commit e96214d

Browse files
committed
Fix some clang-tidy reports in MLIR (NFC)
Mostly replace uses of `container.size()` with `container.empty()` in conditionals when applicable.
1 parent da4d716 commit e96214d

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

mlir/lib/Transforms/LoopFusion.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1565,7 +1565,7 @@ struct GreedyFusion {
15651565
// producer scenarios will still go through profitability analysis
15661566
// if only one of the stores is involved the producer-consumer
15671567
// relationship of the candidate loops.
1568-
assert(producerStores.size() > 0 && "Expected producer store");
1568+
assert(!producerStores.empty() && "Expected producer store");
15691569
if (producerStores.size() > 1)
15701570
LLVM_DEBUG(llvm::dbgs() << "Skipping profitability analysis. Not "
15711571
"supported for this case\n");

mlir/lib/Transforms/NormalizeMemRefs.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,6 @@ void NormalizeMemRefs::normalizeFuncOpMemRefs(FuncOp funcOp,
460460
MemRefType newMemRefType = normalizeMemRefType(memrefType, b,
461461
/*numSymbolicOperands=*/0);
462462
resultTypes.push_back(newMemRefType);
463-
continue;
464463
}
465464

466465
FunctionType newFuncType =

mlir/lib/Transforms/ParallelLoopCollapsing.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ struct ParallelLoopCollapsing
2828
// The common case for GPU dialect will be simplifying the ParallelOp to 3
2929
// arguments, so we do that here to simplify things.
3030
llvm::SmallVector<std::vector<unsigned>, 3> combinedLoops;
31-
if (clCollapsedIndices0.size())
31+
if (!clCollapsedIndices0.empty())
3232
combinedLoops.push_back(clCollapsedIndices0);
33-
if (clCollapsedIndices1.size())
33+
if (!clCollapsedIndices1.empty())
3434
combinedLoops.push_back(clCollapsedIndices1);
35-
if (clCollapsedIndices2.size())
35+
if (!clCollapsedIndices2.empty())
3636
combinedLoops.push_back(clCollapsedIndices2);
3737
collapseParallelLoops(op, combinedLoops);
3838
});

0 commit comments

Comments
 (0)