MLIR 23.0.0git
ValueBoundsOpInterface.h
Go to the documentation of this file.
1//===- ValueBoundsOpInterface.h - Value Bounds ------------------*- 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_INTERFACES_VALUEBOUNDSOPINTERFACE_H_
10#define MLIR_INTERFACES_VALUEBOUNDSOPINTERFACE_H_
11
13#include "mlir/IR/Builders.h"
15#include "mlir/IR/Value.h"
17#include "llvm/ADT/SetVector.h"
18#include "llvm/ADT/SmallVector.h"
19#include "llvm/Support/ExtensibleRTTI.h"
20
21#include <queue>
22
23namespace mlir {
24class OffsetSizeAndStrideOpInterface;
25
26/// A hyperrectangular slice, represented as a list of offsets, sizes and
27/// strides.
29public:
33
34 /// Create a hyperrectangular slice with unit strides.
37
38 /// Infer a hyperrectangular slice from `OffsetSizeAndStrideOpInterface`.
39 HyperrectangularSlice(OffsetSizeAndStrideOpInterface op);
40
41 ArrayRef<OpFoldResult> getMixedOffsets() const { return mixedOffsets; }
42 ArrayRef<OpFoldResult> getMixedSizes() const { return mixedSizes; }
43 ArrayRef<OpFoldResult> getMixedStrides() const { return mixedStrides; }
44
45private:
46 SmallVector<OpFoldResult> mixedOffsets;
48 SmallVector<OpFoldResult> mixedStrides;
49};
50
51// Inline size chosen empirically based on compilation profiling.
52// Profiled: 488K calls, avg=1.5+-0.5. N=2 covers >90% of cases inline.
54
55/// Options that control value bound computation.
57 /// By default, lower/equal bounds are closed and upper bounds are open. If
58 /// `closedUB` is set to "true", upper bounds are also closed.
59 bool closedUB = false;
60
61 /// If set to "true", integer-typed SSA values are treated like index-typed
62 /// SSA values. The value bounds infrastructure assumes that such integer
63 /// computations do not overflow. If set to "false", integer-typed SSA values
64 /// are rejected.
65 bool allowIntegerType = false;
66};
67
68/// A helper class to be used with `ValueBoundsOpInterface`. This class stores a
69/// constraint system and mapping of constrained variables to index-typed values
70/// or dimension sizes of shaped values.
71///
72/// Interface implementations of `ValueBoundsOpInterface` use `addBounds` to
73/// insert constraints about their results and/or region block arguments into
74/// the constraint set in the form of an AffineExpr. When a bound should be
75/// expressed in terms of another value/dimension, `getExpr` can be used to
76/// retrieve an AffineExpr that represents the specified value/dimension.
77///
78/// When a value/dimension is retrieved for the first time through `getExpr`,
79/// it is added to an internal worklist. See `computeBound` for more details.
80///
81/// Note: Any modification of existing IR invalides the data stored in this
82/// class. Adding new operations is allowed.
84 : public llvm::RTTIExtends<ValueBoundsConstraintSet, llvm::RTTIRoot> {
85protected:
86 /// Helper class that builds a bound for a shaped value dimension or
87 /// index-typed value.
89 public:
90 /// Specify a dimension, assuming that the underlying value is a shaped
91 /// value.
93
94 // These overloaded operators add lower/upper/equality bounds.
95 void operator<(AffineExpr expr);
96 void operator<=(AffineExpr expr);
97 void operator>(AffineExpr expr);
98 void operator>=(AffineExpr expr);
99 void operator==(AffineExpr expr);
100 void operator<(OpFoldResult ofr);
101 void operator<=(OpFoldResult ofr);
102 void operator>(OpFoldResult ofr);
103 void operator>=(OpFoldResult ofr);
104 void operator==(OpFoldResult ofr);
105 void operator<(int64_t i);
106 void operator<=(int64_t i);
107 void operator>(int64_t i);
108 void operator>=(int64_t i);
109 void operator==(int64_t i);
110
111 protected:
114 : cstr(cstr), value(value) {}
115
116 private:
117 BoundBuilder(const BoundBuilder &) = delete;
118 BoundBuilder &operator=(const BoundBuilder &) = delete;
119 bool operator==(const BoundBuilder &) = delete;
120 bool operator!=(const BoundBuilder &) = delete;
121
123 Value value;
124 std::optional<int64_t> dim;
125 };
126
127public:
128 static char ID;
129
130 /// A variable that can be added to the constraint set as a "column". The
131 /// value bounds infrastructure can compute bounds for variables and compare
132 /// two variables.
133 ///
134 /// Internally, a variable is represented as an affine map and operands.
135 class Variable {
136 public:
137 /// Construct a variable for an index-typed attribute or SSA value.
139
140 /// Construct a variable for an index-typed SSA value.
141 Variable(Value indexValue);
142
143 /// Construct a variable for a dimension of a shaped value.
144 Variable(Value shapedValue, int64_t dim);
145
146 /// Construct a variable for an index-typed attribute/SSA value or for a
147 /// dimension of a shaped value. A non-null dimension must be provided if
148 /// and only if `ofr` is a shaped value.
149 Variable(OpFoldResult ofr, std::optional<int64_t> dim);
150
151 /// Construct a variable for a map and its operands.
152 Variable(AffineMap map, ArrayRef<Variable> mapOperands);
153 Variable(AffineMap map, ValueRange mapOperands);
154
155 MLIRContext *getContext() const { return map.getContext(); }
156
157 /// Returns the affine map.
158 AffineMap getMap() const { return map; }
159
160 /// Returns the map operands.
161 ValueDimList &getOperands() { return mapOperands; }
162 const ValueDimList &getOperands() const { return mapOperands; }
163
164 private:
166 AffineMap map;
167 ValueDimList mapOperands;
168 };
169
170 /// The stop condition when traversing the backward slice of a shaped value/
171 /// index-type value. The traversal continues until the stop condition
172 /// evaluates to "true" for a value.
173 ///
174 /// The first parameter of the function is the shaped value/index-typed
175 /// value. The second parameter is the dimension in case of a shaped value.
176 /// The third parameter is this constraint set.
177 using StopConditionFn = std::function<bool(
178 Value, std::optional<int64_t> /*dim*/, ValueBoundsConstraintSet &cstr)>;
179
180 /// Compute a bound for the given variable. The computed bound is stored in
181 /// `resultMap`. The operands of the bound are stored in `mapOperands`. An
182 /// operand is either an index-type SSA value or a shaped value and a
183 /// dimension.
184 ///
185 /// The bound is computed in terms of values/dimensions for which
186 /// `stopCondition` evaluates to "true". To that end, the backward slice
187 /// (reverse use-def chain) of the given value is visited in a worklist-driven
188 /// manner and the constraint set is populated according to
189 /// `ValueBoundsOpInterface` for each visited value.
190 ///
191 /// By default, lower/equal bounds are closed and upper bounds are open. If
192 /// `options.closedUB` is set to "true", upper bounds are also closed.
193 static LogicalResult
194 computeBound(AffineMap &resultMap, ValueDimList &mapOperands,
195 presburger::BoundType type, const Variable &var,
197
198 /// Compute a bound in terms of the values/dimensions in `dependencies`. The
199 /// computed bound consists of only constant terms and dependent values (or
200 /// dimension sizes thereof).
201 static LogicalResult computeDependentBound(AffineMap &resultMap,
202 ValueDimList &mapOperands,
204 const Variable &var,
205 ValueDimList dependencies,
207
208 /// Compute a bound in that is independent of all values in `independencies`.
209 ///
210 /// Independencies are the opposite of dependencies. The computed bound does
211 /// not contain any SSA values that are part of `independencies`. E.g., this
212 /// function can be used to make ops hoistable from loops. To that end, ops
213 /// must be made independent of loop induction variables (in the case of "for"
214 /// loops). Loop induction variables are the independencies; they may not
215 /// appear in the computed bound.
216 static LogicalResult computeIndependentBound(AffineMap &resultMap,
217 ValueDimList &mapOperands,
219 const Variable &var,
220 ValueRange independencies,
221 ValueBoundsOptions options = {});
222
223 /// Compute a constant bound for the given variable.
224 ///
225 /// This function traverses the backward slice of the given operands in a
226 /// worklist-driven manner until `stopCondition` evaluates to "true". The
227 /// constraint set is populated according to `ValueBoundsOpInterface` for each
228 /// visited value. (No constraints are added for values for which the stop
229 /// condition evaluates to "true".)
230 ///
231 /// The stop condition is optional: If none is specified, the backward slice
232 /// is traversed in a breadth-first manner until a constant bound could be
233 /// computed.
234 ///
235 /// By default, lower/equal bounds are closed and upper bounds are open. If
236 /// `options.closedUB` is set to "true", upper bounds are also closed.
237 static FailureOr<int64_t>
239 const StopConditionFn &stopCondition = nullptr,
240 ValueBoundsOptions options = {});
241
242 /// Compute a constant delta between the given two values. Return "failure"
243 /// if a constant delta could not be determined.
244 ///
245 /// `dim1`/`dim2` must be `nullopt` if and only if `value1`/`value2` are
246 /// index-typed.
247 static FailureOr<int64_t>
248 computeConstantDelta(Value value1, Value value2,
249 std::optional<int64_t> dim1 = std::nullopt,
250 std::optional<int64_t> dim2 = std::nullopt);
251
252 /// Traverse the IR starting from the given value/dim and populate constraints
253 /// as long as the stop condition holds. Also process all values/dims that are
254 /// already on the worklist.
255 void populateConstraints(Value value, std::optional<int64_t> dim);
256
257 /// Comparison operator for `ValueBoundsConstraintSet::compare`.
259
260 /// Populate constraints for lhs/rhs (until the stop condition is met). Then,
261 /// try to prove that, based on the current state of this constraint set
262 /// (i.e., without analyzing additional IR or adding new constraints), the
263 /// "lhs" value/dim is LE/LT/EQ/GT/GE than the "rhs" value/dim.
264 ///
265 /// Return "true" if the specified relation between the two values/dims was
266 /// proven to hold. Return "false" if the specified relation could not be
267 /// proven. This could be because the specified relation does in fact not hold
268 /// or because there is not enough information in the constraint set. In other
269 /// words, if we do not know for sure, this function returns "false".
270 bool populateAndCompare(const Variable &lhs, ComparisonOperator cmp,
271 const Variable &rhs);
272
273 /// Return "true" if "lhs cmp rhs" was proven to hold. Return "false" if the
274 /// specified relation could not be proven. This could be because the
275 /// specified relation does in fact not hold or because there is not enough
276 /// information in the constraint set. In other words, if we do not know for
277 /// sure, this function returns "false".
278 ///
279 /// This function keeps traversing the backward slice of lhs/rhs until could
280 /// prove the relation or until it ran out of IR.
281 static bool compare(const Variable &lhs, ComparisonOperator cmp,
282 const Variable &rhs);
283 /// This function is similar to `ValueBoundsConstraintSet::compare`, except
284 /// that it returns false if `!(lhs cmp rhs)`, and `failure` if neither the
285 /// relation nor its inverse relation could be proven.
286 static llvm::FailureOr<bool> strongCompare(const Variable &lhs,
288 const Variable &rhs);
289
290 /// Compute whether the given variables are equal. Return "failure" if
291 /// equality could not be determined.
292 static FailureOr<bool> areEqual(const Variable &var1, const Variable &var2);
293
294 /// Return "true" if the given slices are guaranteed to be overlapping.
295 /// Return "false" if the given slices are guaranteed to be non-overlapping.
296 /// Return "failure" if unknown.
297 ///
298 /// Slices are overlapping if for all dimensions:
299 /// * offset1 + size1 * stride1 <= offset2
300 /// * and offset2 + size2 * stride2 <= offset1
301 ///
302 /// Slice are non-overlapping if the above constraint is not satisfied for
303 /// at least one dimension.
304 static FailureOr<bool>
306 const HyperrectangularSlice &slice2);
307
308 /// Return "true" if the given slices are guaranteed to be equivalent.
309 /// Return "false" if the given slices are guaranteed to be non-equivalent.
310 /// Return "failure" if unknown.
311 ///
312 /// Slices are equivalent if their offsets, sizes and strices are equal.
313 static FailureOr<bool>
315 const HyperrectangularSlice &slice2);
316
317 /// Add a bound for the given index-typed value or shaped value. This function
318 /// returns a builder that adds the bound.
319 BoundBuilder bound(Value value) { return BoundBuilder(*this, value); }
320
321 /// Return an expression that represents the given index-typed value or shaped
322 /// value dimension. If this value/dimension was not used so far, it is added
323 /// to the worklist.
324 ///
325 /// `dim` must be `nullopt` if and only if the given value is of index type.
326 AffineExpr getExpr(Value value, std::optional<int64_t> dim = std::nullopt);
327
328 /// Return an expression that represents a constant or index-typed SSA value.
329 /// In case of a value, if this value was not used so far, it is added to the
330 /// worklist.
332
333 /// Return an expression that represents a constant.
334 AffineExpr getExpr(int64_t constant);
335
336 /// Debugging only: Dump the constraint set and the column-to-value/dim
337 /// mapping to llvm::errs.
338 void dump() const;
339
340protected:
341 /// Dimension identifier to indicate a value is index-typed. This is used for
342 /// internal data structures/API only.
343 static constexpr int64_t kIndexValue = -1;
344
345 /// An index-typed value or the dimension of a shaped-type value.
346 using ValueDim = std::pair<Value, int64_t>;
347
352
353 /// Return "true" if, based on the current state of the constraint system,
354 /// "lhs cmp rhs" was proven to hold. Return "false" if the specified relation
355 /// could not be proven. This could be because the specified relation does in
356 /// fact not hold or because there is not enough information in the constraint
357 /// set. In other words, if we do not know for sure, this function returns
358 /// "false".
359 ///
360 /// This function does not analyze any IR and does not populate any additional
361 /// constraints.
362 bool comparePos(int64_t lhsPos, ComparisonOperator cmp, int64_t rhsPos);
363
364 /// Return "true" if, based on the current state of the constraint system,
365 /// "lhs cmp rhs" was proven to hold. It returns "false" if "!(lhs cmp rhs)"
366 /// can be proven. Otherwise, it returns `failure` if neither the relation nor
367 /// its inverse relation could be proven.
368 ///
369 /// This function does not analyze any IR and does not populate any additional
370 /// constraints.
371 llvm::FailureOr<bool> strongComparePos(int64_t lhsPos, ComparisonOperator cmp,
372 int64_t rhsPos);
373
374 /// Given an affine map with a single result (and map operands), add a new
375 /// column to the constraint set that represents the result of the map.
376 /// Traverse additional IR starting from the map operands as needed (as long
377 /// as the stop condition is not satisfied). Also process all values/dims that
378 /// are already on the worklist. Return the position of the newly added
379 /// column.
381
382 /// Iteratively process all elements on the worklist until an index-typed
383 /// value or shaped value meets `stopCondition`. Such values are not processed
384 /// any further.
385 void processWorklist();
386
387 /// Bound the given column in the underlying constraint set by the given
388 /// expression.
389 void addBound(presburger::BoundType type, int64_t pos, AffineExpr expr);
390
391 /// Return the column position of the given value/dimension. Asserts that the
392 /// value/dimension exists in the constraint set.
393 int64_t getPos(Value value, std::optional<int64_t> dim = std::nullopt) const;
394
395 /// Return an affine expression that represents column `pos` in the constraint
396 /// set.
398
399 /// Return "true" if the given value/dim is mapped (i.e., has a corresponding
400 /// column in the constraint system).
401 bool isMapped(Value value, std::optional<int64_t> dim = std::nullopt) const;
402
403 /// Insert a value/dimension into the constraint set. If `isSymbol` is set to
404 /// "false", a dimension is added. The value/dimension is added to the
405 /// worklist if `addToWorklist` is set.
406 ///
407 /// Note: There are certain affine restrictions wrt. dimensions. E.g., they
408 /// cannot be multiplied. Furthermore, bounds can only be queried for
409 /// dimensions but not for symbols.
410 int64_t insert(Value value, std::optional<int64_t> dim, bool isSymbol = true,
411 bool addToWorklist = true);
412
413 /// Insert an anonymous column into the constraint set. The column is not
414 /// bound to any value/dimension. If `isSymbol` is set to "false", a dimension
415 /// is added.
416 ///
417 /// Note: There are certain affine restrictions wrt. dimensions. E.g., they
418 /// cannot be multiplied. Furthermore, bounds can only be queried for
419 /// dimensions but not for symbols.
420 int64_t insert(bool isSymbol = true);
421
422 /// Insert the given affine map and its bound operands as a new column in the
423 /// constraint system. Return the position of the new column. Any operands
424 /// that were not analyzed yet are put on the worklist.
425 int64_t insert(AffineMap map, const ValueDimList &operands,
426 bool isSymbol = true);
427 int64_t insert(const Variable &var, bool isSymbol = true);
428
429 /// Project out the given column in the constraint set.
430 void projectOut(int64_t pos);
431
432 /// Project out all columns for which the condition holds.
433 void projectOut(function_ref<bool(ValueDim)> condition);
434
435 void projectOutAnonymous(std::optional<int64_t> except = std::nullopt);
436
437 /// Mapping of columns to values/shape dimensions.
438 // Inline size chosen empirically based on compilation profiling.
439 // Profiled: 2.1M calls, avg=3.0+-1.9. N=4 covers ~70% of cases inline.
441 /// Reverse mapping of values/shape dimensions to columns.
443
444 /// Worklist of values/shape dimensions that have not been processed yet.
445 std::queue<int64_t> worklist;
446
447 /// Constraint system of equalities and inequalities.
449
450 /// Builder for constructing affine expressions.
452
453 /// The current stop condition function.
455
456 /// Options that control value bound computation.
458
459 /// Should conservative bounds be added for semi-affine expressions.
461};
462
463} // namespace mlir
464
465#include "mlir/Interfaces/ValueBoundsOpInterface.h.inc"
466
467#endif // MLIR_INTERFACES_VALUEBOUNDSOPINTERFACE_H_
lhs
static llvm::ManagedStatic< PassManagerOptions > options
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 is a general helper class for creating context-global objects like types,...
Definition Builders.h:51
FlatLinearConstraints is an extension of IntegerPolyhedron.
A hyperrectangular slice, represented as a list of offsets, sizes and strides.
HyperrectangularSlice(ArrayRef< OpFoldResult > offsets, ArrayRef< OpFoldResult > sizes, ArrayRef< OpFoldResult > strides)
ArrayRef< OpFoldResult > getMixedStrides() const
ArrayRef< OpFoldResult > getMixedSizes() const
ArrayRef< OpFoldResult > getMixedOffsets() const
MLIRContext is the top-level object for a collection of MLIR operations.
Definition MLIRContext.h:63
This class represents a single result from folding an operation.
Helper class that builds a bound for a shaped value dimension or index-typed value.
BoundBuilder(ValueBoundsConstraintSet &cstr, Value value)
BoundBuilder & operator[](int64_t dim)
Specify a dimension, assuming that the underlying value is a shaped value.
A variable that can be added to the constraint set as a "column".
ValueDimList & getOperands()
Returns the map operands.
Variable(OpFoldResult ofr)
Construct a variable for an index-typed attribute or SSA value.
AffineMap getMap() const
Returns the affine map.
static bool compare(const Variable &lhs, ComparisonOperator cmp, const Variable &rhs)
Return "true" if "lhs cmp rhs" was proven to hold.
static FailureOr< bool > areEqual(const Variable &var1, const Variable &var2)
Compute whether the given variables are equal.
static LogicalResult computeBound(AffineMap &resultMap, ValueDimList &mapOperands, presburger::BoundType type, const Variable &var, StopConditionFn stopCondition, ValueBoundsOptions options={})
Compute a bound for the given variable.
DenseMap< ValueDim, int64_t > valueDimToPosition
Reverse mapping of values/shape dimensions to columns.
void processWorklist()
Iteratively process all elements on the worklist until an index-typed value or shaped value meets sto...
bool addConservativeSemiAffineBounds
Should conservative bounds be added for semi-affine expressions.
AffineExpr getExpr(Value value, std::optional< int64_t > dim=std::nullopt)
Return an expression that represents the given index-typed value or shaped value dimension.
static FailureOr< bool > areEquivalentSlices(MLIRContext *ctx, const HyperrectangularSlice &slice1, const HyperrectangularSlice &slice2)
Return "true" if the given slices are guaranteed to be equivalent.
ValueBoundsConstraintSet(MLIRContext *ctx, const StopConditionFn &stopCondition, ValueBoundsOptions options={}, bool addConservativeSemiAffineBounds=false)
void projectOut(int64_t pos)
Project out the given column in the constraint set.
std::function< bool( Value, std::optional< int64_t >, ValueBoundsConstraintSet &cstr)> StopConditionFn
The stop condition when traversing the backward slice of a shaped value/ index-type value.
static FailureOr< int64_t > computeConstantDelta(Value value1, Value value2, std::optional< int64_t > dim1=std::nullopt, std::optional< int64_t > dim2=std::nullopt)
Compute a constant delta between the given two values.
static llvm::FailureOr< bool > strongCompare(const Variable &lhs, ComparisonOperator cmp, const Variable &rhs)
This function is similar to ValueBoundsConstraintSet::compare, except that it returns false if !...
static FailureOr< int64_t > computeConstantBound(presburger::BoundType type, const Variable &var, const StopConditionFn &stopCondition=nullptr, ValueBoundsOptions options={})
Compute a constant bound for the given variable.
void addBound(presburger::BoundType type, int64_t pos, AffineExpr expr)
Bound the given column in the underlying constraint set by the given expression.
StopConditionFn stopCondition
The current stop condition function.
ComparisonOperator
Comparison operator for ValueBoundsConstraintSet::compare.
BoundBuilder bound(Value value)
Add a bound for the given index-typed value or shaped value.
int64_t getPos(Value value, std::optional< int64_t > dim=std::nullopt) const
Return the column position of the given value/dimension.
int64_t insert(Value value, std::optional< int64_t > dim, bool isSymbol=true, bool addToWorklist=true)
Insert a value/dimension into the constraint set.
bool comparePos(int64_t lhsPos, ComparisonOperator cmp, int64_t rhsPos)
Return "true" if, based on the current state of the constraint system, "lhs cmp rhs" was proven to ho...
ValueBoundsOptions options
Options that control value bound computation.
SmallVector< std::optional< ValueDim >, 4 > positionToValueDim
Mapping of columns to values/shape dimensions.
void dump() const
Debugging only: Dump the constraint set and the column-to-value/dim mapping to llvm::errs.
std::queue< int64_t > worklist
Worklist of values/shape dimensions that have not been processed yet.
FlatLinearConstraints cstr
Constraint system of equalities and inequalities.
static LogicalResult computeIndependentBound(AffineMap &resultMap, ValueDimList &mapOperands, presburger::BoundType type, const Variable &var, ValueRange independencies, ValueBoundsOptions options={})
Compute a bound in that is independent of all values in independencies.
bool isMapped(Value value, std::optional< int64_t > dim=std::nullopt) const
Return "true" if the given value/dim is mapped (i.e., has a corresponding column in the constraint sy...
llvm::FailureOr< bool > strongComparePos(int64_t lhsPos, ComparisonOperator cmp, int64_t rhsPos)
Return "true" if, based on the current state of the constraint system, "lhs cmp rhs" was proven to ho...
AffineExpr getPosExpr(int64_t pos)
Return an affine expression that represents column pos in the constraint set.
void projectOutAnonymous(std::optional< int64_t > except=std::nullopt)
static FailureOr< bool > areOverlappingSlices(MLIRContext *ctx, const HyperrectangularSlice &slice1, const HyperrectangularSlice &slice2)
Return "true" if the given slices are guaranteed to be overlapping.
std::pair< Value, int64_t > ValueDim
An index-typed value or the dimension of a shaped-type value.
void populateConstraints(Value value, std::optional< int64_t > dim)
Traverse the IR starting from the given value/dim and populate constraints as long as the stop condit...
Builder builder
Builder for constructing affine expressions.
bool populateAndCompare(const Variable &lhs, ComparisonOperator cmp, const Variable &rhs)
Populate constraints for lhs/rhs (until the stop condition is met).
static constexpr int64_t kIndexValue
Dimension identifier to indicate a value is index-typed.
static LogicalResult computeDependentBound(AffineMap &resultMap, ValueDimList &mapOperands, presburger::BoundType type, const Variable &var, ValueDimList dependencies, ValueBoundsOptions options={})
Compute a bound in terms of the values/dimensions in dependencies.
This class provides an abstraction over the different types of ranges over Values.
Definition ValueRange.h:389
This class represents an instance of an SSA value in the MLIR system, representing a computable value...
Definition Value.h:96
BoundType
The type of bound: equal, lower bound or upper bound.
Include the generated interface declarations.
bool operator!=(RegionBranchPoint lhs, RegionBranchPoint rhs)
SmallVector< std::pair< Value, std::optional< int64_t > >, 2 > ValueDimList
llvm::DenseMap< KeyT, ValueT, KeyInfoT, BucketT > DenseMap
Definition LLVM.h:120
llvm::function_ref< Fn > function_ref
Definition LLVM.h:147
Options that control value bound computation.
bool allowIntegerType
If set to "true", integer-typed SSA values are treated like index-typed SSA values.
bool closedUB
By default, lower/equal bounds are closed and upper bounds are open.