My Project
Public Types | Public Member Functions | Protected Attributes | Friends | List of all members
mlir::AffineExpr Class Reference

#include <AffineExpr.h>

Inheritance diagram for mlir::AffineExpr:
Inheritance graph
[legend]
Collaboration diagram for mlir::AffineExpr:
Collaboration graph
[legend]

Public Types

using ImplType = detail::AffineExprStorage
 

Public Member Functions

 AffineExpr ()
 
 AffineExpr (const ImplType *expr)
 
 AffineExpr (const AffineExpr &other)
 
AffineExproperator= (AffineExpr other)
 
bool operator== (AffineExpr other) const
 
bool operator!= (AffineExpr other) const
 
bool operator== (int64_t v) const
 
bool operator!= (int64_t v) const
 
 operator bool () const
 
bool operator! () const
 
template<typename U >
bool isa () const
 
template<typename U >
dyn_cast () const
 
template<typename U >
dyn_cast_or_null () const
 
template<typename U >
cast () const
 
MLIRContextgetContext () const
 
AffineExprKind getKind () const
 Return the classification for this type. More...
 
void print (raw_ostream &os) const
 
void dump () const
 
bool isSymbolicOrConstant () const
 
bool isPureAffine () const
 
int64_t getLargestKnownDivisor () const
 
bool isMultipleOf (int64_t factor) const
 Return true if the affine expression is a multiple of 'factor'. More...
 
bool isFunctionOfDim (unsigned position) const
 Return true if the affine expression involves AffineDimExpr position. More...
 
void walk (std::function< void(AffineExpr)> callback) const
 Walk all of the AffineExpr's in this expression in postorder. More...
 
AffineExpr replaceDimsAndSymbols (ArrayRef< AffineExpr > dimReplacements, ArrayRef< AffineExpr > symReplacements) const
 
AffineExpr operator+ (int64_t v) const
 
AffineExpr operator+ (AffineExpr other) const
 
AffineExpr operator- () const
 
AffineExpr operator- (int64_t v) const
 
AffineExpr operator- (AffineExpr other) const
 
AffineExpr operator* (int64_t v) const
 
AffineExpr operator* (AffineExpr other) const
 
AffineExpr floorDiv (uint64_t v) const
 
AffineExpr floorDiv (AffineExpr other) const
 
AffineExpr ceilDiv (uint64_t v) const
 
AffineExpr ceilDiv (AffineExpr other) const
 
AffineExpr operator% (uint64_t v) const
 
AffineExpr operator% (AffineExpr other) const
 
AffineExpr compose (AffineMap map) const
 

Protected Attributes

ImplTypeexpr
 

Friends

::llvm::hash_code hash_value (AffineExpr arg)
 Make AffineExpr hashable. More...
 

Detailed Description

Base type for affine expression. AffineExpr's are immutable value types with intuitive operators to operate on chainable, lightweight compositions. An AffineExpr is an interface to the underlying storage type pointer.

Member Typedef Documentation

◆ ImplType

Constructor & Destructor Documentation

◆ AffineExpr() [1/3]

mlir::AffineExpr::AffineExpr ( )
inline

◆ AffineExpr() [2/3]

mlir::AffineExpr::AffineExpr ( const ImplType expr)
inline

◆ AffineExpr() [3/3]

mlir::AffineExpr::AffineExpr ( const AffineExpr other)
inline

Member Function Documentation

◆ cast()

template<typename U >
U mlir::AffineExpr::cast ( ) const

◆ ceilDiv() [1/2]

AffineExpr AffineExpr::ceilDiv ( uint64_t  v) const

◆ ceilDiv() [2/2]

AffineExpr AffineExpr::ceilDiv ( AffineExpr  other) const

◆ compose()

AffineExpr AffineExpr::compose ( AffineMap  map) const

Compose with an AffineMap. Returns the composition of this AffineExpr with map.

Prerequisites: this and map are composable, i.e. that the number of AffineDimExpr of this is smaller than the number of results of map. If a result of a map does not have a corresponding AffineDimExpr, that result simply does not appear in the produced AffineExpr.

Example: expr: d0 + d2 map: (d0, d1, d2)[s0, s1] -> (d0 + s1, d1 + s0, d0 + d1 + d2) returned expr: d0 * 2 + d1 + d2 + s1

◆ dump()

