[MLIR] FlatAffineConstraints::isIntegerEmpty: fix bug in computation of duals
authorArjun P <arjunpitchanathan@gmail.com>
Fri, 10 Dec 2021 22:15:59 +0000 (03:45 +0530)
committerArjun P <arjunpitchanathan@gmail.com>
Fri, 10 Dec 2021 22:18:40 +0000 (03:48 +0530)
commitd6f9bb0321e78ae1c920d10da0a369a11dfac6aa
treea8adc53c42838c7608cfe99f7da6d6f718774331
parent98db55f108a25953ea743629a874ced3da0058da
[MLIR] FlatAffineConstraints::isIntegerEmpty: fix bug in computation of duals

The method that was previously used for computing dual variables was incorrect.
This was used in the integer emptiness check algorithm, where this bug could lead to much longer running times. (Due to the way it is used, this never results in an incorrect emptiness check result.)

This patch fixes the dual computation and adds some additional asserts that catch this bug, along with regression test cases that trigger the asserts when the incorrect dual computation is used.

Reviewed By: Groverkss

Differential Revision: https://reviews.llvm.org/D113803
mlir/lib/Analysis/Presburger/Simplex.cpp
mlir/unittests/Analysis/AffineStructuresTest.cpp