MLIR  19.0.0git
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
mlir::sparse_tensor::ir_detail::Var Class Reference

A concrete variable, to be used in our variant of AffineExpr. More...

#include "Dialect/SparseTensor/IR/Detail/Var.h"

+ Inheritance diagram for mlir::sparse_tensor::ir_detail::Var:

Classes

class  Impl
 The underlying implementation of Var. More...
 

Public Types

using Num = unsigned
 Typedef for the type of variable numbers. More...
 

Public Member Functions

constexpr Var (VarKind vk, Num n)
 
 Var (AffineSymbolExpr sym)
 
 Var (VarKind vk, AffineDimExpr var)
 
constexpr bool operator== (Var other) const
 
constexpr bool operator!= (Var other) const
 
constexpr VarKind getKind () const
 
constexpr Num getNum () const
 
template<typename U >
constexpr bool isa () const
 
template<typename U >
constexpr U cast () const
 
template<typename U >
constexpr std::optional< U > dyn_cast () const
 
std::string str () const
 
void print (llvm::raw_ostream &os) const
 
void print (AsmPrinter &printer) const
 
void dump () const
 

Static Public Member Functions

static constexpr bool isWF_Num (Num n)
 Checks whether the number would be accepted by Var(VarKind,Var::Num). More...
 

Protected Member Functions

constexpr Var (Impl impl)
 Protected ctor for the RTTI methods to use. More...
 

Detailed Description

A concrete variable, to be used in our variant of AffineExpr.

Client-facing class for VarKind + Var::Num pairs, with RTTI support for subclasses with a fixed VarKind.

Definition at line 61 of file Var.h.

Member Typedef Documentation

◆ Num

Typedef for the type of variable numbers.

Definition at line 64 of file Var.h.

Constructor & Destructor Documentation

◆ Var() [1/4]

constexpr mlir::sparse_tensor::ir_detail::Var::Var ( Impl  impl)
inlineexplicitconstexprprotected

Protected ctor for the RTTI methods to use.

Definition at line 112 of file Var.h.

◆ Var() [2/4]

constexpr mlir::sparse_tensor::ir_detail::Var::Var ( VarKind  vk,
Num  n 
)
inlineconstexpr

Definition at line 115 of file Var.h.

◆ Var() [3/4]

mlir::sparse_tensor::ir_detail::Var::Var ( AffineSymbolExpr  sym)
inline

Definition at line 116 of file Var.h.

◆ Var() [4/4]

mlir::sparse_tensor::ir_detail::Var::Var ( VarKind  vk,
AffineDimExpr  var 
)
inline

Definition at line 117 of file Var.h.

References mlir::sparse_tensor::ir_detail::Symbol.

Member Function Documentation

◆ cast()

template<typename U >
constexpr U mlir::sparse_tensor::ir_detail::Var::cast
constexpr

◆ dump()

void Var::dump ( ) const

Definition at line 41 of file Var.cpp.

References print().

◆ dyn_cast()

template<typename U >
constexpr std::optional< U > mlir::sparse_tensor::ir_detail::Var::dyn_cast
constexpr

Definition at line 195 of file Var.h.

◆ getKind()

constexpr VarKind mlir::sparse_tensor::ir_detail::Var::getKind ( ) const
inlineconstexpr

◆ getNum()

constexpr Num mlir::sparse_tensor::ir_detail::Var::getNum ( ) const
inlineconstexpr

◆ isa()

template<typename U >
constexpr bool mlir::sparse_tensor::ir_detail::Var::isa
constexpr

◆ isWF_Num()

static constexpr bool mlir::sparse_tensor::ir_detail::Var::isWF_Num ( Num  n)
inlinestaticconstexpr

Checks whether the number would be accepted by Var(VarKind,Var::Num).

Definition at line 83 of file Var.h.

Referenced by mlir::sparse_tensor::ir_detail::Var::Impl::Impl(), and mlir::sparse_tensor::ir_detail::VarInfo::setNum().

◆ operator!=()

constexpr bool mlir::sparse_tensor::ir_detail::Var::operator!= ( Var  other) const
inlineconstexpr

Definition at line 122 of file Var.h.

◆ operator==()

constexpr bool mlir::sparse_tensor::ir_detail::Var::operator== ( Var  other) const
inlineconstexpr

Definition at line 121 of file Var.h.

◆ print() [1/2]

void Var::print ( AsmPrinter printer) const

Definition at line 35 of file Var.cpp.

References mlir::AsmPrinter::getStream(), and print().

◆ print() [2/2]

void Var::print ( llvm::raw_ostream &  os) const

Definition at line 37 of file Var.cpp.

References getKind(), getNum(), and mlir::sparse_tensor::ir_detail::toChar().

Referenced by dump(), print(), and str().

◆ str()

std::string Var::str ( ) const

Definition at line 28 of file Var.cpp.

References print().


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