MLIR  19.0.0git
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
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_t > sizes
 
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 sizes.

Member Function Documentation

◆ getKnowledgeFromType()

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

Definition at line 45 of file ShapeUtils.h.

References dtype, getPessimisticValueState(), hasRank, and sizes.

◆ getPessimisticValueState()

static 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, mlir::get(), hasRank, and sizes.

◆ join()

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

Definition at line 81 of file ShapeUtils.h.

References dtype, getPessimisticValueState(), hasError, hasRank, and sizes.

◆ meet()

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

Definition at line 136 of file ShapeUtils.h.

References dtype, getPessimisticValueState(), hasError, hasRank, and sizes.

◆ 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, and sizes.

Member Data Documentation

◆ dtype

Type mlir::tosa::ValueKnowledge::dtype

Definition at line 178 of file ShapeUtils.h.

Referenced by getKnowledgeFromType(), getType(), join(), meet(), and operator==().

◆ hasError

bool mlir::tosa::ValueKnowledge::hasError

Definition at line 169 of file ShapeUtils.h.

Referenced by join(), meet(), and operator bool().

◆ hasRank

bool mlir::tosa::ValueKnowledge::hasRank

◆ sizes

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

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