MLIR 22.0.0git
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.
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.
ValueShapeRangesetOperandShapeMapping (ValueShapeMapFn fn)
ValueShapeMapFn getValueToShapeMapping () const
 Returns the set Value to ShapeAdaptor mapping function.
ValueShapeMapFn getOperandShapeMapping () const
type_range getTypes () const
auto getType () const
ValueRange getValues () const
 Returns the Values in the ValueRange.
ShapeAdaptor getValueAsShape (int index)
 Returns an argument as shape.
ShapeAdaptor getShape (int index) const
 Returns the shape of index'th operand.
ShapeAdaptor getShape (Value val) const
 Returns the shape of the given Value.

Detailed Description

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

Definition at line 174 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 207 of file InferTypeOpInterface.h.

◆ type_range

◆ ValueShapeMapFn

Constructor & Destructor Documentation

◆ ValueShapeRange() [1/3]

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

◆ ValueShapeRange() [2/3]

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

Definition at line 182 of file InferTypeOpInterface.h.

References ValueShapeRange().

◆ ValueShapeRange() [3/3]

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

References ValueShapeRange().

Member Function Documentation

◆ getOperandShapeMapping()

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

Definition at line 200 of file InferTypeOpInterface.h.

◆ getShape() [1/2]

ShapeAdaptor ValueShapeRange::getShape ( int index) const

Returns the shape of index'th operand.

Definition at line 221 of file InferTypeOpInterface.cpp.

References getShape().

Referenced by getShape(), and resolveBroadcastShape().

◆ getShape() [2/2]

ShapeAdaptor ValueShapeRange::getShape ( Value val) const

Returns the shape of the given Value.

Definition at line 214 of file InferTypeOpInterface.cpp.

References mlir::Value::getType().

◆ getType()

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

Definition at line 210 of file InferTypeOpInterface.h.

References getTypes().

◆ getTypes()

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

Definition at line 209 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 200 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 215 of file InferTypeOpInterface.h.

References ValueRange.

◆ getValueToShapeMapping()

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

Returns the set Value to ShapeAdaptor mapping function.

Definition at line 199 of file InferTypeOpInterface.h.

◆ setOperandShapeMapping()

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

Definition at line 193 of file InferTypeOpInterface.h.

References ValueShapeRange().

◆ setValueToShapeMapping()

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

Sets the Value to ShapeAdaptor mapping function and returns this.

Definition at line 188 of file InferTypeOpInterface.h.

References ValueShapeRange().


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