MLIR  20.0.0git
Classes | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
mlir::vector::ScalableValueBoundsConstraintSet Struct Reference

A version of ValueBoundsConstraintSet that can solve for scalable bounds. More...

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

+ Inheritance diagram for mlir::vector::ScalableValueBoundsConstraintSet:

Classes

struct  ConstantOrScalableBound
 A thin wrapper over an AffineMap which can represent a constant bound, or a scalable bound (in terms of vscale). More...
 

Public Member Functions

 ScalableValueBoundsConstraintSet (MLIRContext *context, ValueBoundsConstraintSet::StopConditionFn stopCondition, unsigned vscaleMin, unsigned vscaleMax)
 
Value getVscaleValue () const
 Get the value of vscale. Returns nullptr vscale as not been encountered. More...
 
void setVscale (vector::VectorScaleOp vscaleOp)
 Sets the value of vscale. Asserts if vscale has already been set. More...
 
unsigned getVscaleMin () const
 The minimum possible value of vscale. More...
 
unsigned getVscaleMax () const
 The maximum possible value of vscale. More...
 

Static Public Member Functions

static FailureOr< ConstantOrScalableBoundcomputeScalableBound (Value value, std::optional< int64_t > dim, unsigned vscaleMin, unsigned vscaleMax, presburger::BoundType boundType, bool closedUB=true, StopConditionFn stopCondition=nullptr)
 Computes a (possibly) scalable bound for a given value. More...
 

Static Public Attributes

static char ID = 0
 

Detailed Description

A version of ValueBoundsConstraintSet that can solve for scalable bounds.

Definition at line 29 of file ScalableValueBoundsConstraintSet.h.

Constructor & Destructor Documentation

◆ ScalableValueBoundsConstraintSet()

mlir::vector::ScalableValueBoundsConstraintSet::ScalableValueBoundsConstraintSet ( MLIRContext context,
ValueBoundsConstraintSet::StopConditionFn  stopCondition,
unsigned  vscaleMin,
unsigned  vscaleMax 
)
inline

Definition at line 32 of file ScalableValueBoundsConstraintSet.h.

Member Function Documentation

◆ computeScalableBound()

FailureOr< ConstantOrScalableBound > mlir::vector::ScalableValueBoundsConstraintSet::computeScalableBound ( Value  value,
std::optional< int64_t >  dim,
unsigned  vscaleMin,
unsigned  vscaleMax,
presburger::BoundType  boundType,
bool  closedUB = true,
StopConditionFn  stopCondition = nullptr 
)
static

Computes a (possibly) scalable bound for a given value.

This is similar to ValueBoundsConstraintSet::computeConstantBound(), but uses knowledge of the range of vscale to compute either a constant bound, an expression in terms of vscale, or failure if no bound can be computed.

The resulting AffineMap will always take at most one parameter, vscale, and return a single result, which is the bound of value.

Note: vscaleMin must be <= to vscaleMax. If vscaleMin == vscaleMax, the resulting bound (if found), will be constant.

Definition at line 44 of file ScalableValueBoundsConstraintSet.cpp.

References mlir::Value::getContext(), getVscaleValue(), and mlir::ValueBoundsConstraintSet::kIndexValue.

◆ getVscaleMax()

unsigned mlir::vector::ScalableValueBoundsConstraintSet::getVscaleMax ( ) const
inline

The maximum possible value of vscale.

Definition at line 90 of file ScalableValueBoundsConstraintSet.h.

◆ getVscaleMin()

unsigned mlir::vector::ScalableValueBoundsConstraintSet::getVscaleMin ( ) const
inline

The minimum possible value of vscale.

Definition at line 87 of file ScalableValueBoundsConstraintSet.h.

◆ getVscaleValue()

Value mlir::vector::ScalableValueBoundsConstraintSet::getVscaleValue ( ) const
inline

Get the value of vscale. Returns nullptr vscale as not been encountered.

Definition at line 78 of file ScalableValueBoundsConstraintSet.h.

Referenced by computeScalableBound().

◆ setVscale()

void mlir::vector::ScalableValueBoundsConstraintSet::setVscale ( vector::VectorScaleOp  vscaleOp)
inline

Sets the value of vscale. Asserts if vscale has already been set.

Definition at line 81 of file ScalableValueBoundsConstraintSet.h.

Member Data Documentation

◆ ID

char mlir::vector::ScalableValueBoundsConstraintSet::ID = 0
static

Definition at line 92 of file ScalableValueBoundsConstraintSet.h.


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