[Mlir-commits] [mlir] 82bb3c2 - [mlir] Apply ClangTidy readability findings (NFC)

Adrian Kuegel llvmlistbot at llvm.org
Fri Mar 3 03:41:32 PST 2023


Author: Adrian Kuegel
Date: 2023-03-03T12:41:02+01:00
New Revision: 82bb3c24a76f0a5dcb0daebca2460285172543a3

URL: https://github.com/llvm/llvm-project/commit/82bb3c24a76f0a5dcb0daebca2460285172543a3
DIFF: https://github.com/llvm/llvm-project/commit/82bb3c24a76f0a5dcb0daebca2460285172543a3.diff

LOG: [mlir] Apply ClangTidy readability findings (NFC)

Added: 
    

Modified: 
    mlir/lib/Dialect/Vector/IR/VectorOps.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/Vector/IR/VectorOps.cpp b/mlir/lib/Dialect/Vector/IR/VectorOps.cpp
index a6e0b4ba52055..cabe7d7d95563 100644
--- a/mlir/lib/Dialect/Vector/IR/VectorOps.cpp
+++ b/mlir/lib/Dialect/Vector/IR/VectorOps.cpp
@@ -5497,7 +5497,7 @@ void mlir::vector::MaskOp::print(OpAsmPrinter &p) {
   // Print single masked operation and skip terminator.
   p << " { ";
   Block *singleBlock = &getMaskRegion().getBlocks().front();
-  if (singleBlock && singleBlock->getOperations().size() >= 1)
+  if (singleBlock && !singleBlock->getOperations().empty())
     p.printCustomOrGenericOp(&singleBlock->front());
   p << " }";
 
@@ -5532,13 +5532,12 @@ void MaskOp::ensureTerminator(Region &region, Builder &builder, Location loc) {
   opBuilder.create<vector::YieldOp>(loc, maskedOp->getResults());
   oldYieldOp->dropAllReferences();
   oldYieldOp->erase();
-  return;
 }
 
 LogicalResult MaskOp::verify() {
   // Structural checks.
   Block &block = getMaskRegion().getBlocks().front();
-  if (block.getOperations().size() < 1)
+  if (block.getOperations().empty())
     return emitOpError("expects a terminator within the mask region");
   if (block.getOperations().size() > 2)
     return emitOpError("expects only one operation to mask");


        


More information about the Mlir-commits mailing list