[Mlir-commits] [mlir] [mlir][spirv] Update verifier for `spirv.mlir.merge` (PR #133427)

Longsheng Mou llvmlistbot at llvm.org
Fri Mar 28 18:14:40 PDT 2025


================
@@ -382,16 +392,7 @@ void LoopOp::addEntryAndMergeBlock(OpBuilder &builder) {
 //===----------------------------------------------------------------------===//
 
 LogicalResult MergeOp::verify() {
-  auto *parentOp = (*this)->getParentOp();
-  if (!parentOp || !isa<spirv::SelectionOp, spirv::LoopOp>(parentOp))
-    return emitOpError(
-        "expected parent op to be 'spirv.mlir.selection' or 'spirv.mlir.loop'");
-
-  // TODO: This check should be done in `verifyRegions` of parent op.
-  Block &parentLastBlock = (*this)->getParentRegion()->back();
-  if (getOperation() != parentLastBlock.getTerminator())
-    return emitOpError("can only be used in the last block of "
-                       "'spirv.mlir.selection' or 'spirv.mlir.loop'");
+  // Verification is performed in parent op.
   return success();
 }
----------------
CoTinker wrote:

Okay, I see. I'll amend it.

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


More information about the Mlir-commits mailing list