[MLIR][Presburger] fix vector update in coalesce
authorMichel Weber <michel.weber@inf.ethz.ch>
Thu, 10 Mar 2022 10:12:06 +0000 (15:42 +0530)
committerGroverkss <groverkss@gmail.com>
Thu, 10 Mar 2022 10:12:11 +0000 (15:42 +0530)
commit06eb0577380c4ba027eae5f48553b2063b3feaff
treedf7c5f7a1e3b20c7d274730372b61d151c44dfca
parentc896e6540ab4111052f9e12a85784185af4d898f
[MLIR][Presburger] fix vector update in coalesce

When `addCoalescedPolyhedron` was called with `j == n - 1`,
the `polyhedrons`-vector was not properly updated (the
`IntegerPolyhedron` at position `n - 2` was "lost"). This patch adds
special handling to that case and a regression testcase.

Reviewed By: Groverkss

Differential Revision: https://reviews.llvm.org/D121356
mlir/lib/Analysis/Presburger/PresburgerSet.cpp
mlir/unittests/Analysis/Presburger/PresburgerSetTest.cpp