| 2431 | /// region arguments. |
| 2432 | template <typename LoopOpT> |
| 2433 | static LogicalResult verifyLoopIterValues(LoopOpT op, ResultRange results, |
| 2434 | ValueRange iterVals) { |
| 2435 | auto loopInits = op.getInitValues(); |
| 2436 | if (iterVals.size() != loopInits.size()) { |
| 2437 | return op.emitOpError("mismatch in number of region iterator values and " |
| 2438 | "loop iterator inits: ") |
| 2439 | << iterVals.size() << " vs " << loopInits.size(); |
| 2440 | } |
| 2441 | |
| 2442 | for (auto [index, initArg, iterArg] : llvm::enumerate(loopInits, iterVals)) { |
| 2443 | if (isa<TensorViewType>(iterArg.getType())) |
| 2444 | return op.emitOpError() << "loop-carried value " << index |
| 2445 | << " is a tensor_view, " |
| 2446 | "which is not supported"; |
| 2447 | |
| 2448 | if (isa<TileView>(iterArg.getType())) |
| 2449 | return op.emitOpError() << "loop-carried value " << index |
| 2450 | << " is a tile view, " |
| 2451 | "which is not supported"; |
| 2452 | |
| 2453 | if (initArg.getType() != iterArg.getType()) |
| 2454 | return op.emitOpError() |
| 2455 | << "init value " << index << " and region iter_value " << index |
| 2456 | << " have different type: " << initArg.getType() |
| 2457 | << " != " << iterArg.getType(); |
| 2458 | } |
| 2459 | |
| 2460 | // Verify that results are not tensor_view or tile_view. |
| 2461 | for (auto [index, result] : llvm::enumerate(results)) { |
| 2462 | if (isa<TensorViewType>(result.getType())) |
| 2463 | return op.emitOpError() << "result type " << index |
| 2464 | << " is a tensor_view, " |
| 2465 | "which is not supported"; |
| 2466 | |
| 2467 | if (isa<TileView>(result.getType())) |
| 2468 | return op.emitOpError() << "result type " << index |
| 2469 | << " is a tile view, " |
| 2470 | "which is not supported"; |
| 2471 | } |
| 2472 | |
| 2473 | return success(); |
| 2474 | } |
| 2475 | |
| 2476 | /// Prints the iterator values for a loop operation. |
| 2477 | static void printLoopIteratorValues(OpAsmPrinter &p, OperandRange initVals, |
no test coverage detected