MLIR  20.0.0git
Public Types | Public Member Functions | List of all members
mlir::ValueShapeRange Class Reference

Range of values and shapes (corresponding effectively to Shapes dialect's ValueShape type concept). More...

#include "mlir/Interfaces/InferTypeOpInterface.h"

+ Inheritance diagram for mlir::ValueShapeRange:

Public Types

using ValueShapeMapFn = function_ref< ShapeAdaptor(Value)>
 
using type_iterator = ValueTypeIterator< iterator >
 Returns the types of the values within this range. More...
 
using type_range = ValueTypeRange< ValueRange >
 

Public Member Functions

 ValueShapeRange (ValueRange values, ValueShapeMapFn operandShape=nullptr, ValueShapeMapFn valueToShape=nullptr)
 
 ValueShapeRange (const std::initializer_list< Value > &values)
 
 ValueShapeRange (const ValueShapeRange &)=default
 
ValueShapeRangesetValueToShapeMapping (ValueShapeMapFn fn)
 Sets the Value to ShapeAdaptor mapping function and returns this. More...
 
ValueShapeRangesetOperandShapeMapping (ValueShapeMapFn fn)
 
ValueShapeMapFn getValueToShapeMapping () const
 Returns the set Value to ShapeAdaptor mapping function. More...
 
ValueShapeMapFn getOperandShapeMapping () const
 
type_range getTypes () const
 
auto getType () const
 
ValueRange getValues () const
 Returns the Values in the ValueRange. More...
 
ShapeAdaptor getValueAsShape (int index)
 Returns an argument as shape. More...
 
ShapeAdaptor getShape (int index) const
 Returns the shape of index'th operand. More...
 
ShapeAdaptor getShape (Value val) const
 Returns the shape of the given Value. More...
 

Detailed Description

Range of values and shapes (corresponding effectively to Shapes dialect's ValueShape type concept).

Definition at line 170 of file InferTypeOpInterface.h.

Member Typedef Documentation

◆ type_iterator

Returns the types of the values within this range.

Note: This returns only the types of Values in the ValueRange and not a more refined type.

Definition at line 203 of file InferTypeOpInterface.h.

◆ type_range

Definition at line 204 of file InferTypeOpInterface.h.

◆ ValueShapeMapFn

Definition at line 172 of file InferTypeOpInterface.h.

Constructor & Destructor Documentation

◆ ValueShapeRange() [1/3]

mlir::ValueShapeRange::ValueShapeRange ( ValueRange  values,
ValueShapeMapFn  operandShape = nullptr,
ValueShapeMapFn  valueToShape = nullptr 
)
inline

Definition at line 174 of file InferTypeOpInterface.h.

◆ ValueShapeRange() [2/3]

mlir::ValueShapeRange::ValueShapeRange ( const std::initializer_list< Value > &  values)
inline

Definition at line 178 of file InferTypeOpInterface.h.

◆ ValueShapeRange() [3/3]

mlir::ValueShapeRange::ValueShapeRange ( const ValueShapeRange )
default

Member Function Documentation

◆ getOperandShapeMapping()

ValueShapeMapFn mlir::ValueShapeRange::getOperandShapeMapping ( ) const
inline

Definition at line 196 of file InferTypeOpInterface.h.

◆ getShape() [1/2]

ShapeAdaptor ValueShapeRange::getShape ( int  index) const

Returns the shape of index'th operand.

Definition at line 213 of file InferTypeOpInterface.cpp.

Referenced by resolveBroadcastShape().

◆ getShape() [2/2]

ShapeAdaptor ValueShapeRange::getShape ( Value  val) const

Returns the shape of the given Value.

Definition at line 206 of file InferTypeOpInterface.cpp.

References mlir::Value::getType().

◆ getType()

auto mlir::ValueShapeRange::getType ( ) const
inline

Definition at line 206 of file InferTypeOpInterface.h.

References getTypes().

◆ getTypes()

type_range mlir::ValueShapeRange::getTypes ( ) const
inline

Definition at line 205 of file InferTypeOpInterface.h.

Referenced by getType().

◆ getValueAsShape()

ShapeAdaptor ValueShapeRange::getValueAsShape ( int  index)

Returns an argument as shape.

If the argument is not constant or not a shape, then the function returns a nullptr. This will first query the valueToShape mapping (if set), before querying the ValueRange.

Definition at line 192 of file InferTypeOpInterface.cpp.

References mlir::m_Constant(), and mlir::matchPattern().

◆ getValues()

ValueRange mlir::ValueShapeRange::getValues ( ) const
inline

Returns the Values in the ValueRange.

To query the most up to date shape of a Value, query the shape using getShape below rather than using the type of the Value.

Definition at line 211 of file InferTypeOpInterface.h.

◆ getValueToShapeMapping()

ValueShapeMapFn mlir::ValueShapeRange::getValueToShapeMapping ( ) const
inline

Returns the set Value to ShapeAdaptor mapping function.

Definition at line 195 of file InferTypeOpInterface.h.

◆ setOperandShapeMapping()

ValueShapeRange& mlir::ValueShapeRange::setOperandShapeMapping ( ValueShapeMapFn  fn)
inline

Definition at line 189 of file InferTypeOpInterface.h.

◆ setValueToShapeMapping()

ValueShapeRange& mlir::ValueShapeRange::setValueToShapeMapping ( ValueShapeMapFn  fn)
inline

Sets the Value to ShapeAdaptor mapping function and returns this.

Definition at line 184 of file InferTypeOpInterface.h.


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