[Mlir-commits] [mlir] [MLIR] NFC. Refactor IntegerRelation getSliceBounds (PR #127308)

Uday Bondhugula llvmlistbot at llvm.org
Sat Feb 15 17:33:15 PST 2025


================
@@ -581,48 +581,35 @@ std::pair<AffineMap, AffineMap> FlatLinearConstraints::getLowerAndUpperBound(
   return {lbMap, ubMap};
 }
 
-/// Computes the lower and upper bounds of the first 'num' dimensional
-/// variables (starting at 'offset') as affine maps of the remaining
-/// variables (dimensional and symbolic variables). Local variables are
-/// themselves explicitly computed as affine functions of other variables in
-/// this process if needed.
-void FlatLinearConstraints::getSliceBounds(unsigned offset, unsigned num,
-                                           MLIRContext *context,
-                                           SmallVectorImpl<AffineMap> *lbMaps,
-                                           SmallVectorImpl<AffineMap> *ubMaps,
-                                           bool closedUB) {
-  assert(offset + num <= getNumDimVars() && "invalid range");
-
-  // Basic simplification.
-  normalizeConstraintsByGCD();
-
-  LLVM_DEBUG(llvm::dbgs() << "getSliceBounds for variables at positions ["
-                          << offset << ", " << offset + num << ")\n");
-  LLVM_DEBUG(dumpPretty());
-
-  // Record computed/detected variables.
-  SmallVector<AffineExpr, 8> memo(getNumVars());
+/// Compute `num` identifiers starting at `offset` in `cst` as affine
+/// expressions involving other known identifiers. Each identifier's expression
+/// (in terms of known identifiers) is populated into `memo`.
+static void computeUnknownVars(const FlatLinearConstraints &cst,
----------------
bondhugula wrote:

It's actually in the latter part of the statement "as affine expressions involving other .... identifiers". Rephrased it a bit now. This method isn't doing anything new or different but only moving the code that was in `getSliceBounds`.

https://github.com/llvm/llvm-project/pull/127308


More information about the Mlir-commits mailing list