/// min(tileSize[1], %arg3-%j1))
/// step (%arg4, %arg5)
/// The old loop is replaced with the new one.
-void tileParallelLoop(ParallelOp op, llvm::ArrayRef<int64_t> tileSizes);
+///
+/// The function returns the resulting ParallelOps, i.e. {outer_loop_op,
+/// inner_loop_op}.
+std::pair<ParallelOp, ParallelOp>
+tileParallelLoop(ParallelOp op, llvm::ArrayRef<int64_t> tileSizes);
/// Populates patterns for SCF structural type conversions and sets up the
/// provided ConversionTarget with the appropriate legality configuration for
/// %i0 + j0 and %i1 + %j1.
//
/// The old loop is replaced with the new one.
-void mlir::scf::tileParallelLoop(ParallelOp op, ArrayRef<int64_t> tileSizes) {
+std::pair<ParallelOp, ParallelOp>
+mlir::scf::tileParallelLoop(ParallelOp op, ArrayRef<int64_t> tileSizes) {
OpBuilder b(op);
auto zero = b.create<ConstantIndexOp>(op.getLoc(), 0);
SmallVector<Value, 2> tileSizeConstants;
}
op.erase();
+ return std::make_pair(outerLoop, innerLoop);
}
namespace {