MLIR  19.0.0git
List of all members
mlir::vector::detail::ValueBoundsConstraintSet Struct Reference

Parent class for the value bounds RTTIExtends. More...

#include "mlir/Dialect/Vector/IR/ScalableValueBoundsConstraintSet.h"

+ Inheritance diagram for mlir::vector::detail::ValueBoundsConstraintSet:

Additional Inherited Members

- Protected Types inherited from mlir::ValueBoundsConstraintSet
using ValueDim = std::pair< Value, int64_t >
 An index-typed value or the dimension of a shaped-type value. More...
 
enum  ComparisonOperator {
  LT , LE , EQ , GT ,
  GE
}
 Comparison operator for ValueBoundsConstraintSet::compare. More...
 
using StopConditionFn = std::function< bool(Value, std::optional< int64_t >, ValueBoundsConstraintSet &cstr)>
 The stop condition when traversing the backward slice of a shaped value/ index-type value. More...
 
- Protected Member Functions inherited from mlir::ValueBoundsConstraintSet
 ValueBoundsConstraintSet (MLIRContext *ctx, StopConditionFn stopCondition, bool addConservativeSemiAffineBounds=false)
 
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 hold. More...
 
int64_t populateConstraints (AffineMap map, ValueDimList mapOperands)
 Given an affine map with a single result (and map operands), add a new column to the constraint set that represents the result of the map. More...
 
void processWorklist ()
 Iteratively process all elements on the worklist until an index-typed value or shaped value meets stopCondition. More...
 
void addBound (presburger::BoundType type, int64_t pos, AffineExpr expr)
 Bound the given column in the underlying constraint set by the given expression. More...
 
int64_t getPos (Value value, std::optional< int64_t > dim=std::nullopt) const
 Return the column position of the given value/dimension. More...
 
AffineExpr getPosExpr (int64_t pos)
 Return an affine expression that represents column pos in the constraint set. More...
 
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 system). More...
 
int64_t insert (Value value, std::optional< int64_t > dim, bool isSymbol=true, bool addToWorklist=true)
 Insert a value/dimension into the constraint set. More...
 
int64_t insert (bool isSymbol=true)
 Insert an anonymous column into the constraint set. More...
 
int64_t insert (AffineMap map, ValueDimList operands, bool isSymbol=true)
 Insert the given affine map and its bound operands as a new column in the constraint system. More...
 
int64_t insert (const Variable &var, bool isSymbol=true)
 
void projectOut (int64_t pos)
 Project out the given column in the constraint set. More...
 
void projectOut (function_ref< bool(ValueDim)> condition)
 Project out all columns for which the condition holds. More...
 
void projectOutAnonymous (std::optional< int64_t > except=std::nullopt)
 
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 condition holds. More...
 
bool populateAndCompare (const Variable &lhs, ComparisonOperator cmp, const Variable &rhs)
 Populate constraints for lhs/rhs (until the stop condition is met). More...
 
BoundBuilder bound (Value value)
 Add a bound for the given index-typed value or shaped value. More...
 
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. More...
 
AffineExpr getExpr (OpFoldResult ofr)
 Return an expression that represents a constant or index-typed SSA value. More...
 
AffineExpr getExpr (int64_t constant)
 Return an expression that represents a constant. More...
 
void dump () const
 Debugging only: Dump the constraint set and the column-to-value/dim mapping to llvm::errs. More...
 
- Static Protected Member Functions inherited from mlir::ValueBoundsConstraintSet
static LogicalResult computeBound (AffineMap &resultMap, ValueDimList &mapOperands, presburger::BoundType type, const Variable &var, StopConditionFn stopCondition, bool closedUB=false)
 Compute a bound for the given variable. More...
 
static LogicalResult computeDependentBound (AffineMap &resultMap, ValueDimList &mapOperands, presburger::BoundType type, const Variable &var, ValueDimList dependencies, bool closedUB=false)
 Compute a bound in terms of the values/dimensions in dependencies. More...
 
static LogicalResult computeIndependentBound (AffineMap &resultMap, ValueDimList &mapOperands, presburger::BoundType type, const Variable &var, ValueRange independencies, bool closedUB=false)
 Compute a bound in that is independent of all values in independencies. More...
 
static FailureOr< int64_t > computeConstantBound (presburger::BoundType type, const Variable &var, StopConditionFn stopCondition=nullptr, bool closedUB=false)
 Compute a constant bound for the given variable. More...
 
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. More...
 
static bool compare (const Variable &lhs, ComparisonOperator cmp, const Variable &rhs)
 Return "true" if "lhs cmp rhs" was proven to hold. More...
 
static FailureOr< bool > areEqual (const Variable &var1, const Variable &var2)
 Compute whether the given variables are equal. More...
 
static FailureOr< bool > areOverlappingSlices (MLIRContext *ctx, HyperrectangularSlice slice1, HyperrectangularSlice slice2)
 Return "true" if the given slices are guaranteed to be overlapping. More...
 
static FailureOr< bool > areEquivalentSlices (MLIRContext *ctx, HyperrectangularSlice slice1, HyperrectangularSlice slice2)
 Return "true" if the given slices are guaranteed to be equivalent. More...
 
- Protected Attributes inherited from mlir::ValueBoundsConstraintSet
SmallVector< std::optional< ValueDim > > positionToValueDim
 Mapping of columns to values/shape dimensions. More...
 
DenseMap< ValueDim, int64_t > valueDimToPosition
 Reverse mapping of values/shape dimensions to columns. More...
 
std::queue< int64_t > worklist
 Worklist of values/shape dimensions that have not been processed yet. More...
 
FlatLinearConstraints cstr
 Constraint system of equalities and inequalities. More...
 
Builder builder
 Builder for constructing affine expressions. More...
 
StopConditionFn stopCondition = nullptr
 The current stop condition function. More...
 
bool addConservativeSemiAffineBounds = false
 Should conservative bounds be added for semi-affine expressions. More...
 
- Static Protected Attributes inherited from mlir::ValueBoundsConstraintSet
static constexpr int64_t kIndexValue = -1
 Dimension identifier to indicate a value is index-typed. More...
 
static char ID = 0
 

Detailed Description

Parent class for the value bounds RTTIExtends.

Uses protected inheritance to hide all ValueBoundsConstraintSet methods by default (as some do not use the ScalableValueBoundsConstraintSet, so may produce unexpected results).

Definition at line 23 of file ScalableValueBoundsConstraintSet.h.


The documentation for this struct was generated from the following file: