[flang-commits] [flang] [mlir] [mlir][TilingInterface] Use `LoopLikeOpInterface` in tiling using SCF to unify tiling with `scf.for` and `scf.forall`. (PR #77874)

via flang-commits flang-commits at lists.llvm.org
Thu Jan 18 00:13:17 PST 2024


================
@@ -25,6 +25,28 @@ class RewriterBase;
 using NewYieldValuesFn = std::function<SmallVector<Value>(
     OpBuilder &b, Location loc, ArrayRef<BlockArgument> newBbArgs)>;
 
+/// A function that allows returning additional yielded values during
+/// `yieldTiledValuesAndReplace`.
+/// - `ivs` induction variable for the loop.
+/// - `newBbArgs` basic block arguments corresponding to newly added iter_args.
+/// - `tiledValues` the tiled values to return. Must be of same size as
+///   `newbbArgs`, each element of this array is inserted into the corresponding
+///   element in `newbbArgs`.
+/// - `resultOffsets` is of the same size as `tiledValues` and represents
+///   the offsets to use when inserting corresponding element from `tiledValues`
+///   into the element from `newBbArgs`.
+/// - `resultSizes` is of the same size as `tiledValues` and represents
+///   the size of the corresponding element from `tiledValues` inserted into
+///   the element from `newBbArgs`.
+/// - `resultStrides` is of the same size as `tiledValues` and represents
+///   the strides to use when inserting corresponding element from `tiledValues`
+///   into the element from `newBbArgs`.
+using YieldTiledValuesFn = std::function<LogicalResult(
----------------
MaheshRavishankar wrote:

Ok, trying, but I have hit some really bad footguns with `function_ref` in the past. I'd rather just pass everything by value.

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


More information about the flang-commits mailing list