diff --git a/mlir/include/mlir/Dialect/SCF/Transforms.h b/mlir/include/mlir/Dialect/SCF/Transforms.h --- a/mlir/include/mlir/Dialect/SCF/Transforms.h +++ b/mlir/include/mlir/Dialect/SCF/Transforms.h @@ -44,7 +44,11 @@ /// min(tileSize[1], %arg3-%j1)) /// step (%arg4, %arg5) /// The old loop is replaced with the new one. -void tileParallelLoop(ParallelOp op, llvm::ArrayRef tileSizes); +/// +/// The function returns the resulting ParallelOps, i.e. {outer_loop_op, +/// inner_loop_op}. +std::pair +tileParallelLoop(ParallelOp op, llvm::ArrayRef tileSizes); /// Populates patterns for SCF structural type conversions and sets up the /// provided ConversionTarget with the appropriate legality configuration for diff --git a/mlir/lib/Dialect/SCF/Transforms/ParallelLoopTiling.cpp b/mlir/lib/Dialect/SCF/Transforms/ParallelLoopTiling.cpp --- a/mlir/lib/Dialect/SCF/Transforms/ParallelLoopTiling.cpp +++ b/mlir/lib/Dialect/SCF/Transforms/ParallelLoopTiling.cpp @@ -37,7 +37,8 @@ /// %i0 + j0 and %i1 + %j1. // /// The old loop is replaced with the new one. -void mlir::scf::tileParallelLoop(ParallelOp op, ArrayRef tileSizes) { +std::pair +mlir::scf::tileParallelLoop(ParallelOp op, ArrayRef tileSizes) { OpBuilder b(op); auto zero = b.create(op.getLoc(), 0); SmallVector tileSizeConstants; @@ -125,6 +126,7 @@ } op.erase(); + return std::make_pair(outerLoop, innerLoop); } namespace {