|
MLIR 24.0.0git
|
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={}) |
| void | composeSimplifyAndCanonicalize () |
| Composes all incoming affine.apply ops and then simplifies and canonicalizes the map and operands. | |
| 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. | |
| bool | isFunctionOf (unsigned idx, Value value) const |
| Return true if the idx^th result depends on 'value', false otherwise. | |
| bool | isConstant (unsigned idx) const |
| Return true if the result at 'idx' is a constant, false otherwise. | |
| bool | isIdentity () const |
| Return true if this is an identity map. | |
| 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< Value > | getOperands () const |
| AffineMap | getAffineMap () const |
| LogicalResult | canonicalize () |
| Attempts to canonicalize the map and operands. | |
| bool | operator== (const AffineValueMap &other) const |
| Checks if the application of this map to its operands is semantically equal to other's. | |
| bool | operator!= (const AffineValueMap &other) const |
Static Public Member Functions | |
| static void | combine (const AffineValueMap &a, const AffineValueMap &b, AffineExpr expr, AffineValueMap *res, bool pairwise=true) |
| Combine results from 'a' and 'b' using 'expr'. | |
| static void | difference (const AffineValueMap &a, const AffineValueMap &b, AffineValueMap *res) |
| Subtract each result of 'b' from the result of 'a' at the same index; the result counts must be equal. | |
| static void | cartesianProductDifference (const AffineValueMap &a, const AffineValueMap &b, AffineValueMap *res) |
| Subtract results of 'b' from results of 'a' over their Cartesian product. | |
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.
|
default |
Referenced by cartesianProductDifference(), combine(), difference(), isFunctionOf(), operator!=(), and operator==().
| AffineValueMap::AffineValueMap | ( | AffineMap | map, |
| ValueRange | operands, | ||
| ValueRange | results = {} ) |
Definition at line 15 of file AffineValueMap.cpp.
|
default |
| LogicalResult AffineValueMap::canonicalize | ( | ) |
Attempts to canonicalize the map and operands.
Return success if the map and/or operands have been modified.
Definition at line 4363 of file AffineOps.cpp.
References composeAffineMapAndOperands(), getAffineMap(), reset(), and success().
Referenced by canonicalizeLoopBounds().
|
static |
Subtract results of 'b' from results of 'a' over their Cartesian product.
The output map and operands are composed, canonicalized, and simplified.
Definition at line 101 of file AffineValueMap.cpp.
References AffineValueMap(), b, combine(), mlir::getAffineDimExpr(), getAffineMap(), and mlir::AffineMap::getContext().
Referenced by mlir::affine::getTripCountMapAndOperands().
|
static |
Combine results from 'a' and 'b' using 'expr'.
If 'pairwise' is true (the default), apply 'expr' to the results of 'a' and 'b' at each matching index; the result counts must be equal. Otherwise, apply 'expr' to the Cartesian product of the results. The expression may refer only to d0 and d1, which stand for the results of 'a' and 'b', respectively. The output map and operands are composed, canonicalized, and simplified.
Definition at line 36 of file AffineValueMap.cpp.
References AffineValueMap(), b, mlir::affine::canonicalizeMapAndOperands(), mlir::affine::fullyComposeAffineMapAndOperands(), mlir::AffineMap::get(), getAffineMap(), getNumDims(), getNumOperands(), getNumResults(), getNumSymbols(), getOperands(), mlir::AffineExpr::replaceDims(), mlir::simplifyAffineMap(), and mlir::AffineExpr::walk().
Referenced by cartesianProductDifference(), and difference().
| void AffineValueMap::composeSimplifyAndCanonicalize | ( | ) |
Composes all incoming affine.apply ops and then simplifies and canonicalizes the map and operands.
This can change the number of operands, but the result count remains the same.
Definition at line 27 of file AffineValueMap.cpp.
References mlir::affine::canonicalizeMapAndOperands(), mlir::affine::fullyComposeAffineMapAndOperands(), and getAffineMap().
Referenced by isAccessIndexInvariant(), and mlir::affine::isInvariantAccess().
|
static |
Subtract each result of 'b' from the result of 'a' at the same index; the result counts must be equal.
The output map and operands are composed, canonicalized, and simplified.
Definition at line 93 of file AffineValueMap.cpp.
References AffineValueMap(), b, combine(), mlir::getAffineDimExpr(), getAffineMap(), and mlir::AffineMap::getContext().
Referenced by operator==().
| AffineMap AffineValueMap::getAffineMap | ( | ) | const |
Definition at line 149 of file AffineValueMap.cpp.
Referenced by canonicalize(), canonicalizeLoopBounds(), cartesianProductDifference(), combine(), mlir::affine::FlatAffineValueConstraints::composeMap(), composeSimplifyAndCanonicalize(), mlir::affine::MemRefRegion::compute(), createFullTiles(), difference(), mlir::affine::getRelationFromMap(), mlir::affine::getTripCountMapAndOperands(), isFunctionOf(), and operator==().
|
inline |
Definition at line 90 of file AffineValueMap.h.
Referenced by combine(), and mlir::affine::getAccessRelation().
|
inline |
Definition at line 89 of file AffineValueMap.h.
Referenced by combine(), and mlir::affine::MemRefRegion::compute().
|
inline |
Definition at line 92 of file AffineValueMap.h.
Referenced by combine(), mlir::affine::getAccessRelation(), mlir::affine::getTripCountMapAndOperands(), and operator==().
|
inline |
Definition at line 91 of file AffineValueMap.h.
Referenced by combine().
Definition at line 141 of file AffineValueMap.cpp.
Referenced by mlir::affine::MemRefRegion::compute(), and mlir::affine::getRelationFromMap().
Definition at line 145 of file AffineValueMap.cpp.
Referenced by canonicalizeLoopBounds(), combine(), mlir::affine::FlatAffineValueConstraints::composeMap(), createFullTiles(), mlir::affine::getTripCountMapAndOperands(), and mlir::affine::isInvariantAccess().
|
inline |
Definition at line 88 of file AffineValueMap.h.
Referenced by mlir::affine::getTripCountMapAndOperands().
Return true if the result at 'idx' is a constant, false otherwise.
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 130 of file AffineValueMap.cpp.
References AffineValueMap(), findIndex(), getAffineMap(), mlir::AffineMap::getResult(), and mlir::AffineExpr::isFunctionOfDim().
Referenced by isAccessIndexInvariant().
| bool mlir::affine::AffineValueMap::isIdentity | ( | ) | const |
Return true if this is an identity map.
Return true if the idx^th result can be proved to be a multiple of 'factor', false otherwise.
Definition at line 124 of file AffineValueMap.cpp.
|
inline |
Definition at line 105 of file AffineValueMap.h.
References AffineValueMap().
| bool AffineValueMap::operator== | ( | const AffineValueMap & | other | ) | const |
Checks if the application of this map to its operands is semantically equal to other's.
Definition at line 151 of file AffineValueMap.cpp.
References AffineValueMap(), difference(), getAffineMap(), getNumResults(), and mlir::AffineMap::getResults().
| void AffineValueMap::reset | ( | AffineMap | map, |
| ValueRange | operands, | ||
| ValueRange | results = {} ) |
Definition at line 20 of file AffineValueMap.cpp.
Referenced by canonicalize(), mlir::affine::MemRefAccess::getAccessMap(), and mlir::affine::FlatAffineValueConstraints::getIneqAsAffineValueMap().
|
inline |
Definition at line 87 of file AffineValueMap.h.
Referenced by mlir::affine::getTripCountMapAndOperands().