This is an archive of the discontinued LLVM Phabricator instance.

[MLIR][Presburger] Use Matrix utilities for IntegerPolyhedron
ClosedPublic

Authored by Groverkss on Feb 24 2022, 6:58 AM.

Details

Summary

This patch replaces various functions over inequalities/equalities in
IntegerPolyhedron with Matrix functions already implementing them or refactors
them to a Matrix function.

Diff Detail

Event Timeline

Groverkss created this revision.Feb 24 2022, 6:58 AM
Groverkss requested review of this revision.Feb 24 2022, 6:58 AM
Groverkss updated this revision to Diff 411116.Feb 24 2022, 7:08 AM
  • Replace swapping with Matrix functions
arjunp added inline comments.Feb 24 2022, 8:56 AM
mlir/include/mlir/Analysis/Presburger/Matrix.h
126

nCols would be clearer

126

The meaning of normalize is not clear in this context. Maybe just write, divide the first nCols cols of row by its gcd.

mlir/lib/Analysis/Presburger/IntegerPolyhedron.cpp
836–837

The order of these is switched now, please update the comment accordingly

838

Can just call it gcd now, there is no other gcd left

mlir/lib/Analysis/Presburger/Matrix.cpp
216–222

Why not just declare gcd as an int64_t and use llvm::greatestCommonDivisor?

Groverkss updated this revision to Diff 411361.Feb 25 2022, 2:46 AM
Groverkss marked 4 inline comments as done.
  • Address Arjun's comments
arjunp added inline comments.Feb 25 2022, 2:56 AM
mlir/include/mlir/Analysis/Presburger/Matrix.h
127

Please update this comment too

Groverkss updated this revision to Diff 411365.Feb 25 2022, 2:59 AM
Groverkss marked an inline comment as done.
  • Fix comment for normalizeRow
arjunp accepted this revision.Feb 25 2022, 3:54 AM
This revision is now accepted and ready to land.Feb 25 2022, 3:54 AM
This revision was landed with ongoing or failed builds.Feb 25 2022, 4:08 AM
This revision was automatically updated to reflect the committed changes.