diff --git a/mlir/include/mlir/Analysis/FlatLinearValueConstraints.h b/mlir/include/mlir/Analysis/FlatLinearValueConstraints.h --- a/mlir/include/mlir/Analysis/FlatLinearValueConstraints.h +++ b/mlir/include/mlir/Analysis/FlatLinearValueConstraints.h @@ -66,14 +66,6 @@ /// Return the kind of this object. Kind getKind() const override { return Kind::FlatLinearConstraints; } - static bool classof(const IntegerRelation *cst) { - return cst->getKind() >= Kind::FlatLinearConstraints && - cst->getKind() <= Kind::FlatAffineRelation; - } - - /// Clones this object. - std::unique_ptr clone() const; - /// Adds a bound for the variable at the specified position with constraints /// being drawn from the specified bound map. In case of an EQ bound, the /// bound map is expected to have exactly one result. In case of a LB/UB, the @@ -290,20 +282,6 @@ /// Creates an affine constraint system from an IntegerSet. explicit FlatLinearValueConstraints(IntegerSet set, ValueRange operands = {}); - // Construct a hyperrectangular constraint set from ValueRanges that represent - // induction variables, lower and upper bounds. `ivs`, `lbs` and `ubs` are - // expected to match one to one. The order of variables and constraints is: - // - // ivs | lbs | ubs | eq/ineq - // ----+-----+-----+--------- - // 1 -1 0 >= 0 - // ----+-----+-----+--------- - // -1 0 1 >= 0 - // - // All dimensions as set as VarKind::SetDim. - static FlatLinearValueConstraints - getHyperrectangular(ValueRange ivs, ValueRange lbs, ValueRange ubs); - /// Return the kind of this object. Kind getKind() const override { return Kind::FlatLinearValueConstraints; } @@ -338,9 +316,6 @@ for (unsigned i = start; i < end; i++) values->push_back(getValue(i)); } - inline void getAllValues(SmallVectorImpl *values) const { - getValues(0, getNumDimAndSymbolVars(), values); - } inline ArrayRef> getMaybeValues() const { return {values.data(), values.size()}; @@ -359,9 +334,6 @@ return values[pos].has_value(); } - /// Returns true if at least one variable has an associated Value. - bool hasValues() const; - unsigned appendDimVar(ValueRange vals); using FlatLinearConstraints::appendDimVar; diff --git a/mlir/lib/Analysis/FlatLinearValueConstraints.cpp b/mlir/lib/Analysis/FlatLinearValueConstraints.cpp --- a/mlir/lib/Analysis/FlatLinearValueConstraints.cpp +++ b/mlir/lib/Analysis/FlatLinearValueConstraints.cpp @@ -148,10 +148,6 @@ // FlatLinearConstraints //===----------------------------------------------------------------------===// -std::unique_ptr FlatLinearConstraints::clone() const { - return std::make_unique(*this); -} - // Similar to `composeMap` except that no Values need be associated with the // constraint system nor are they looked at -- the dimensions and symbols of // `other` are expected to correspond 1:1 to `this` system. @@ -849,48 +845,6 @@ append(localVarCst); } -// Construct a hyperrectangular constraint set from ValueRanges that represent -// induction variables, lower and upper bounds. `ivs`, `lbs` and `ubs` are -// expected to match one to one. The order of variables and constraints is: -// -// ivs | lbs | ubs | eq/ineq -// ----+-----+-----+--------- -// 1 -1 0 >= 0 -// ----+-----+-----+--------- -// -1 0 1 >= 0 -// -// All dimensions as set as VarKind::SetDim. -FlatLinearValueConstraints -FlatLinearValueConstraints::getHyperrectangular(ValueRange ivs, ValueRange lbs, - ValueRange ubs) { - FlatLinearValueConstraints res; - unsigned nIvs = ivs.size(); - assert(nIvs == lbs.size() && "expected as many lower bounds as ivs"); - assert(nIvs == ubs.size() && "expected as many upper bounds as ivs"); - - if (nIvs == 0) - return res; - - res.appendDimVar(ivs); - unsigned lbsStart = res.appendDimVar(lbs); - unsigned ubsStart = res.appendDimVar(ubs); - - MLIRContext *ctx = ivs.front().getContext(); - for (int ivIdx = 0, e = nIvs; ivIdx < e; ++ivIdx) { - // iv - lb >= 0 - AffineMap lb = AffineMap::get(/*dimCount=*/3 * nIvs, /*symbolCount=*/0, - getAffineDimExpr(lbsStart + ivIdx, ctx)); - if (failed(res.addBound(BoundType::LB, ivIdx, lb))) - llvm_unreachable("Unexpected FlatLinearValueConstraints creation error"); - // -iv + ub >= 0 - AffineMap ub = AffineMap::get(/*dimCount=*/3 * nIvs, /*symbolCount=*/0, - getAffineDimExpr(ubsStart + ivIdx, ctx)); - if (failed(res.addBound(BoundType::UB, ivIdx, ub))) - llvm_unreachable("Unexpected FlatLinearValueConstraints creation error"); - } - return res; -} - unsigned FlatLinearValueConstraints::appendDimVar(ValueRange vals) { unsigned pos = getNumDimVars(); return insertVar(VarKind::SetDim, pos, vals); @@ -940,11 +894,6 @@ return absolutePos; } -bool FlatLinearValueConstraints::hasValues() const { - return llvm::any_of( - values, [](const std::optional &var) { return var.has_value(); }); -} - /// Checks if two constraint systems are in the same space, i.e., if they are /// associated with the same set of variables, appearing in the same order. static bool areVarsAligned(const FlatLinearValueConstraints &a,