MLIR  16.0.0git
Public Member Functions | Static Public Member Functions | List of all members
mlir::AffineValueMap Class Reference

An AffineValueMap is an affine map plus its ML value operands and results for analysis purposes. More...

#include "mlir/Dialect/Affine/IR/AffineValueMap.h"

Public Member Functions

 AffineValueMap ()=default
 
 AffineValueMap (AffineMap map, ValueRange operands, ValueRange results={})
 
 ~AffineValueMap ()
 
void reset (AffineMap map, ValueRange operands, ValueRange results={})
 
bool isMultipleOf (unsigned idx, int64_t factor) const
 Return true if the idx^th result can be proved to be a multiple of 'factor', false otherwise. More...
 
bool isFunctionOf (unsigned idx, Value value) const
 Return true if the idx^th result depends on 'value', false otherwise. More...
 
bool isConstant (unsigned idx) const
 Return true if the result at 'idx' is a constant, false otherwise. More...
 
bool isIdentity () const
 Return true if this is an identity map. More...
 
void setResult (unsigned i, AffineExpr e)
 
AffineExpr getResult (unsigned i)
 
unsigned getNumOperands () const
 
unsigned getNumDims () const
 
unsigned getNumSymbols () const
 
unsigned getNumResults () const
 
Value getOperand (unsigned i) const
 
ArrayRef< ValuegetOperands () const
 
AffineMap getAffineMap () const
 
LogicalResult canonicalize ()
 Attempts to canonicalize the map and operands. More...
 

Static Public Member Functions

static void difference (const AffineValueMap &a, const AffineValueMap &b, AffineValueMap *res)
 Return the value map that is the difference of value maps 'a' and 'b', represented as an affine map and its operands. More...
 

Detailed Description

An AffineValueMap is an affine map plus its ML value operands and results for analysis purposes.

The structure is still a tree form that is same as that of an affine map or an AffineApplyOp. However, its operands, results, and its map can themselves change as a result of substitutions, simplifications, and other analysis.

Definition at line 34 of file AffineValueMap.h.

Constructor & Destructor Documentation

◆ AffineValueMap() [1/2]

mlir::AffineValueMap::AffineValueMap ( )
default

◆ AffineValueMap() [2/2]

AffineValueMap::AffineValueMap ( AffineMap  map,
ValueRange  operands,
ValueRange  results = {} 
)

Definition at line 14 of file AffineValueMap.cpp.

◆ ~AffineValueMap()

AffineValueMap::~AffineValueMap ( )
default

Referenced by getAffineMap().

Member Function Documentation

◆ canonicalize()

LogicalResult AffineValueMap::canonicalize ( )

Attempts to canonicalize the map and operands.

Return success if the map and/or operands have been modified.

Definition at line 3652 of file AffineOps.cpp.

References composeAffineMapAndOperands(), mlir::failure(), and mlir::success().

Referenced by canonicalizeLoopBounds(), and getNumResults().

◆ difference()

void AffineValueMap::difference ( const AffineValueMap a,
const AffineValueMap b,
AffineValueMap res 
)
static

Return the value map that is the difference of value maps 'a' and 'b', represented as an affine map and its operands.

The output map + operands are canonicalized and simplified.

Definition at line 26 of file AffineValueMap.cpp.

Referenced by mlir::getTripCountMapAndOperands(), CanonicalizeSingleResultAffineMinMaxOp< T >::matchAndRewrite(), and mlir::normalizeAffineParallel().

◆ getAffineMap()

AffineMap AffineValueMap::getAffineMap ( ) const

◆ getNumDims()

unsigned mlir::AffineValueMap::getNumDims ( ) const
inline

Definition at line 69 of file AffineValueMap.h.

References mlir::AffineMap::getNumDims().

Referenced by mlir::normalizeAffineParallel().

◆ getNumOperands()

unsigned mlir::AffineValueMap::getNumOperands ( ) const
inline

Definition at line 68 of file AffineValueMap.h.

Referenced by mlir::MemRefRegion::compute().

◆ getNumResults()

unsigned mlir::AffineValueMap::getNumResults ( ) const
inline

◆ getNumSymbols()

unsigned mlir::AffineValueMap::getNumSymbols ( ) const
inline

Definition at line 70 of file AffineValueMap.h.

References mlir::AffineMap::getNumSymbols().

Referenced by mlir::normalizeAffineParallel().

◆ getOperand()

Value AffineValueMap::getOperand ( unsigned  i) const

◆ getOperands()

ArrayRef< Value > AffineValueMap::getOperands ( ) const

◆ getResult()

AffineExpr mlir::AffineValueMap::getResult ( unsigned  i)
inline

◆ isConstant()

bool mlir::AffineValueMap::isConstant ( unsigned  idx) const

Return true if the result at 'idx' is a constant, false otherwise.

◆ isFunctionOf()

bool AffineValueMap::isFunctionOf ( unsigned  idx,
Value  value 
) const

Return true if the idx^th result depends on 'value', false otherwise.

This method uses the invariant that operands are always positionally aligned with the AffineDimExpr in the underlying AffineMap.

Definition at line 81 of file AffineValueMap.cpp.

References findIndex(), getAffineMap(), mlir::AffineMap::getResult(), and mlir::AffineExpr::isFunctionOfDim().

◆ isIdentity()

bool mlir::AffineValueMap::isIdentity ( ) const

Return true if this is an identity map.

◆ isMultipleOf()

bool AffineValueMap::isMultipleOf ( unsigned  idx,
int64_t  factor 
) const
inline

Return true if the idx^th result can be proved to be a multiple of 'factor', false otherwise.

Definition at line 75 of file AffineValueMap.cpp.

References mlir::MutableAffineMap::isMultipleOf().

◆ reset()

void AffineValueMap::reset ( AffineMap  map,
ValueRange  operands,
ValueRange  results = {} 
)

◆ setResult()

void mlir::AffineValueMap::setResult ( unsigned  i,
AffineExpr  e 
)
inline

Definition at line 66 of file AffineValueMap.h.


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