[Mlir-commits] [mlir] [mlir][Presburger] NFC: factor out removeRedundantConstraintsFromSimplex (PR #235955)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Mon Nov 2 03:53:08 PST 2026
================
@@ -923,6 +924,19 @@ class IntegerRelation {
/// Returns whether the constraint system was modified.
bool removeDuplicateConstraints();
+ /// Removes the constraints of `this` that have been marked redundant in
+ /// `simplex` (see `Simplex::detectRedundant`). The constraints of `this`
+ /// must have been added to `simplex` in the same order as
+ /// `SimplexBase::intersectIntegerRelation` does, starting at constraint index
+ /// `offset`: first all inequalities, then each equality as a pair of
+ /// inequalities. That is, inequality `i` corresponds to simplex constraint
+ /// `offset + i`, and equality `j` corresponds to the pair of simplex
+ /// constraints `offset + numIneqs + 2 * j` and `offset + numIneqs + 2 * j +
+ /// 1`. An equality is removed only if both constraints of its pair are marked
+ /// redundant.
----------------
bollu wrote:
```suggestion
/// Removes the constraints of `this` that have been marked redundant in
/// `simplex` (see `Simplex::detectRedundant`). The constraints of `this`
/// must be in the `simplex` starting at constraint index `offset`,
/// and in the same order as `SimplexBase::intersectIntegerRelation`.
/// That is, inequality `i` corresponds to simplex constraint `offset + i`,
/// and equality `j` corresponds to the pair of simplex constraints
/// `offset + numIneqs + 2 * j` , and `offset + numIneqs + 2 * j + 1`.
/// An equality is removed only if both constraints of its pair are marked redundant.
```
I wordsmithed a bit so we linebreak at nice locations.
https://github.com/llvm/llvm-project/pull/235955
More information about the Mlir-commits
mailing list