void AffineExpr::dump ( ) const

◆ dyn_cast()

template<typename U >
U mlir::AffineExpr::dyn_cast ( ) const

◆ dyn_cast_or_null()

template<typename U >
U mlir::AffineExpr::dyn_cast_or_null ( ) const

◆ floorDiv() [1/2]

AffineExpr AffineExpr::floorDiv ( uint64_t  v) const

◆ floorDiv() [2/2]

AffineExpr AffineExpr::floorDiv ( AffineExpr  other) const

◆ getContext()

MLIRContext * AffineExpr::getContext ( ) const

◆ getKind()

AffineExprKind AffineExpr::getKind ( ) const

Return the classification for this type.

◆ getLargestKnownDivisor()

int64_t AffineExpr::getLargestKnownDivisor ( ) const

Returns the greatest known integral divisor of this affine expression. The result is always positive.

◆ isa()

template<typename U >
bool mlir::AffineExpr::isa ( ) const

◆ isFunctionOfDim()

bool AffineExpr::isFunctionOfDim ( unsigned  position) const

Return true if the affine expression involves AffineDimExpr position.

◆ isMultipleOf()

bool AffineExpr::isMultipleOf ( int64_t  factor) const

Return true if the affine expression is a multiple of 'factor'.

◆ isPureAffine()

bool AffineExpr::isPureAffine ( ) const

Returns true if this is a pure affine expression, i.e., multiplication, floordiv, ceildiv, and mod is only allowed w.r.t constants.

◆ isSymbolicOrConstant()

bool AffineExpr::isSymbolicOrConstant ( ) const

Returns true if this expression is made out of only symbols and constants, i.e., it does not involve dimensional identifiers.

Returns true if this expression is made out of only symbols and constants (no dimensional identifiers).

◆ operator bool()

mlir::AffineExpr::operator bool ( ) const
inlineexplicit

◆ operator!()

bool mlir::AffineExpr::operator! ( ) const
inline

◆ operator!=() [1/2]

bool mlir::AffineExpr::operator!= ( AffineExpr  other) const
inline

◆ operator!=() [2/2]

bool mlir::AffineExpr::operator!= ( int64_t  v) const
inline

◆ operator%() [1/2]

AffineExpr AffineExpr::operator% ( uint64_t  v) const

◆ operator%() [2/2]

AffineExpr AffineExpr::operator% ( AffineExpr  other) const

◆ operator*() [1/2]

AffineExpr AffineExpr::operator* ( int64_t  v) const

◆ operator*() [2/2]

AffineExpr AffineExpr::operator* ( AffineExpr  other) const

◆ operator+() [1/2]

AffineExpr AffineExpr::operator+ ( int64_t  v) const

◆ operator+() [2/2]

AffineExpr AffineExpr::operator+ ( AffineExpr  other) const

◆ operator-() [1/3]

AffineExpr AffineExpr::operator- ( ) const

◆ operator-() [2/3]

AffineExpr AffineExpr::operator- ( int64_t  v) const

◆ operator-() [3/3]

AffineExpr AffineExpr::operator- ( AffineExpr  other) const

◆ operator=()

AffineExpr& mlir::AffineExpr::operator= ( AffineExpr  other)
inline

◆ operator==() [1/2]

bool mlir::AffineExpr::operator== ( AffineExpr  other) const
inline

◆ operator==() [2/2]

bool AffineExpr::operator== ( int64_t  v) const

◆ print()

void AffineExpr::print ( raw_ostream &  os) const

◆ replaceDimsAndSymbols()

AffineExpr AffineExpr::replaceDimsAndSymbols ( ArrayRef< AffineExpr dimReplacements,
ArrayRef< AffineExpr symReplacements 
) const

This method substitutes any uses of dimensions and symbols (e.g. dim#0 with dimReplacements[0]) and returns the modified expression tree.

◆ walk()

void AffineExpr::walk ( std::function< void(AffineExpr)>  callback) const

Walk all of the AffineExpr's in this expression in postorder.

Walk all of the AffineExprs in this subgraph in postorder.

Friends And Related Function Documentation

◆ hash_value

::llvm::hash_code hash_value ( AffineExpr  arg)
friend

Make AffineExpr hashable.

Member Data Documentation

◆ expr

ImplType* mlir::AffineExpr::expr
protected

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