[MLIR][FlatAffineConstraints] Add support for extracting divisions with tighter bounds
authorGroverkss <groverkss@gmail.com>
Sat, 11 Dec 2021 08:27:19 +0000 (13:57 +0530)
committerGroverkss <groverkss@gmail.com>
Sat, 11 Dec 2021 10:53:54 +0000 (16:23 +0530)
commitc6a8bec4c578a7c12e4458b161fce7b1704804a2
tree068684adcc8a196a10ec92e73f63e528dd65a89f
parent686dca86bf62e7955438985903a3c1a55a9cb7a8
[MLIR][FlatAffineConstraints] Add support for extracting divisions with tighter bounds

This patch adds support for extracting divisions when the set contains bounds
which are tighter than the division bounds. For example:

```
     3q - i + 2 >= 0                       <-- Lower bound for 'q'
    -3q + i - 1 >= 0                       <-- Tighter upper bound for 'q'
```

Here, the actual upper bound for division for `q` would be `-3q + i >= 0`, but
since this actual upper bound is implied by a tighter upper bound, which awe can still
extract the divison.

Reviewed By: arjunp

Differential Revision: https://reviews.llvm.org/D115096
mlir/lib/Analysis/AffineStructures.cpp
mlir/unittests/Analysis/AffineStructuresTest.cpp