MLIR  19.0.0git
Utils.h
Go to the documentation of this file.
1 //===- Utils.h - Affine dialect utilities -----------------------*- 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 // This header file declares a set of utilities for the affine dialect ops.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef MLIR_DIALECT_AFFINE_UTILS_H
14 #define MLIR_DIALECT_AFFINE_UTILS_H
15 
18 #include "mlir/IR/OpDefinition.h"
19 #include <optional>
20 
21 namespace mlir {
22 class DominanceInfo;
23 class Operation;
24 class PostDominanceInfo;
25 class ImplicitLocOpBuilder;
26 
27 namespace func {
28 class FuncOp;
29 } // namespace func
30 
31 namespace memref {
32 class AllocOp;
33 } // namespace memref
34 
35 struct LogicalResult;
36 
37 namespace affine {
38 class AffineForOp;
39 class AffineIfOp;
40 class AffineParallelOp;
41 
43 
44 /// Replaces a parallel affine.for op with a 1-d affine.parallel op. `forOp`'s
45 /// body is taken by the affine.parallel op and the former is erased.
46 /// (mlir::isLoopParallel can be used to detect a parallel affine.for op.) The
47 /// reductions specified in `parallelReductions` are also parallelized.
48 /// Parallelization will fail in the presence of loop iteration arguments that
49 /// are not listed in `parallelReductions`. `resOp` if non-null is set to the
50 /// newly created affine.parallel op.
51 LogicalResult affineParallelize(AffineForOp forOp,
52  ArrayRef<LoopReduction> parallelReductions = {},
53  AffineParallelOp *resOp = nullptr);
54 
55 /// Hoists out affine.if/else to as high as possible, i.e., past all invariant
56 /// affine.fors/parallel's. Returns success if any hoisting happened; folded` is
57 /// set to true if the op was folded or erased. This hoisting could lead to
58 /// significant code expansion in some cases.
59 LogicalResult hoistAffineIfOp(AffineIfOp ifOp, bool *folded = nullptr);
60 
61 /// Holds parameters to perform n-D vectorization on a single loop nest.
62 /// For example, for the following loop nest:
63 ///
64 /// func @vec2d(%in: memref<64x128x512xf32>, %out: memref<64x128x512xf32>) {
65 /// affine.for %i0 = 0 to 64 {
66 /// affine.for %i1 = 0 to 128 {
67 /// affine.for %i2 = 0 to 512 {
68 /// %ld = affine.load %in[%i0, %i1, %i2] : memref<64x128x512xf32>
69 /// affine.store %ld, %out[%i0, %i1, %i2] : memref<64x128x512xf32>
70 /// }
71 /// }
72 /// }
73 /// return
74 /// }
75 ///
76 /// and VectorizationStrategy = 'vectorSizes = {8, 4}', 'loopToVectorDim =
77 /// {{i1->0}, {i2->1}}', SuperVectorizer will generate:
78 ///
79 /// func @vec2d(%arg0: memref<64x128x512xf32>, %arg1: memref<64x128x512xf32>) {
80 /// affine.for %arg2 = 0 to 64 {
81 /// affine.for %arg3 = 0 to 128 step 8 {
82 /// affine.for %arg4 = 0 to 512 step 4 {
83 /// %cst = arith.constant 0.000000e+00 : f32
84 /// %0 = vector.transfer_read %arg0[%arg2, %arg3, %arg4], %cst : ...
85 /// vector.transfer_write %0, %arg1[%arg2, %arg3, %arg4] : ...
86 /// }
87 /// }
88 /// }
89 /// return
90 /// }
91 // TODO: Hoist to a VectorizationStrategy.cpp when appropriate.
93  // Vectorization factors to apply to each target vector dimension.
94  // Each factor will be applied to a different loop.
96  // Maps each AffineForOp vectorization candidate with its vector dimension.
97  // The candidate will be vectorized using the vectorization factor in
98  // 'vectorSizes' for that dimension.
100  // Maps loops that implement vectorizable reductions to the corresponding
101  // reduction descriptors.
103 };
104 
105 /// Replace affine store and load accesses by scalars by forwarding stores to
106 /// loads and eliminate invariant affine loads; consequently, eliminate dead
107 /// allocs.
108 void affineScalarReplace(func::FuncOp f, DominanceInfo &domInfo,
109  PostDominanceInfo &postDomInfo);
110 
111 /// Vectorizes affine loops in 'loops' using the n-D vectorization factors in
112 /// 'vectorSizes'. By default, each vectorization factor is applied
113 /// inner-to-outer to the loops of each loop nest. 'fastestVaryingPattern' can
114 /// be optionally used to provide a different loop vectorization order.
115 /// If `reductionLoops` is not empty, the given reduction loops may be
116 /// vectorized along the reduction dimension.
117 /// TODO: Vectorizing reductions is supported only for 1-D vectorization.
119  Operation *parentOp,
121  ArrayRef<int64_t> vectorSizes, ArrayRef<int64_t> fastestVaryingPattern,
122  const ReductionLoopMap &reductionLoops = ReductionLoopMap());
123 
124 /// External utility to vectorize affine loops from a single loop nest using an
125 /// n-D vectorization strategy (see doc in VectorizationStrategy definition).
126 /// Loops are provided in a 2D vector container. The first dimension represents
127 /// the nesting level relative to the loops to be vectorized. The second
128 /// dimension contains the loops. This means that:
129 /// a) every loop in 'loops[i]' must have a parent loop in 'loops[i-1]',
130 /// b) a loop in 'loops[i]' may or may not have a child loop in 'loops[i+1]'.
131 ///
132 /// For example, for the following loop nest:
133 ///
134 /// func @vec2d(%in0: memref<64x128x512xf32>, %in1: memref<64x128x128xf32>,
135 /// %out0: memref<64x128x512xf32>,
136 /// %out1: memref<64x128x128xf32>) {
137 /// affine.for %i0 = 0 to 64 {
138 /// affine.for %i1 = 0 to 128 {
139 /// affine.for %i2 = 0 to 512 {
140 /// %ld = affine.load %in0[%i0, %i1, %i2] : memref<64x128x512xf32>
141 /// affine.store %ld, %out0[%i0, %i1, %i2] : memref<64x128x512xf32>
142 /// }
143 /// affine.for %i3 = 0 to 128 {
144 /// %ld = affine.load %in1[%i0, %i1, %i3] : memref<64x128x128xf32>
145 /// affine.store %ld, %out1[%i0, %i1, %i3] : memref<64x128x128xf32>
146 /// }
147 /// }
148 /// }
149 /// return
150 /// }
151 ///
152 /// loops = {{%i0}, {%i2, %i3}}, to vectorize the outermost and the two
153 /// innermost loops;
154 /// loops = {{%i1}, {%i2, %i3}}, to vectorize the middle and the two innermost
155 /// loops;
156 /// loops = {{%i2}}, to vectorize only the first innermost loop;
157 /// loops = {{%i3}}, to vectorize only the second innermost loop;
158 /// loops = {{%i1}}, to vectorize only the middle loop.
161  const VectorizationStrategy &strategy);
162 
163 /// Normalize a affine.parallel op so that lower bounds are 0 and steps are 1.
164 /// As currently implemented, this transformation cannot fail and will return
165 /// early if the op is already in a normalized form.
166 void normalizeAffineParallel(AffineParallelOp op);
167 
168 /// Normalize an affine.for op. An affine.for op is normalized by converting the
169 /// lower bound to zero and loop step to one. The upper bound is set to the trip
170 /// count of the loop. Original loops must have a lower bound with only a single
171 /// result. There is no such restriction on upper bounds. Returns success if the
172 /// loop has been normalized (or is already in the normal form). If
173 /// `promoteSingleIter` is true, the loop is simply promoted if it has a single
174 /// iteration.
175 LogicalResult normalizeAffineFor(AffineForOp op,
176  bool promoteSingleIter = false);
177 
178 /// Traverse `e` and return an AffineExpr where all occurrences of `dim` have
179 /// been replaced by either:
180 /// - `min` if `positivePath` is true when we reach an occurrence of `dim`
181 /// - `max` if `positivePath` is true when we reach an occurrence of `dim`
182 /// `positivePath` is negated each time we hit a multiplicative or divisive
183 /// binary op with a constant negative coefficient.
185  AffineExpr max, bool positivePath = true);
186 
187 /// Replaces all "dereferencing" uses of `oldMemRef` with `newMemRef` while
188 /// optionally remapping the old memref's indices using the supplied affine map,
189 /// `indexRemap`. The new memref could be of a different shape or rank.
190 /// `extraIndices` provides any additional access indices to be added to the
191 /// start.
192 ///
193 /// `indexRemap` remaps indices of the old memref access to a new set of indices
194 /// that are used to index the memref. Additional input operands to indexRemap
195 /// can be optionally provided in `extraOperands`, and they occupy the start
196 /// of its input list. `indexRemap`'s dimensional inputs are expected to
197 /// correspond to memref's indices, and its symbolic inputs if any should be
198 /// provided in `symbolOperands`.
199 ///
200 /// `domOpFilter`, if non-null, restricts the replacement to only those
201 /// operations that are dominated by the former; similarly, `postDomOpFilter`
202 /// restricts replacement to only those operations that are postdominated by it.
203 ///
204 /// 'allowNonDereferencingOps', if set, allows replacement of non-dereferencing
205 /// uses of a memref without any requirement for access index rewrites as long
206 /// as the user operation has the MemRefsNormalizable trait. The default value
207 /// of this flag is false.
208 ///
209 /// 'replaceInDeallocOp', if set, lets DeallocOp, a non-dereferencing user, to
210 /// also be a candidate for replacement. The default value of this flag is
211 /// false.
212 ///
213 /// Returns true on success and false if the replacement is not possible,
214 /// whenever a memref is used as an operand in a non-dereferencing context and
215 /// 'allowNonDereferencingOps' is false, except for dealloc's on the memref
216 /// which are left untouched. See comments at function definition for an
217 /// example.
218 //
219 // Ex: to replace load %A[%i, %j] with load %Abuf[%t mod 2, %ii - %i, %j]:
220 // The SSA value corresponding to '%t mod 2' should be in 'extraIndices', and
221 // index remap will perform (%i, %j) -> (%ii - %i, %j), i.e., indexRemap = (d0,
222 // d1, d2) -> (d0 - d1, d2), and %ii will be the extra operand. Without any
223 // extra operands, note that 'indexRemap' would just be applied to existing
224 // indices (%i, %j).
225 // TODO: allow extraIndices to be added at any position.
227  Value oldMemRef, Value newMemRef, ArrayRef<Value> extraIndices = {},
228  AffineMap indexRemap = AffineMap(), ArrayRef<Value> extraOperands = {},
229  ArrayRef<Value> symbolOperands = {}, Operation *domOpFilter = nullptr,
230  Operation *postDomOpFilter = nullptr, bool allowNonDereferencingOps = false,
231  bool replaceInDeallocOp = false);
232 
233 /// Performs the same replacement as the other version above but only for the
234 /// dereferencing uses of `oldMemRef` in `op`, except in cases where
235 /// 'allowNonDereferencingOps' is set to true where we replace the
236 /// non-dereferencing uses as well.
237 LogicalResult replaceAllMemRefUsesWith(Value oldMemRef, Value newMemRef,
238  Operation *op,
239  ArrayRef<Value> extraIndices = {},
240  AffineMap indexRemap = AffineMap(),
241  ArrayRef<Value> extraOperands = {},
242  ArrayRef<Value> symbolOperands = {},
243  bool allowNonDereferencingOps = false);
244 
245 /// Rewrites the memref defined by this alloc op to have an identity layout map
246 /// and updates all its indexing uses. Returns failure if any of its uses
247 /// escape (while leaving the IR in a valid state).
248 LogicalResult normalizeMemRef(memref::AllocOp *op);
249 
250 /// Normalizes `memrefType` so that the affine layout map of the memref is
251 /// transformed to an identity map with a new shape being computed for the
252 /// normalized memref type and returns it. The old memref type is simplify
253 /// returned if the normalization failed.
254 MemRefType normalizeMemRefType(MemRefType memrefType);
255 
256 /// Given an operation, inserts one or more single result affine apply
257 /// operations, results of which are exclusively used by this operation.
258 /// The operands of these newly created affine apply ops are
259 /// guaranteed to be loop iterators or terminal symbols of a function.
260 ///
261 /// Before
262 ///
263 /// affine.for %i = 0 to #map(%N)
264 /// %idx = affine.apply (d0) -> (d0 mod 2) (%i)
265 /// send %A[%idx], ...
266 /// %v = "compute"(%idx, ...)
267 ///
268 /// After
269 ///
270 /// affine.for %i = 0 to #map(%N)
271 /// %idx = affine.apply (d0) -> (d0 mod 2) (%i)
272 /// send %A[%idx], ...
273 /// %idx_ = affine.apply (d0) -> (d0 mod 2) (%i)
274 /// %v = "compute"(%idx_, ...)
275 
276 /// This allows the application of different transformations on send and
277 /// compute (for eg. different shifts/delays)
278 ///
279 /// Fills `sliceOps` with the list of affine.apply operations.
280 /// In the following cases, `sliceOps` remains empty:
281 /// 1. If none of opInst's operands were the result of an affine.apply
282 /// (i.e., there was no affine computation slice to create).
283 /// 2. If all the affine.apply op's supplying operands to this opInst did not
284 /// have any uses other than those in this opInst.
285 void createAffineComputationSlice(Operation *opInst,
286  SmallVectorImpl<AffineApplyOp> *sliceOps);
287 
288 /// Emit code that computes the given affine expression using standard
289 /// arithmetic operations applied to the provided dimension and symbol values.
290 Value expandAffineExpr(OpBuilder &builder, Location loc, AffineExpr expr,
291  ValueRange dimValues, ValueRange symbolValues);
292 
293 /// Create a sequence of operations that implement the `affineMap` applied to
294 /// the given `operands` (as it it were an AffineApplyOp).
295 std::optional<SmallVector<Value, 8>> expandAffineMap(OpBuilder &builder,
296  Location loc,
297  AffineMap affineMap,
298  ValueRange operands);
299 
300 /// Holds the result of (div a, b) and (mod a, b).
301 struct DivModValue {
304 };
305 
306 /// Create IR to calculate (div lhs, rhs) and (mod lhs, rhs).
308 
309 /// Generate the IR to delinearize `linearIndex` given the `basis` and return
310 /// the multi-index.
312  Value linearIndex,
313  ArrayRef<Value> basis);
314 // Generate IR that extracts the linear index from a multi-index according to
315 // a basis/shape.
318  ImplicitLocOpBuilder &builder);
319 
320 /// Ensure that all operations that could be executed after `start`
321 /// (noninclusive) and prior to `memOp` (e.g. on a control flow/op path
322 /// between the operations) do not have the potential memory effect
323 /// `EffectType` on `memOp`. `memOp` is an operation that reads or writes to
324 /// a memref. For example, if `EffectType` is MemoryEffects::Write, this method
325 /// will check if there is no write to the memory between `start` and `memOp`
326 /// that would change the read within `memOp`.
327 template <typename EffectType, typename T>
328 bool hasNoInterveningEffect(Operation *start, T memOp);
329 
331  explicit AffineValueExpr(AffineExpr e) : e(e) {}
333  this->v = v;
334  return *this;
335  }
337  this->v = v;
338  return *this;
339  }
340  operator AffineExpr() const { return e; }
341  operator OpFoldResult() const { return v; }
344 };
345 
346 /// Helper struct to build simple AffineValueExprs with minimal type inference
347 /// support.
349  AffineBuilder(OpBuilder &b, Location loc) : b(b), loc(loc) {}
351  return makeComposedFoldedAffineApply(b, loc, {lhs.e + rhs.e}, {lhs, rhs});
352  }
354  return makeComposedFoldedAffineApply(b, loc, {lhs.e - rhs.e}, {lhs, rhs});
355  }
357  return makeComposedFoldedAffineApply(b, loc, {lhs.e * rhs.e}, {lhs, rhs});
358  }
360  return makeComposedFoldedAffineApply(b, loc, {lhs.e.floorDiv(rhs.e)},
361  {lhs, rhs});
362  }
364  return makeComposedFoldedAffineApply(b, loc, {lhs.e.ceilDiv(rhs.e)},
365  {lhs, rhs});
366  }
369  b, loc, AffineMap::getMultiDimIdentityMap(vals.size(), b.getContext()),
370  vals);
371  }
374  b, loc, AffineMap::getMultiDimIdentityMap(vals.size(), b.getContext()),
375  vals);
376  }
377 
378 private:
379  OpBuilder &b;
380  Location loc;
381 };
382 
383 } // namespace affine
384 } // namespace mlir
385 
386 #endif // MLIR_DIALECT_AFFINE_UTILS_H
static Value max(ImplicitLocOpBuilder &builder, Value value, Value bound)
static Value min(ImplicitLocOpBuilder &builder, Value value, Value bound)
Base type for affine expression.
Definition: AffineExpr.h:69
AffineExpr floorDiv(uint64_t v) const
Definition: AffineExpr.cpp:883
AffineExpr ceilDiv(uint64_t v) const
Definition: AffineExpr.cpp:926
A multi-dimensional affine map Affine map's are immutable like Type's, and they are uniqued.
Definition: AffineMap.h:47
static AffineMap getMultiDimIdentityMap(unsigned numDims, MLIRContext *context)
Returns an AffineMap with 'numDims' identity result dim exprs.
Definition: AffineMap.cpp:318
MLIRContext * getContext() const
Definition: Builders.h:55
A class for computing basic dominance information.
Definition: Dominance.h:136
This class provides support for representing a failure result, or a valid value of type T.
Definition: LogicalResult.h:78
ImplicitLocOpBuilder maintains a 'current location', allowing use of the create<> method without spec...
This class defines the main interface for locations in MLIR and acts as a non-nullable wrapper around...
Definition: Location.h:63
This class helps build Operations.
Definition: Builders.h:209
This class represents a single result from folding an operation.
Definition: OpDefinition.h:268
Operation is the basic unit of execution within MLIR.
Definition: Operation.h:88
A class for computing basic postdominance information.
Definition: Dominance.h:195
This class represents an instance of an SSA value in the MLIR system, representing a computable value...
Definition: Value.h:96
std::optional< SmallVector< Value, 8 > > expandAffineMap(OpBuilder &builder, Location loc, AffineMap affineMap, ValueRange operands)
Create a sequence of operations that implement the affineMap applied to the given operands (as it it ...
Definition: Utils.cpp:225
FailureOr< SmallVector< Value > > delinearizeIndex(OpBuilder &b, Location loc, Value linearIndex, ArrayRef< Value > basis)
Generate the IR to delinearize linearIndex given the basis and return the multi-index.
Definition: Utils.cpp:1849
Value expandAffineExpr(OpBuilder &builder, Location loc, AffineExpr expr, ValueRange dimValues, ValueRange symbolValues)
Emit code that computes the given affine expression using standard arithmetic operations applied to t...
Definition: Utils.cpp:215
void normalizeAffineParallel(AffineParallelOp op)
Normalize a affine.parallel op so that lower bounds are 0 and steps are 1.
Definition: Utils.cpp:491
LogicalResult affineParallelize(AffineForOp forOp, ArrayRef< LoopReduction > parallelReductions={}, AffineParallelOp *resOp=nullptr)
Replaces a parallel affine.for op with a 1-d affine.parallel op.
Definition: Utils.cpp:348
OpFoldResult makeComposedFoldedAffineMax(OpBuilder &b, Location loc, AffineMap map, ArrayRef< OpFoldResult > operands)
Constructs an AffineMinOp that computes a maximum across the results of applying map to operands,...
Definition: AffineOps.cpp:1301
void vectorizeAffineLoops(Operation *parentOp, llvm::DenseSet< Operation *, DenseMapInfo< Operation * >> &loops, ArrayRef< int64_t > vectorSizes, ArrayRef< int64_t > fastestVaryingPattern, const ReductionLoopMap &reductionLoops=ReductionLoopMap())
Vectorizes affine loops in 'loops' using the n-D vectorization factors in 'vectorSizes'.
LogicalResult normalizeAffineFor(AffineForOp op, bool promoteSingleIter=false)
Normalize an affine.for op.
Definition: Utils.cpp:555
OpFoldResult makeComposedFoldedAffineMin(OpBuilder &b, Location loc, AffineMap map, ArrayRef< OpFoldResult > operands)
Constructs an AffineMinOp that computes a minimum across the results of applying map to operands,...
Definition: AffineOps.cpp:1294
LogicalResult normalizeMemRef(memref::AllocOp *op)
Rewrites the memref defined by this alloc op to have an identity layout map and updates all its index...
Definition: Utils.cpp:1687
OpFoldResult makeComposedFoldedAffineApply(OpBuilder &b, Location loc, AffineMap map, ArrayRef< OpFoldResult > operands)
Constructs an AffineApplyOp that applies map to operands after composing the map with the maps of any...
Definition: AffineOps.cpp:1188
void affineScalarReplace(func::FuncOp f, DominanceInfo &domInfo, PostDominanceInfo &postDomInfo)
Replace affine store and load accesses by scalars by forwarding stores to loads and eliminate invaria...
Definition: Utils.cpp:1036
bool hasNoInterveningEffect(Operation *start, T memOp)
Ensure that all operations that could be executed after start (noninclusive) and prior to memOp (e....
Definition: Utils.cpp:681
MemRefType normalizeMemRefType(MemRefType memrefType)
Normalizes memrefType so that the affine layout map of the memref is transformed to an identity map w...
Definition: Utils.cpp:1744
DenseMap< Operation *, SmallVector< LoopReduction, 2 > > ReductionLoopMap
Definition: Utils.h:42
OpFoldResult linearizeIndex(ArrayRef< OpFoldResult > multiIndex, ArrayRef< OpFoldResult > basis, ImplicitLocOpBuilder &builder)
Definition: Utils.cpp:1874
DivModValue getDivMod(OpBuilder &b, Location loc, Value lhs, Value rhs)
Create IR to calculate (div lhs, rhs) and (mod lhs, rhs).
Definition: Utils.cpp:1823
void createAffineComputationSlice(Operation *opInst, SmallVectorImpl< AffineApplyOp > *sliceOps)
Given an operation, inserts one or more single result affine apply operations, results of which are e...
Definition: Utils.cpp:1383
LogicalResult hoistAffineIfOp(AffineIfOp ifOp, bool *folded=nullptr)
Hoists out affine.if/else to as high as possible, i.e., past all invariant affine....
Definition: Utils.cpp:410
AffineExpr substWithMin(AffineExpr e, AffineExpr dim, AffineExpr min, AffineExpr max, bool positivePath=true)
Traverse e and return an AffineExpr where all occurrences of dim have been replaced by either:
Definition: Utils.cpp:464
LogicalResult replaceAllMemRefUsesWith(Value oldMemRef, Value newMemRef, ArrayRef< Value > extraIndices={}, AffineMap indexRemap=AffineMap(), ArrayRef< Value > extraOperands={}, ArrayRef< Value > symbolOperands={}, Operation *domOpFilter=nullptr, Operation *postDomOpFilter=nullptr, bool allowNonDereferencingOps=false, bool replaceInDeallocOp=false)
Replaces all "dereferencing" uses of oldMemRef with newMemRef while optionally remapping the old memr...
Definition: Utils.cpp:1267
LogicalResult vectorizeAffineLoopNest(std::vector< SmallVector< AffineForOp, 2 >> &loops, const VectorizationStrategy &strategy)
External utility to vectorize affine loops from a single loop nest using an n-D vectorization strateg...
Include the generated interface declarations.
This class represents an efficient way to signal success or failure.
Definition: LogicalResult.h:26
Helper struct to build simple AffineValueExprs with minimal type inference support.
Definition: Utils.h:348
OpFoldResult add(AffineValueExpr lhs, AffineValueExpr rhs)
Definition: Utils.h:350
OpFoldResult min(ArrayRef< OpFoldResult > vals)
Definition: Utils.h:367
OpFoldResult ceil(AffineValueExpr lhs, AffineValueExpr rhs)
Definition: Utils.h:363
OpFoldResult max(ArrayRef< OpFoldResult > vals)
Definition: Utils.h:372
AffineBuilder(OpBuilder &b, Location loc)
Definition: Utils.h:349
OpFoldResult floor(AffineValueExpr lhs, AffineValueExpr rhs)
Definition: Utils.h:359
OpFoldResult sub(AffineValueExpr lhs, AffineValueExpr rhs)
Definition: Utils.h:353
OpFoldResult mul(AffineValueExpr lhs, AffineValueExpr rhs)
Definition: Utils.h:356
AffineValueExpr(AffineExpr e)
Definition: Utils.h:331
AffineValueExpr bind(Value v)
Definition: Utils.h:332
AffineValueExpr bind(OpFoldResult v)
Definition: Utils.h:336
Holds the result of (div a, b) and (mod a, b).
Definition: Utils.h:301
Holds parameters to perform n-D vectorization on a single loop nest.
Definition: Utils.h:92
SmallVector< int64_t, 8 > vectorSizes
Definition: Utils.h:95
DenseMap< Operation *, unsigned > loopToVectorDim
Definition: Utils.h:99
ReductionLoopMap reductionLoops
Definition: Utils.h:102