From: Arjun P Date: Thu, 14 Apr 2022 02:19:03 +0000 (+0100) Subject: [MLIR][Presburger] change some post-increments/decrements to pre-increments/decrements X-Git-Tag: upstream/15.0.7~10483 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ef95a6e827e5e348b310d504535ed69c0303b695;p=platform%2Fupstream%2Fllvm.git [MLIR][Presburger] change some post-increments/decrements to pre-increments/decrements --- diff --git a/mlir/lib/Analysis/Presburger/IntegerRelation.cpp b/mlir/lib/Analysis/Presburger/IntegerRelation.cpp index 2b8a290..ea582f9 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 220ea15..8fd789a 100644 --- a/mlir/lib/Analysis/Presburger/Simplex.cpp +++ b/mlir/lib/Analysis/Presburger/Simplex.cpp @@ -2040,7 +2040,7 @@ Optional> 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.