@@ -968,19 +968,12 @@ static mlir::LogicalResult verify(fir::ResultOp op) {
968968 auto results = parentOp->getResults ();
969969 auto operands = op.getOperands ();
970970
971- if (isa<fir::WhereOp>(parentOp) || isa<fir::LoopOp>(parentOp) ||
972- isa<fir::IterWhileOp>(parentOp)) {
973- if (parentOp->getNumResults () != op.getNumOperands ())
974- return op.emitOpError () << " parent of result must have same arity" ;
975- for (auto e : llvm::zip (results, operands)) {
976- if (std::get<0 >(e).getType () != std::get<1 >(e).getType ())
977- return op.emitOpError ()
978- << " types mismatch between result op and its parent" ;
979- }
980- } else {
981- return op.emitOpError ()
982- << " result only terminates if, do_loop, or iterate_while regions" ;
983- }
971+ if (parentOp->getNumResults () != op.getNumOperands ())
972+ return op.emitOpError () << " parent of result must have same arity" ;
973+ for (auto e : llvm::zip (results, operands))
974+ if (std::get<0 >(e).getType () != std::get<1 >(e).getType ())
975+ return op.emitOpError ()
976+ << " types mismatch between result op and its parent" ;
984977 return success ();
985978}
986979
@@ -1452,16 +1445,6 @@ static mlir::ParseResult parseWhereOp(OpAsmParser &parser,
14521445}
14531446
14541447static LogicalResult verify (fir::WhereOp op) {
1455- // Verify that the entry of each child region does not have arguments.
1456- for (auto ®ion : op.getOperation ()->getRegions ()) {
1457- if (region.empty ())
1458- continue ;
1459-
1460- for (auto &b : region)
1461- if (b.getNumArguments () != 0 )
1462- return op.emitOpError (
1463- " requires that child entry blocks have no arguments" );
1464- }
14651448 if (op.getNumResults () != 0 && op.otherRegion ().empty ())
14661449 return op.emitOpError (" must have an else block if defining values" );
14671450
0 commit comments