[MLIR][Presburger] change some post-increments/decrements to pre-increments/decrements
authorArjun P <arjunpitchanathan@gmail.com>
Thu, 14 Apr 2022 02:19:03 +0000 (03:19 +0100)
committerArjun P <arjunpitchanathan@gmail.com>
Thu, 14 Apr 2022 03:26:29 +0000 (04:26 +0100)
mlir/lib/Analysis/Presburger/IntegerRelation.cpp
mlir/lib/Analysis/Presburger/Simplex.cpp

index 2b8a290..ea582f9 100644 (file)
@@ -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);
     }
   }
index 220ea15..8fd789a 100644 (file)
@@ -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.