diff --git a/mlir/include/mlir/Analysis/Presburger/PresburgerSpace.h b/mlir/include/mlir/Analysis/Presburger/PresburgerSpace.h --- a/mlir/include/mlir/Analysis/Presburger/PresburgerSpace.h +++ b/mlir/include/mlir/Analysis/Presburger/PresburgerSpace.h @@ -78,8 +78,13 @@ numLocals); } + /// Returns the space. This function is primarily intended to be used from + /// derived classes. PresburgerSpace getSpace() const { return *this; } - PresburgerSpace getCompatibleSpace() const { + + /// Returns the space without locals. This function is primarily intended to + /// be used from derived classes. + PresburgerSpace getSpaceWithoutLocals() const { return PresburgerSpace(numDomain, numRange, numSymbols); } diff --git a/mlir/lib/Analysis/Presburger/PresburgerRelation.cpp b/mlir/lib/Analysis/Presburger/PresburgerRelation.cpp --- a/mlir/lib/Analysis/Presburger/PresburgerRelation.cpp +++ b/mlir/lib/Analysis/Presburger/PresburgerRelation.cpp @@ -17,7 +17,7 @@ using namespace presburger; PresburgerRelation::PresburgerRelation(const IntegerRelation &disjunct) - : PresburgerSpace(disjunct.getCompatibleSpace()) { + : PresburgerSpace(disjunct.getSpaceWithoutLocals()) { unionInPlace(disjunct); } @@ -286,14 +286,14 @@ const PresburgerRelation &set) { assert(disjunct.isSpaceCompatible(set) && "Spaces should match"); if (disjunct.isEmptyByGCDTest()) - return PresburgerRelation::getEmpty(disjunct.getCompatibleSpace()); + return PresburgerRelation::getEmpty(disjunct.getSpaceWithoutLocals()); // Remove duplicate divs up front here as subtractRecursively does not support // this set having duplicate divs. disjunct.removeDuplicateDivs(); PresburgerRelation result = - PresburgerRelation::getEmpty(disjunct.getCompatibleSpace()); + PresburgerRelation::getEmpty(disjunct.getSpaceWithoutLocals()); Simplex simplex(disjunct); subtractRecursively(disjunct, simplex, set, 0, result); return result;