[MLIR][Presburger] Carry IdKind information in LinearTransform::applyTo
authorGroverkss <groverkss@gmail.com>
Thu, 31 Mar 2022 15:09:39 +0000 (20:39 +0530)
committerGroverkss <groverkss@gmail.com>
Thu, 31 Mar 2022 15:12:50 +0000 (20:42 +0530)
This patch fixes a bug in LinearTransform::applyTo where it did not carry the
IdKind information, and instead treated every id as IdKind::Domain.

Reviewed By: arjunp

Differential Revision: https://reviews.llvm.org/D122823

mlir/lib/Analysis/Presburger/LinearTransform.cpp

index af65f23..6c399fe 100644 (file)
@@ -113,7 +113,8 @@ LinearTransform::makeTransformToColumnEchelon(Matrix m) {
 }
 
 IntegerRelation LinearTransform::applyTo(const IntegerRelation &rel) const {
-  IntegerRelation result(rel.getNumIds());
+  IntegerRelation result(rel.getNumDomainIds(), rel.getNumRangeIds(),
+                         rel.getNumSymbolIds(), rel.getNumLocalIds());
 
   for (unsigned i = 0, e = rel.getNumEqualities(); i < e; ++i) {
     ArrayRef<int64_t> eq = rel.getEquality(i);