9#ifndef MLIR_DIALECT_VECTOR_IR_SCALABLEVALUEBOUNDSCONSTRAINTSET_H
10#define MLIR_DIALECT_VECTOR_IR_SCALABLEVALUEBOUNDSCONSTRAINTSET_H
30 :
public llvm::RTTIExtends<ScalableValueBoundsConstraintSet,
31 detail::ValueBoundsConstraintSet> {
35 unsigned vscaleMin,
unsigned vscaleMax)
36 : RTTIExtends(context, stopCondition,
38 vscaleMin(vscaleMin), vscaleMax(vscaleMax) {};
40 using RTTIExtends::bound;
41 using RTTIExtends::StopConditionFn;
57 FailureOr<BoundSize>
getSize()
const;
71 static FailureOr<ConstantOrScalableBound>
73 unsigned vscaleMin,
unsigned vscaleMax,
82 assert(!vscale &&
"expected vscale to be unset");
83 vscale = vscaleOp.getResult();
95 const unsigned vscaleMin;
96 const unsigned vscaleMax;
100 Value vscale =
nullptr;
function_ref< bool(Region *, ArrayRef< bool > visited)> StopConditionFn
Stop condition for traverseRegionGraph.
true
Given two iterators into the same block, return "true" if a is before `b.
A multi-dimensional affine map Affine map's are immutable like Type's, and they are uniqued.
MLIRContext is the top-level object for a collection of MLIR operations.
A helper class to be used with ValueBoundsOpInterface.
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.
ValueBoundsConstraintSet(MLIRContext *ctx, const StopConditionFn &stopCondition, bool addConservativeSemiAffineBounds=false)
This class represents an instance of an SSA value in the MLIR system, representing a computable value...
BoundType
The type of bound: equal, lower bound or upper bound.
ScalableValueBoundsConstraintSet::ConstantOrScalableBound ConstantOrScalableBound
A thin wrapper over an AffineMap which can represent a constant bound, or a scalable bound (in terms ...
FailureOr< BoundSize > getSize() const
Get the (possibly) scalable size of the bound, returns failure if the bound cannot be represented as ...
unsigned getVscaleMin() const
The minimum possible value of vscale.
static FailureOr< ConstantOrScalableBound > computeScalableBound(Value value, std::optional< int64_t > dim, unsigned vscaleMin, unsigned vscaleMax, presburger::BoundType boundType, bool closedUB=true, const StopConditionFn &stopCondition=nullptr)
Computes a (possibly) scalable bound for a given value.
Value getVscaleValue() const
Get the value of vscale. Returns nullptr vscale as not been encountered.
ScalableValueBoundsConstraintSet(MLIRContext *context, ValueBoundsConstraintSet::StopConditionFn stopCondition, unsigned vscaleMin, unsigned vscaleMax)
unsigned getVscaleMax() const
The maximum possible value of vscale.
void setVscale(vector::VectorScaleOp vscaleOp)
Sets the value of vscale. Asserts if vscale has already been set.
ValueBoundsConstraintSet(MLIRContext *ctx, const StopConditionFn &stopCondition, bool addConservativeSemiAffineBounds=false)