MLIR 22.0.0git
mlir::tosa::ValueKnowledge Struct Reference

Statically known information for a particular Value. More...

#include "mlir/Dialect/Tosa/Utils/ShapeUtils.h"

Public Member Functions

 ValueKnowledge ()=delete
 ValueKnowledge (bool hasRank, llvm::ArrayRef< int64_t > newSizes, Type dtype)
 operator bool () const
ShapedTypeComponents getShapedTypeComponents () const
Type getType () const
bool operator== (const ValueKnowledge &rhs) const

Static Public Member Functions

static ValueKnowledge getKnowledgeFromType (Type type)
static ValueKnowledge getPessimisticValueState ()
static ValueKnowledge join (const ValueKnowledge &lhs, const ValueKnowledge &rhs)
static ValueKnowledge meet (const ValueKnowledge &lhs, const ValueKnowledge &rhs)

Public Attributes

bool hasError
bool hasRank
llvm::SmallVector< int64_tsizes
Type dtype

Detailed Description

Statically known information for a particular Value.

This struct currently tracks only information relevant for tensor/array-like shaped types. It is fine to associate a ValueKnowledge with a non-shaped type as long as it is in the default "no knowledge" state returned by getPessimisticValueState. The important invariant is that we cannot claim to know something about a value which is false.

This class could also be called "dataflow facts", "lattice value", etc.

Definition at line 33 of file ShapeUtils.h.

Constructor & Destructor Documentation

◆ ValueKnowledge() [1/2]

mlir::tosa::ValueKnowledge::ValueKnowledge ( )
delete

◆ ValueKnowledge() [2/2]

mlir::tosa::ValueKnowledge::ValueKnowledge ( bool hasRank,
llvm::ArrayRef< int64_t > newSizes,
Type dtype )
inline

Definition at line 35 of file ShapeUtils.h.

References dtype, false, for(), hasError, hasRank, and sizes.

Member Function Documentation

◆ getKnowledgeFromType()

ValueKnowledge mlir::tosa::ValueKnowledge::getKnowledgeFromType ( Type type)
inlinestatic

Definition at line 45 of file ShapeUtils.h.

References getPessimisticValueState(), result, and ValueKnowledge().

◆ getPessimisticValueState()

ValueKnowledge mlir::tosa::ValueKnowledge::getPessimisticValueState ( )
inlinestatic

Definition at line 61 of file ShapeUtils.h.

References ValueKnowledge().

Referenced by getKnowledgeFromType(), join(), and meet().

◆ getShapedTypeComponents()

ShapedTypeComponents mlir::tosa::ValueKnowledge::getShapedTypeComponents ( ) const
inline

Definition at line 65 of file ShapeUtils.h.

References hasRank, and sizes.

◆ getType()

Type mlir::tosa::ValueKnowledge::getType ( ) const
inline

Definition at line 69 of file ShapeUtils.h.

References dtype, hasRank, and sizes.

◆ join()

ValueKnowledge mlir::tosa::ValueKnowledge::join ( const ValueKnowledge & lhs,
const ValueKnowledge & rhs )
inlinestatic

Definition at line 81 of file ShapeUtils.h.

References getPessimisticValueState(), lhs, result, rhs, and ValueKnowledge().

◆ meet()

ValueKnowledge mlir::tosa::ValueKnowledge::meet ( const ValueKnowledge & lhs,
const ValueKnowledge & rhs )
inlinestatic

Definition at line 136 of file ShapeUtils.h.

References getPessimisticValueState(), lhs, result, rhs, and ValueKnowledge().

◆ operator bool()

mlir::tosa::ValueKnowledge::operator bool ( ) const
inline

Definition at line 42 of file ShapeUtils.h.

References hasError.

◆ operator==()

bool mlir::tosa::ValueKnowledge::operator== ( const ValueKnowledge & rhs) const
inline

Definition at line 75 of file ShapeUtils.h.

References dtype, hasRank, rhs, sizes, and ValueKnowledge().

Member Data Documentation

◆ dtype

Type mlir::tosa::ValueKnowledge::dtype

Definition at line 178 of file ShapeUtils.h.

Referenced by getType(), operator==(), and ValueKnowledge().

◆ hasError

bool mlir::tosa::ValueKnowledge::hasError

Definition at line 169 of file ShapeUtils.h.

Referenced by operator bool(), and ValueKnowledge().

◆ hasRank

bool mlir::tosa::ValueKnowledge::hasRank

Definition at line 171 of file ShapeUtils.h.

Referenced by getShapedTypeComponents(), getType(), operator==(), and ValueKnowledge().

◆ sizes

llvm::SmallVector<int64_t> mlir::tosa::ValueKnowledge::sizes

Definition at line 174 of file ShapeUtils.h.

Referenced by getShapedTypeComponents(), getType(), operator==(), and ValueKnowledge().


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