[Mlir-commits] [mlir] ef95a6e - [MLIR][Presburger] change some post-increments/decrements to pre-increments/decrements
Arjun P
llvmlistbot at llvm.org
Wed Apr 13 20:32:02 PDT 2022
Author: Arjun P
Date: 2022-04-14T04:26:29+01:00
New Revision: ef95a6e827e5e348b310d504535ed69c0303b695
URL: https://github.com/llvm/llvm-project/commit/ef95a6e827e5e348b310d504535ed69c0303b695
DIFF: https://github.com/llvm/llvm-project/commit/ef95a6e827e5e348b310d504535ed69c0303b695.diff
LOG: [MLIR][Presburger] change some post-increments/decrements to pre-increments/decrements
Added:
Modified:
mlir/lib/Analysis/Presburger/IntegerRelation.cpp
mlir/lib/Analysis/Presburger/Simplex.cpp
Removed:
################################################################################
diff --git a/mlir/lib/Analysis/Presburger/IntegerRelation.cpp b/mlir/lib/Analysis/Presburger/IntegerRelation.cpp
index 2b8a2908afd89..ea582f9867e14 100644
--- a/mlir/lib/Analysis/Presburger/IntegerRelation.cpp
+++ b/mlir/lib/Analysis/Presburger/IntegerRelation.cpp
@@ -955,7 +955,7 @@ void IntegerRelation::removeRedundantInequalities() {
for (unsigned r = 0, e = getNumInequalities(); r < e; r++) {
// Change the inequality to its complement.
tmpCst.inequalities.negateRow(r);
- tmpCst.atIneq(r, tmpCst.getNumCols() - 1)--;
+ --tmpCst.atIneq(r, tmpCst.getNumCols() - 1);
if (tmpCst.isEmpty()) {
redun[r] = true;
// Zero fill the redundant inequality.
@@ -963,7 +963,7 @@ void IntegerRelation::removeRedundantInequalities() {
tmpCst.inequalities.fillRow(r, /*value=*/0);
} else {
// Reverse the change (to avoid recreating tmpCst each time).
- tmpCst.atIneq(r, tmpCst.getNumCols() - 1)++;
+ ++tmpCst.atIneq(r, tmpCst.getNumCols() - 1);
tmpCst.inequalities.negateRow(r);
}
}
diff --git a/mlir/lib/Analysis/Presburger/Simplex.cpp b/mlir/lib/Analysis/Presburger/Simplex.cpp
index 220ea1520a464..8fd789a74b840 100644
--- a/mlir/lib/Analysis/Presburger/Simplex.cpp
+++ b/mlir/lib/Analysis/Presburger/Simplex.cpp
@@ -2040,7 +2040,7 @@ Optional<SmallVector<int64_t, 8>> Simplex::findIntegerSample() {
// case this has no effect)
rollback(snapshotStack.back());
int64_t nextValue = nextValueStack.back();
- nextValueStack.back()++;
+ ++nextValueStack.back();
if (nextValue > upperBoundStack.back()) {
// We have exhausted the range and found no solution. Pop the stack and
// return up a level.
More information about the Mlir-commits
mailing list