MLIR 22.0.0git
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.

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).

Protected Member Functions

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

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]

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.

Referenced by operator!=(), operator==(), Var(), and Var().

◆ Var() [2/4]

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.

References mlir::sparse_tensor::ir_detail::Symbol, and Var().

◆ 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, and Var().

Member Function Documentation

◆ cast()

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

◆ dump()

void Var::dump ( ) const

Definition at line 41 of file Var.cpp.

References print().

◆ dyn_cast()

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

Definition at line 195 of file Var.h.

References isa().

◆ getKind()

◆ getNum()

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

◆ isa()

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

◆ isWF_Num()

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

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!=()

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

Definition at line 122 of file Var.h.

References Var().

◆ operator==()

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

Definition at line 121 of file Var.h.

References Var().

◆ 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(), and str().

Referenced by str().


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