17 : map(map), operands(operands.begin(), operands.end()),
18 results(results.begin(), results.end()) {}
23 this->operands.assign(operands.begin(), operands.end());
24 this->results.assign(results.begin(), results.end());
33 this->map.
reset(sMap);
46 allOperands.append(aDims.begin(), aDims.end());
47 allOperands.append(bDims.begin(), bDims.end());
48 allOperands.append(aSyms.begin(), aSyms.end());
49 allOperands.append(bSyms.begin(), bSyms.end());
60 for (
unsigned i = 0, e = bMap.getNumResults(); i < e; ++i)
61 diffExprs.push_back(aMap.getResult(i) - bMap.getResult(i));
63 auto diffMap =
AffineMap::get(bMap.getNumDims(), bMap.getNumSymbols(),
64 diffExprs, bMap.getContext());
68 res->
reset(diffMap, allOperands);
74 unsigned indexStart,
unsigned *indexOfMatch) {
75 unsigned size = valuesToSearch.size();
76 for (
unsigned i = indexStart; i < size; ++i) {
77 if (valueToMatch == valuesToSearch[i]) {
93 if (!
findIndex(value, operands, 0, &index)) {
103 return static_cast<Value>(operands[i]);
static bool findIndex(Value valueToMatch, ArrayRef< Value > valuesToSearch, unsigned indexStart, unsigned *indexOfMatch)
bool isFunctionOfDim(unsigned position) const
Return true if the affine expression involves AffineDimExpr position.
A multi-dimensional affine map Affine map's are immutable like Type's, and they are uniqued.
static AffineMap get(MLIRContext *context)
Returns a zero result affine map with no dimensions or symbols: () -> ().
AffineMap shiftDims(unsigned shift, unsigned offset=0) const
Replace dims[offset ...
AffineMap shiftSymbols(unsigned shift, unsigned offset=0) const
Replace symbols[offset ...
AffineExpr getResult(unsigned idx) const
This class provides an abstraction over the different types of ranges over Values.
This class represents an instance of an SSA value in the MLIR system, representing a computable value...
An AffineValueMap is an affine map plus its ML value operands and results for analysis purposes.
Value getOperand(unsigned i) const
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.
void composeSimplifyAndCanonicalize()
Composes all incoming affine.apply ops and then simplifies and canonicalizes the map and operands.
unsigned getNumSymbols() const
ArrayRef< Value > getOperands() const
unsigned getNumDims() const
unsigned getNumOperands() const
AffineMap getAffineMap() const
bool isFunctionOf(unsigned idx, Value value) const
Return true if the idx^th result depends on 'value', false otherwise.
void reset(AffineMap map, ValueRange operands, ValueRange results={})
unsigned getNumResults() const
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 a...
void fullyComposeAffineMapAndOperands(AffineMap *map, SmallVectorImpl< Value > *operands)
Given an affine map map and its input operands, this method composes into map, maps of AffineApplyOps...
void canonicalizeMapAndOperands(AffineMap *map, SmallVectorImpl< Value > *operands)
Modifies both map and operands in-place so as to:
Include the generated interface declarations.
AffineMap simplifyAffineMap(AffineMap map)
Simplifies an affine map by simplifying its underlying AffineExpr results.
void reset(AffineMap map)
Resets this MutableAffineMap with 'map'.
AffineMap getAffineMap() const
Get the AffineMap corresponding to this MutableAffineMap.
bool isMultipleOf(unsigned idx, int64_t factor) const
Returns true if the idx'th result expression is a multiple of factor.