18 return set->dimCount + set->symbolCount;
22 return set->constraints.size();
26 unsigned numEqualities = 0;
27 for (
unsigned i = 0, e = getNumConstraints(); i < e; i++)
34 return getNumConstraints() - getNumEqualities();
38 return *
this == getEmptySet(set->dimCount, set->symbolCount,
getContext());
42 return set->constraints;
46 return getConstraints()[idx];
58 return getConstraint(0).getContext();
64 for (
auto expr : getConstraints())
70 unsigned numResultDims,
unsigned numResultSyms) {
72 constraints.reserve(getNumConstraints());
73 for (
auto cst : getConstraints())
74 constraints.push_back(
75 cst.replaceDimsAndSymbols(dimReplacements, symReplacements));
77 return get(numResultDims, numResultSyms, constraints, getEqFlags());
static MLIRContext * getContext(OpFoldResult val)
Base type for affine expression.
An integer set representing a conjunction of one or more affine equalities and inequalities.
void walkExprs(function_ref< void(AffineExpr)> callback) const
Walk all of the AffineExpr's in this set's constraints.
IntegerSet replaceDimsAndSymbols(ArrayRef< AffineExpr > dimReplacements, ArrayRef< AffineExpr > symReplacements, unsigned numResultDims, unsigned numResultSyms)
This method substitutes any uses of dimensions and symbols (e.g.
unsigned getNumDims() const
MLIRContext * getContext() const
unsigned getNumInputs() const
unsigned getNumConstraints() const
ArrayRef< AffineExpr > getConstraints() const
unsigned getNumEqualities() const
bool isEmptyIntegerSet() const
Returns true if this is the canonical integer set.
AffineExpr getConstraint(unsigned idx) const
unsigned getNumInequalities() const
bool isEq(unsigned idx) const
Returns true if the idx^th constraint is an equality, false if it is an inequality.
ArrayRef< bool > getEqFlags() const
Returns the equality bits, which specify whether each of the constraints is an equality or inequality...
unsigned getNumSymbols() const
MLIRContext is the top-level object for a collection of MLIR operations.
Include the generated interface declarations.
auto get(MLIRContext *context, Ts &&...params)
Helper method that injects context only if needed, this helps unify some of the attribute constructio...