@@ -148,10 +148,6 @@ LogicalResult mlir::getFlattenedAffineExprs(
148
148
// FlatLinearConstraints
149
149
// ===----------------------------------------------------------------------===//
150
150
151
- std::unique_ptr<FlatLinearConstraints> FlatLinearConstraints::clone () const {
152
- return std::make_unique<FlatLinearConstraints>(*this );
153
- }
154
-
155
151
// Similar to `composeMap` except that no Values need be associated with the
156
152
// constraint system nor are they looked at -- the dimensions and symbols of
157
153
// `other` are expected to correspond 1:1 to `this` system.
@@ -849,48 +845,6 @@ FlatLinearValueConstraints::FlatLinearValueConstraints(IntegerSet set,
849
845
append (localVarCst);
850
846
}
851
847
852
- // Construct a hyperrectangular constraint set from ValueRanges that represent
853
- // induction variables, lower and upper bounds. `ivs`, `lbs` and `ubs` are
854
- // expected to match one to one. The order of variables and constraints is:
855
- //
856
- // ivs | lbs | ubs | eq/ineq
857
- // ----+-----+-----+---------
858
- // 1 -1 0 >= 0
859
- // ----+-----+-----+---------
860
- // -1 0 1 >= 0
861
- //
862
- // All dimensions as set as VarKind::SetDim.
863
- FlatLinearValueConstraints
864
- FlatLinearValueConstraints::getHyperrectangular (ValueRange ivs, ValueRange lbs,
865
- ValueRange ubs) {
866
- FlatLinearValueConstraints res;
867
- unsigned nIvs = ivs.size ();
868
- assert (nIvs == lbs.size () && " expected as many lower bounds as ivs" );
869
- assert (nIvs == ubs.size () && " expected as many upper bounds as ivs" );
870
-
871
- if (nIvs == 0 )
872
- return res;
873
-
874
- res.appendDimVar (ivs);
875
- unsigned lbsStart = res.appendDimVar (lbs);
876
- unsigned ubsStart = res.appendDimVar (ubs);
877
-
878
- MLIRContext *ctx = ivs.front ().getContext ();
879
- for (int ivIdx = 0 , e = nIvs; ivIdx < e; ++ivIdx) {
880
- // iv - lb >= 0
881
- AffineMap lb = AffineMap::get (/* dimCount=*/ 3 * nIvs, /* symbolCount=*/ 0 ,
882
- getAffineDimExpr (lbsStart + ivIdx, ctx));
883
- if (failed (res.addBound (BoundType::LB, ivIdx, lb)))
884
- llvm_unreachable (" Unexpected FlatLinearValueConstraints creation error" );
885
- // -iv + ub >= 0
886
- AffineMap ub = AffineMap::get (/* dimCount=*/ 3 * nIvs, /* symbolCount=*/ 0 ,
887
- getAffineDimExpr (ubsStart + ivIdx, ctx));
888
- if (failed (res.addBound (BoundType::UB, ivIdx, ub)))
889
- llvm_unreachable (" Unexpected FlatLinearValueConstraints creation error" );
890
- }
891
- return res;
892
- }
893
-
894
848
unsigned FlatLinearValueConstraints::appendDimVar (ValueRange vals) {
895
849
unsigned pos = getNumDimVars ();
896
850
return insertVar (VarKind::SetDim, pos, vals);
@@ -940,11 +894,6 @@ unsigned FlatLinearValueConstraints::insertVar(VarKind kind, unsigned pos,
940
894
return absolutePos;
941
895
}
942
896
943
- bool FlatLinearValueConstraints::hasValues () const {
944
- return llvm::any_of (
945
- values, [](const std::optional<Value> &var) { return var.has_value (); });
946
- }
947
-
948
897
// / Checks if two constraint systems are in the same space, i.e., if they are
949
898
// / associated with the same set of variables, appearing in the same order.
950
899
static bool areVarsAligned (const FlatLinearValueConstraints &a,
0 commit comments