[Mlir-commits] [mlir] [mlir][Vector] Verify that masked ops implement MaskableOpInterface (PR #108123)

Diego Caballero llvmlistbot at llvm.org
Tue Sep 10 20:53:54 PDT 2024


================
@@ -6124,7 +6124,9 @@ LogicalResult MaskOp::verify() {
   Block &block = getMaskRegion().getBlocks().front();
   if (block.getOperations().empty())
     return emitOpError("expects a terminator within the mask region");
-  if (block.getOperations().size() > 2)
+
+  unsigned numMaskRegionOps = block.getOperations().size();
+  if (numMaskRegionOps > 2)
     return emitOpError("expects only one operation to mask");
----------------
dcaballe wrote:

MaskOp can be empty so that's why `getMaskableOp()` is checking for something similar to return `nullptr`. That's also the reason to use `cast_or_null`

https://github.com/llvm/llvm-project/pull/108123


More information about the Mlir-commits mailing list