[PATCH] D76701: [MLIR] Add flat affine constraints method to round trip integer set

Uday Bondhugula via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 25 22:11:46 PDT 2020


bondhugula added a comment.

Thanks for the review, Andy.



================
Comment at: mlir/lib/Analysis/AffineStructures.cpp:2719
+        changed = true;
+  } while (changed);
+
----------------
andydavis1 wrote:
> What assures that this doesn't loop forever? 
Good question. Each time `changed` stays true at the end of body, 
one or more new positions (identifiers) have been detected as a floordiv, and memo[<those positions>] becomes non-null; so, the number of null entries for local var positions in memo strictly reduces each iteration (starting from getNumLocalIds()); so this will converge.  Added a comment.


================
Comment at: mlir/lib/Analysis/AffineStructures.cpp:2729
+/// equalities..
+static bool isColZero(const FlatAffineConstraints &cst, unsigned pos) {
+  assert(pos < cst.getNumCols() && "position out of bounds");
----------------
andydavis1 wrote:
> Thought we had a method that did this already? Or was it just checking for all ones? If so, maybe it could be combined.
Just scanned through - we do have a `findConstraintWithNonZeroAt` (which also sets the row position if we find one) - it has to be called for either equalities or inequalities. I can actually reuse it from isColZero. Thanks. 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76701/new/

https://reviews.llvm.org/D76701





More information about the llvm-commits mailing list