16 : map(map), operands(operands.begin(), operands.end()),
17 results(results.begin(), results.end()) {}
22 this->operands.assign(operands.begin(), operands.end());
23 this->results.assign(results.begin(), results.end());
36 allOperands.append(aDims.begin(), aDims.end());
37 allOperands.append(bDims.begin(), bDims.end());
38 allOperands.append(aSyms.begin(), aSyms.end());
39 allOperands.append(bSyms.begin(), bSyms.end());
50 for (
unsigned i = 0, e = bMap.getNumResults(); i < e; ++i)
51 diffExprs.push_back(aMap.getResult(i) - bMap.getResult(i));
53 auto diffMap =
AffineMap::get(bMap.getNumDims(), bMap.getNumSymbols(),
54 diffExprs, bMap.getContext());
58 res->
reset(diffMap, allOperands);
64 unsigned indexStart,
unsigned *indexOfMatch) {
65 unsigned size = valuesToSearch.size();
66 for (
unsigned i = indexStart; i < size; ++i) {
67 if (valueToMatch == valuesToSearch[i]) {
83 if (!
findIndex(value, operands, 0, &index)) {
93 return static_cast<Value>(operands[i]);
Include the generated interface declarations.
bool isFunctionOfDim(unsigned position) const
Return true if the affine expression involves AffineDimExpr position.
bool isFunctionOf(unsigned idx, Value value) const
Return true if the idx^th result depends on 'value', false otherwise.
AffineMap shiftDims(unsigned shift, unsigned offset=0) const
Replace dims[offset ...
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...
static constexpr const bool value
AffineExpr getResult(unsigned idx) const
static AffineMap get(MLIRContext *context)
Returns a zero result affine map with no dimensions or symbols: () -> ().
unsigned getNumOperands() const
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:
A multi-dimensional affine map Affine map's are immutable like Type's, and they are uniqued...
AffineMap getAffineMap() const
unsigned getNumDims() const
This class represents an instance of an SSA value in the MLIR system, representing a computable value...
AffineMap simplifyAffineMap(AffineMap map)
Simplifies an affine map by simplifying its underlying AffineExpr 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...
bool isMultipleOf(unsigned idx, int64_t factor) const
Returns true if the idx'th result expression is a multiple of factor.
AffineMap getAffineMap() const
Get the AffineMap corresponding to this MutableAffineMap.
unsigned getNumSymbols() const
static bool findIndex(Value valueToMatch, ArrayRef< Value > valuesToSearch, unsigned indexStart, unsigned *indexOfMatch)
An AffineValueMap is an affine map plus its ML value operands and results for analysis purposes...
ArrayRef< Value > getOperands() const
void reset(AffineMap map, ValueRange operands, ValueRange results={})
This class provides an abstraction over the different types of ranges over Values.
Value getOperand(unsigned i) const
unsigned getNumResults() const