[PATCH] D80860: Exact integer emptiness checks for FlatAffineConstraints

Arjun P via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 29 23:22:36 PDT 2020


arjunp created this revision.
arjunp added reviewers: ftynse, andydavis1, chelini, Kayjukh, grosser.
Herald added subscribers: jurahul, frgossen, grosul1, Joonsoo, stephenneuendorffer, liufengdb, aartbik, lucyrfox, mgester, arpith-jacob, nicolasvasilache, antiagainst, shauheen, jpienaar, rriddle, mehdi_amini, mgorny.
Herald added a project: LLVM.

This patch adds the capability to perform exact integer emptiness checks for FlatAffineConstraints using the General Basis Reduction algorithm (GBR). Previously, only a heuristic was available for emptiness checks, which was not guaranteed to always give a conclusive result.

This patch adds a `Simplex` class, which can be constructed using a `FlatAffineConstraints`, and can find an integer sample point (if one exists) using the GBR algorithm. Additionally, it adds two classes `Matrix` and `Fraction`, which are used by `Simplex`.

The integer emptiness check functionality can be accessed through the new `FlatAffineConstraints::isIntegerEmpty()` function, which runs the existing heuristic first and, if that proves to be inconclusive, runs the GBR algorithm to produce a conclusive result.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D80860

Files:
  mlir/include/mlir/Analysis/AffineStructures.h
  mlir/include/mlir/Analysis/Presburger/Fraction.h
  mlir/include/mlir/Analysis/Presburger/Matrix.h
  mlir/include/mlir/Analysis/Presburger/Simplex.h
  mlir/lib/Analysis/AffineStructures.cpp
  mlir/lib/Analysis/CMakeLists.txt
  mlir/lib/Analysis/Presburger/CMakeLists.txt
  mlir/lib/Analysis/Presburger/Simplex.cpp
  mlir/unittests/Analysis/AffineStructuresTest.cpp
  mlir/unittests/Analysis/CMakeLists.txt
  mlir/unittests/Analysis/Presburger/CMakeLists.txt
  mlir/unittests/Analysis/Presburger/MatrixTest.cpp
  mlir/unittests/Analysis/Presburger/SimplexTest.cpp
  mlir/unittests/CMakeLists.txt

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80860.267437.patch
Type: text/x-patch
Size: 66203 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200530/a9f577b1/attachment.bin>


More information about the llvm-commits mailing list