MLIR 23.0.0git
Utils.h
Go to the documentation of this file.
1//===- Utils.h - Utilities to support the Linalg dialect --------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef MLIR_DIALECT_LINALG_UTILS_UTILS_H
10#define MLIR_DIALECT_LINALG_UTILS_UTILS_H
11
15#include "llvm/ADT/StringSet.h"
16#include <optional>
17
18namespace mlir {
19class AffineExpr;
20class AffineMap;
21class PatternRewriter;
22
23namespace affine {
24class AffineForOp;
25} // namespace affine
26
27namespace tensor {
28class ExtractSliceOp;
29} // namespace tensor
30
31namespace linalg {
32
33//===----------------------------------------------------------------------===//
34// Utilities for inferring various semantics properties of Linalg ops.
35//===----------------------------------------------------------------------===//
36
37/// Compute inverse permutation for the destination tensor (i.e. in the packed
38/// domain).
40 PackingMetadata &metadata);
41
42/// Compute inverse permutation for the source tensor (i.e. in the packed
43/// domain).
45 PackingMetadata &metadata);
46
47//===----------------------------------------------------------------------===//
48// General utilities
49//===----------------------------------------------------------------------===//
50
51/// Check if all indexing maps are projected permutations.
53
54/// Detect whether `r` has only ConstantOp, ElementwiseMappable and YieldOp.
56
57/// Check if a LinalgOp is an element-wise operation.
58bool isElementwise(LinalgOp op);
59
60/// Check if iterator type has "parallel" semantics.
61bool isParallelIterator(utils::IteratorType iteratorType);
62
63/// Check if iterator type has "reduction" semantics.
64bool isReductionIterator(utils::IteratorType iteratorType);
65
66/// Create a tensor::PadOp that pads `source` to the shape of `type` whose sizes
67/// are assumed to be greater than the dynamic `source` size. If `typeDynDims`
68/// is specified, then it must contain the sizes of all the dynamic dimensions
69/// in order of appearance in `type`, otherwise the function will pad those
70/// values to `0`. The padding introduces trailing `pad` values until the target
71/// size is met. If `source` is defined by one or more LinalgOps that have been
72/// padded with the same value and sizes, return their padded result instead of
73/// creating a tensor::PadOp.
74///
75/// Example:
76/// ```
77/// %0 = tensor.extract_slice %arg0 [%iv0, %iv1] [%sz0, %sz1]
78/// %1 = tensor.pad %0 low[0, 0] high[...] { tensor.yield %cst }
79/// %2 = linalg.matmul ins(...) outs(%1)
80/// %3 = tensor.extract_slice %2 [0, 0] [%sz0, %sz1]
81/// ```
82/// makeComposedPadHighOp(source=%3, pad=%cst) returns %2
83/// makeComposedPadHighOp(source=%3, pad=%other_cst) returns %4
84/// ```
85/// %4 = tensor.pad %3 low[0, 0] high[...] { tensor.yield %other_cst }
86/// ```
87Value makeComposedPadHighOp(OpBuilder &b, Location loc, RankedTensorType type,
88 Value source, Value padding, bool nofold,
89 ValueRange typeDynDims = {});
90
91/// Returns GenericOp that copies an n-D memref. Unlike the current
92/// implementation of memref::CopyOp, this op can further tile, lower to loops
93/// or vectorize.
94GenericOp makeMemRefCopyOp(OpBuilder &b, Location loc, Value from, Value to);
95
96/// Get the reassociation maps to fold the result of a extract_slice (or
97/// source of a insert_slice) operation with given offsets, and sizes to its
98/// rank-reduced version. This is only done for the cases where the size is 1
99/// and offset is 0. Strictly speaking the offset 0 is not required in
100/// general, but non-zero offsets are not handled by SPIR-V backend at this
101/// point (and potentially cannot be handled).
102std::optional<SmallVector<ReassociationIndices>>
104
105//===----------------------------------------------------------------------===//
106// Convolution matcher utility
107//===----------------------------------------------------------------------===//
108
109/// A struct containing dilations and strides inferred from convolution ops.
114
115/// Given a linalg `op` this function returns DilationsAndStrides if it is a
116/// convolution op of type `ConvOpTy`, otherwise returns std::nullopt. The
117/// dilations and strides are inferred from the indexing maps. For ops like
118/// Conv1DOp, Conv2DOp and Conv3DOp that have no strides/dilations attributes,
119/// defaults of [1, ...] are returned for both.
120template <typename ConvOpTy>
121std::optional<DilationsAndStrides> matchConvolutionOpOfType(LinalgOp op);
122
123/// Returns true if the linalg `op` is a convolution op of type `ConvOpTy`.
124/// This is a convenience wrapper around matchConvolutionOpOfType.
125template <typename ConvOpTy>
126bool isaConvolutionOpOfType(LinalgOp op) {
127 return matchConvolutionOpOfType<ConvOpTy>(op).has_value();
128}
129
130//===----------------------------------------------------------------------===//
131// Fusion / Tiling utilities
132//===----------------------------------------------------------------------===//
133
134/// The type of loops to be generated during tiling.
140
141/// Computes tile offsets, given a list of loop `ivs` and `tileSizes`. In case
142/// a tile size is zero (i.e., no tiling), the corresponding offset is also
143/// zero.
146 ArrayRef<OpFoldResult> tileSizes);
147
148/// Computes tile sizes, given a list of `tileSizes` and dimension
149/// sizes (`sizeBounds`). In case a tile size is zero (i.e., no tiling), the
150/// corresponding result size is the corresponding value from `sizeBounds`.
151/// Note: The returned tile sizes are closed intervals.
153 ArrayRef<OpFoldResult> tileSizes,
154 ArrayRef<OpFoldResult> sizeBounds);
155
156/// Returns the list of tensor output types produced when the given structured
157/// operation `op` is applied to the given `operands`. Note that `operands`
158/// are not necessarily the actual operands of `op`.
160
161/// Creates `insert_slice` ops that insert `results` back into larger tensors
162/// they were originally extracted from with `extract_slice` before being
163/// passed as `operands` to the given structured operation `op` or its clone.
164/// Note that `operands` are not necessarily the actual operands of `op`, the
165/// operation serves only as metadata container for operand types and
166/// positions.
168 LinalgOp op, ValueRange operands,
169 ValueRange results);
170
171/// A struct containg offsets-sizes-strides arguments of the tiled shape.
177
178/// Computes SliceParameters for a single `valueToTile` assuming that its user
179/// is being tiled with the given loop bounds `lbs` and `ubs` and the tile
180/// sizes `tileSizes`.
181///
182/// `omitPartialTileCheck` controls whether to omit the partial/boundary tile
183/// condition check in cases where we statically know that it is unnecessary.
185computeSliceParameters(OpBuilder &builder, Location loc, Value valueToTile,
186 ArrayRef<OpFoldResult> tileSizes, AffineMap map,
188 ArrayRef<OpFoldResult> subShapeSizes,
189 bool omitPartialTileCheck);
190
191/// Computes SliceParamaters for all `valuesToTile` of the given `linalgOp`,
192/// assuming `linalgOp` is being fused into a loop nest. Calls
193/// `computeSliceParameters` for every individual value.
194///
195/// Note that a constant zero in `tileSizes` means no tiling at that implicit
196/// loop. The number of non-zero values in `tileSizes` should be equal to the
197/// number of values in `ivs`.
198///
199/// Some of the `valuesToTile` won't be affected by tiling. For these values,
200/// std::nullopt will be returned.
202computeAllSliceParameters(OpBuilder &builder, Location loc, LinalgOp linalgOp,
203 ValueRange valuesToTile, ArrayRef<OpFoldResult> ivs,
204 ArrayRef<OpFoldResult> tileSizes,
205 ArrayRef<OpFoldResult> sizeBounds,
206 bool omitPartialTileCheck);
207
208/// Creates an extract_slice/subview op for a single `valueToTile` with
209/// `builder`. This new operation extracts a tile of `valueToTile`, starting
210/// at offsets `lbs` and with sizes `subShapeSizes`. `omitPartialTileCheck`
211/// controls whether to omit the partial/boundary tile condition check in
212/// cases where we statically know that it is unnecessary.
213Operation *makeTiledShape(OpBuilder &builder, Location loc, Value valueToTile,
214 ArrayRef<OpFoldResult> tileSizes, AffineMap map,
217 ArrayRef<OpFoldResult> subShapeSizes,
218 bool omitPartialTileCheck);
219
220/// Creates extract_slice/subview ops for all `valuesToTile` of the given
221/// `linalgOp` with `builder`, assuming `linalgOp` is being fused into a loop
222/// nest for tiling with the given induction variables `ivs` and tile sizes
223/// `tileSizes`. `sizeBounds` are the iteration space bounds for *all* the
224/// implicit loops in `linalgOp`. `omitPartialTileCheck` controls whether to
225/// omit the partial/boundary tile condition check in cases where we
226/// statically know that it is unnecessary.
227///
228/// Note that a constant zero in `tileSizes` means no tiling at that implicit
229/// loop. The number of non-zero values in `tileSizes` should be equal to the
230/// number of values in `ivs`.
232 LinalgOp linalgOp, ValueRange valuesToTile,
234 ArrayRef<OpFoldResult> tileSizes,
235 ArrayRef<OpFoldResult> sizeBounds,
236 bool omitPartialTileCheck);
237
238/// Add the specified offsets to any `linalg.index` ops contained in the given
239/// `linalgOp`. The offsets are provided in the same order as iteration space
240/// dimensions. Null offests are assumed to be zero.
241void offsetIndices(OpBuilder &b, LinalgOp linalgOp,
242 ArrayRef<OpFoldResult> offests);
243void offsetIndices(RewriterBase &b, LinalgOp linalgOp,
244 ArrayRef<OpFoldResult> offests);
245
246/// A struct containing the Linalg producer before and after fusion.
247/// When operating on tensors, `fusedProducer` may feed into a `tensor.cast`
248/// op before the consumer Linalg op, until enough canonicalizations have
249/// applied.
253};
254
255/// This implements the fusion part of the "tileAndFuse on tensors"
256/// transformation and thus requires the `consumerOpOperand` to be a
257/// `extract_slice` op (generally obtained by applying the tiling
258/// transformation).
259FailureOr<FusionInfo> fuseProducerOfTensor(OpBuilder &b,
260 OpOperand &consumerOpOperand);
261
262/// This implements the fusion part of the "tileAndFuse on tensors"
263/// transformation and thus requires the `consumerOpOperand` to be a
264/// `extract_slice` op (generally obtained by applying the tiling
265/// transformation). Assumes `producerOfTensor` is a Linalg op that produces
266/// `consumerOpOperand`.
267FailureOr<FusionInfo> fuseProducerOfTensor(OpBuilder &b,
268 OpResult producerOpResult,
269 OpOperand &consumerOpOperand);
270
271//===----------------------------------------------------------------------===//
272// Distribution utilities
273//===----------------------------------------------------------------------===//
274
275/// Scheme used to distribute loops to processors.
277 /// Cyclic distribution where no assumption is made about the dynamic
278 /// relationship between number of processors and number of iterations of
279 /// the
280 /// distributed loop. Distributes the following loop
281 ///
282 /// scf.parallel (%iv) = (%lb) to (%ub) step (%step)
283 ///
284 /// to
285 ///
286 /// scf.parallel(%iv)= (%lb + %procId * %step) to (%ub) step (%step *
287 /// %nprocs)
289
290 /// Cyclic distribution where the number of processors can be assumed to be
291 /// more than or equal to the number of iterations of the distributed loop.
292 /// In
293 /// such cases, a simple in-bounds check is enough (instead of materializing
294 /// a
295 /// loop). Distributes the following loop
296 ///
297 /// scf.parallel (%iv) = (%lb) to (%ub) step (%step)
298 ///
299 /// to
300 ///
301 /// %iv = %lb + %procId * %step
302 /// %cond = arith.cmpi "slt", %iv, %ub
303 /// scf.if %cond {
304 /// ...
305 /// }
307
308 /// Cyclic distribution where the number of processors can be assumed to be
309 /// equal to the number of iterations of the distributed loop. In such
310 /// cases,
311 /// no bounds check is needed. Distributes the following loop
312 ///
313 /// scf.parallel (%iv) = (%lb) to (%ub) step (%step)
314 ///
315 /// to
316 ///
317 /// %iv = %lb + %procId * %step
319
320 /// No Distribution.
322};
323
324/// Callback function type used to get processor ID, and number of processors
325/// used for distribution for all parallel loops generated.
331using ProcInfoCallBackFn = std::function<SmallVector<ProcInfo>(
332 OpBuilder &b, Location loc, ArrayRef<Range> parallelLoopRanges)>;
333
334/// Options that allow distribution of loops generated in Linalg transforms to
335/// processors while generating the loops.
337 /// Callback function that returns the Values for processor ID (`procId`),
338 /// and number of processors (`nprocs`) used to execute the parallel loops.
339 /// The number of `{procId, nprocs}` pairs returned must be equal to the
340 /// number of `parallelLoopRanges` passed into the callback. The
341 /// `parallelLoopRanges` are ranges of the outer parallel loops of the
342 /// operation that do have non-zero tile sizes specified.
344};
345
346/// Update the `lb`, `ub` and `step` to get per processor `lb`, `ub` and
347/// `step`.
349 Value procId, Value nprocs, Value &lb,
350 Value &ub, Value &step);
351
352//===----------------------------------------------------------------------===//
353// Fusion on tensor utilities
354//===----------------------------------------------------------------------===//
355
356//===----------------------------------------------------------------------===//
357// Generic op region utilities
358//===----------------------------------------------------------------------===//
359
360/// A struct containing common matchers over linalg op's region.
362 enum class BinaryOpKind {
364 };
365
366 /// Matches the given linalg op if its body is performing binary operation
367 /// on int or float scalar values and returns the binary op kind.
368 ///
369 /// The linalg op's region is expected to be
370 /// ```
371 /// {
372 /// ^bb(%a: <scalar-type>, %b: <scalar-type>):
373 /// %0 = <binary-op> %a, %b: <scalar-type>
374 /// linalg.yield %0: <scalar-type>
375 /// }
376 /// ```
377 static std::optional<BinaryOpKind> matchAsScalarBinaryOp(GenericOp op);
378};
379
380//===----------------------------------------------------------------------===//
381// Loop nest utilities
382//===----------------------------------------------------------------------===//
383
384/// Utility class used to generate nested loops with ranges described by
385/// `loopRanges` and loop type described by the `iteratorTypes`.
386/// `bodyBuilderFn` is used to generate the body of the innermost loop. It is
387/// passed a range of loop induction variables and a range of operand values
388/// to use.
389template <typename LoopTy>
391 static void doit(OpBuilder &b, Location loc, ArrayRef<Range> loopRanges,
392 LinalgOp linalgOp,
393 ArrayRef<utils::IteratorType> iteratorTypes,
396 bodyBuilderFn,
397 ArrayRef<linalg::ProcInfo> procInfo = {});
398};
399
400/// Returns an attribute list that excludes pre-defined attributes.
401template <typename OpTy>
403 auto elidedAttrs = llvm::to_vector(op.getAttributeNames());
404 if (isa<linalg::LinalgOp>(op.getOperation()))
405 elidedAttrs.push_back(LinalgDialect::kMemoizedIndexingMapsAttrName);
406 return getPrunedAttributeList(op, elidedAttrs);
407}
408
409} // namespace linalg
410} // namespace mlir
411
412#endif // MLIR_DIALECT_LINALG_UTILS_UTILS_H
b
Return true if permutation is a valid permutation of the outer_dims_perm (case OuterOrInnerPerm::Oute...
Base type for affine expression.
Definition AffineExpr.h:68
A multi-dimensional affine map Affine map's are immutable like Type's, and they are uniqued.
Definition AffineMap.h:46
This class defines the main interface for locations in MLIR and acts as a non-nullable wrapper around...
Definition Location.h:76
This class helps build Operations.
Definition Builders.h:207
This class represents an operand of an operation.
Definition Value.h:257
This is a value defined by a result of an operation.
Definition Value.h:457
Operation is the basic unit of execution within MLIR.
Definition Operation.h:88
A special type of RewriterBase that coordinates the application of a rewrite pattern on the current I...
This class contains a list of basic blocks and a link to the parent operation it is attached to.
Definition Region.h:26
This class coordinates the application of a rewrite on a set of IR, providing a way for clients to tr...
This class provides an abstraction over the different types of ranges over Values.
Definition ValueRange.h:387
This class represents an instance of an SSA value in the MLIR system, representing a computable value...
Definition Value.h:96
FailureOr< FusionInfo > fuseProducerOfTensor(OpBuilder &b, OpOperand &consumerOpOperand)
This implements the fusion part of the "tileAndFuse on tensors" transformation and thus requires the ...
Definition Fusion.cpp:217
SmallVector< int64_t > getUnPackInverseSrcPerm(linalg::UnPackOp, PackingMetadata &metadata)
Compute inverse permutation for the source tensor (i.e.
SmallVector< Value > makeTiledShapes(OpBuilder &builder, Location loc, LinalgOp linalgOp, ValueRange valuesToTile, ArrayRef< OpFoldResult > ivs, ArrayRef< OpFoldResult > tileSizes, ArrayRef< OpFoldResult > sizeBounds, bool omitPartialTileCheck)
Creates extract_slice/subview ops for all valuesToTile of the given linalgOp with builder,...
Definition Utils.cpp:2848
bool allIndexingsAreProjectedPermutation(LinalgOp op)
Check if all indexing maps are projected permutations.
Definition Utils.cpp:195
bool isParallelIterator(utils::IteratorType iteratorType)
Check if iterator type has "parallel" semantics.
Definition Utils.cpp:230
SmallVector< OpFoldResult > computeTileSizes(OpBuilder &b, Location loc, ArrayRef< OpFoldResult > tileSizes, ArrayRef< OpFoldResult > sizeBounds)
Computes tile sizes, given a list of tileSizes and dimension sizes (sizeBounds).
Definition Utils.cpp:2743
std::optional< DilationsAndStrides > matchConvolutionOpOfType(LinalgOp op)
Given a linalg op this function returns DilationsAndStrides if it is a convolution op of type ConvOpT...
GenericOp makeMemRefCopyOp(OpBuilder &b, Location loc, Value from, Value to)
Returns GenericOp that copies an n-D memref.
Definition Utils.cpp:2299
SmallVector< OpFoldResult > computeTileOffsets(OpBuilder &b, Location loc, ArrayRef< OpFoldResult > ivs, ArrayRef< OpFoldResult > tileSizes)
Computes tile offsets, given a list of loop ivs and tileSizes.
Definition Utils.cpp:2729
LinalgTilingLoopType
The type of loops to be generated during tiling.
Definition Utils.h:135
bool isReductionIterator(utils::IteratorType iteratorType)
Check if iterator type has "reduction" semantics.
Definition Utils.cpp:234
bool hasOnlyScalarElementwiseOp(Region &r)
Detect whether r has only ConstantOp, ElementwiseMappable and YieldOp.
Definition Utils.cpp:201
std::optional< SmallVector< ReassociationIndices > > getReassociationMapForFoldingUnitDims(ArrayRef< OpFoldResult > mixedSizes)
Get the reassociation maps to fold the result of a extract_slice (or source of a insert_slice) operat...
Definition Utils.cpp:2906
DistributionMethod
Scheme used to distribute loops to processors.
Definition Utils.h:276
@ None
No Distribution.
Definition Utils.h:321
@ CyclicNumProcsGeNumIters
Cyclic distribution where the number of processors can be assumed to be more than or equal to the num...
Definition Utils.h:306
@ Cyclic
Cyclic distribution where no assumption is made about the dynamic relationship between number of proc...
Definition Utils.h:288
@ CyclicNumProcsEqNumIters
Cyclic distribution where the number of processors can be assumed to be equal to the number of iterat...
Definition Utils.h:318
SmallVector< Value > insertSlicesBack(OpBuilder &builder, Location loc, LinalgOp op, ValueRange operands, ValueRange results)
Creates insert_slice ops that insert results back into larger tensors they were originally extracted ...
Definition Utils.cpp:2768
bool isElementwise(LinalgOp op)
Check if a LinalgOp is an element-wise operation.
Definition Utils.cpp:215
void offsetIndices(OpBuilder &b, LinalgOp linalgOp, ArrayRef< OpFoldResult > offests)
Add the specified offsets to any linalg.index ops contained in the given linalgOp.
Definition Utils.cpp:2870
SmallVector< int64_t > getPackInverseDestPerm(linalg::PackOp packOp, PackingMetadata &metadata)
Compute inverse permutation for the destination tensor (i.e.
bool isaConvolutionOpOfType(LinalgOp op)
Returns true if the linalg op is a convolution op of type ConvOpTy.
Definition Utils.h:126
SmallVector< std::optional< SliceParameters > > computeAllSliceParameters(OpBuilder &builder, Location loc, LinalgOp linalgOp, ValueRange valuesToTile, ArrayRef< OpFoldResult > ivs, ArrayRef< OpFoldResult > tileSizes, ArrayRef< OpFoldResult > sizeBounds, bool omitPartialTileCheck)
Computes SliceParamaters for all valuesToTile of the given linalgOp, assuming linalgOp is being fused...
Definition Utils.cpp:2797
Operation * makeTiledShape(OpBuilder &builder, Location loc, Value valueToTile, ArrayRef< OpFoldResult > tileSizes, AffineMap map, ArrayRef< OpFoldResult > lbs, ArrayRef< OpFoldResult > ubs, ArrayRef< OpFoldResult > subShapeSizes, bool omitPartialTileCheck)
Creates an extract_slice/subview op for a single valueToTile with builder.
Definition Utils.cpp:2599
std::function< SmallVector< ProcInfo >( OpBuilder &b, Location loc, ArrayRef< Range > parallelLoopRanges)> ProcInfoCallBackFn
Definition Utils.h:331
Value makeComposedPadHighOp(OpBuilder &b, Location loc, RankedTensorType type, Value source, Value padding, bool nofold, ValueRange typeDynDims={})
Create a tensor::PadOp that pads source to the shape of type whose sizes are assumed to be greater th...
Definition Utils.cpp:2231
void updateBoundsForCyclicDistribution(OpBuilder &builder, Location loc, Value procId, Value nprocs, Value &lb, Value &ub, Value &step)
Update the lb, ub and step to get per processor lb, ub and step.
Definition Utils.cpp:2398
SmallVector< NamedAttribute > getPrunedAttributeList(OpTy op)
Returns an attribute list that excludes pre-defined attributes.
Definition Utils.h:402
SmallVector< Type > getTensorOutputTypes(LinalgOp op, ValueRange operands)
Returns the list of tensor output types produced when the given structured operation op is applied to...
Definition Utils.cpp:2759
SliceParameters computeSliceParameters(OpBuilder &builder, Location loc, Value valueToTile, ArrayRef< OpFoldResult > tileSizes, AffineMap map, ArrayRef< OpFoldResult > lbs, ArrayRef< OpFoldResult > ubs, ArrayRef< OpFoldResult > subShapeSizes, bool omitPartialTileCheck)
Computes SliceParameters for a single valueToTile assuming that its user is being tiled with the give...
Definition Utils.cpp:2612
SmallVector< Value > ValueVector
An owning vector of values, handy to return from functions.
Definition SCF.h:64
Include the generated interface declarations.
llvm::function_ref< Fn > function_ref
Definition LLVM.h:144
A struct containing dilations and strides inferred from convolution ops.
Definition Utils.h:110
SmallVector< int64_t > strides
Definition Utils.h:112
SmallVector< int64_t > dilations
Definition Utils.h:111
A struct containing the Linalg producer before and after fusion.
Definition Utils.h:250
LinalgOp originalProducer
Definition Utils.h:251
Utility class used to generate nested loops with ranges described by loopRanges and loop type describ...
Definition Utils.h:390
static void doit(OpBuilder &b, Location loc, ArrayRef< Range > loopRanges, LinalgOp linalgOp, ArrayRef< utils::IteratorType > iteratorTypes, function_ref< scf::ValueVector(OpBuilder &, Location, ValueRange, ValueRange)> bodyBuilderFn, ArrayRef< linalg::ProcInfo > procInfo={})
Options that allow distribution of loops generated in Linalg transforms to processors while generatin...
Definition Utils.h:336
ProcInfoCallBackFn procInfo
Callback function that returns the Values for processor ID (procId), and number of processors (nprocs...
Definition Utils.h:343
Callback function type used to get processor ID, and number of processors used for distribution for a...
Definition Utils.h:326
DistributionMethod distributionMethod
Definition Utils.h:329
A struct containing common matchers over linalg op's region.
Definition Utils.h:361
static std::optional< BinaryOpKind > matchAsScalarBinaryOp(GenericOp op)
Matches the given linalg op if its body is performing binary operation on int or float scalar values ...
Definition Utils.cpp:93
A struct containg offsets-sizes-strides arguments of the tiled shape.
Definition Utils.h:172
SmallVector< OpFoldResult > strides
Definition Utils.h:175
SmallVector< OpFoldResult > sizes
Definition Utils.h:174
SmallVector< OpFoldResult > offsets
Definition Utils.h:173