[MLIR][Presburger] Refactor looping strategy in coalesce
authorMichel Weber <michel.weber@inf.ethz.ch>
Fri, 25 Feb 2022 12:22:48 +0000 (12:22 +0000)
committerArjun P <arjunpitchanathan@gmail.com>
Fri, 25 Feb 2022 12:41:20 +0000 (12:41 +0000)
commit4ae18553560256f08e7dd64fec3a97ca65eac138
tree28e6300a2962c8459c2f7172165c1cfdb97b86af
parent865fe131f87c68e27f64a1fe6f6351b6a6952cca
[MLIR][Presburger] Refactor looping strategy in coalesce

This patch refactors the looping strategy of coalesce for future patches. The new strategy works in-place and uses IneqType to organize inequalities into vectors of the same type. Future coalesce cases will pattern match on this organization. E.g. the contained case needs all inequalities and equalities to be redundant, so this case becomes checking whether the respective vectors are empty. For other cases, the patterns consider the types of all inequalities of both sets making it wasteful to only consider whether a can be coalesced with b in one step, as inequalities would need to be typed again for the opposite case. Therefore, the new strategy tries to coalesce a with b and b with a in a single step.

Reviewed By: Groverkss, arjunp

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