This is an archive of the discontinued LLVM Phabricator instance.

[MLIR] PresburgerSet: support divisions in operations
ClosedPublic

Authored by arjunp on Sep 21 2021, 2:09 AM.

Details

Summary

Add support for intersecting, subtracting, complementing and checking equality of sets having divisions.

Diff Detail

Event Timeline

arjunp created this revision.Sep 21 2021, 2:09 AM
arjunp requested review of this revision.Sep 21 2021, 2:09 AM
arjunp updated this revision to Diff 373811.Sep 21 2021, 2:14 AM

Update documentation.

arjunp updated this revision to Diff 373812.Sep 21 2021, 2:18 AM

Update documentation again.

Groverkss added a comment.EditedSep 21 2021, 4:05 AM

Added some comments

mlir/include/mlir/Analysis/PresburgerSet.h
74–78

Could you mention that local variables are not required to correspond to floor divisions? Just to prevent any confusion.

mlir/lib/Analysis/PresburgerSet.cpp
195–196

Possible Typo: "of sI correspond to division inequalities"

281–282

Should this be "The result is correct whether or not we ignore the redundant and division inequalities"?

284–288

nit: This can be written in one if condition.

mlir/unittests/Analysis/PresburgerSetTest.cpp
618–628

Suggestion: Instead of adding a local variable and an equality, You can directly use addLocalFloorDiv.

arjunp updated this revision to Diff 373897.Sep 21 2021, 6:39 AM
arjunp marked 5 inline comments as done.

Improve documentation and incorporate Kunwar's suggestions.

Thanks for the review!

mlir/lib/Analysis/PresburgerSet.cpp
284–288
mlir/unittests/Analysis/PresburgerSetTest.cpp
618–628

I prefer it this way; changing makeFAC... to take floor divs means the number of ids specified will be mismatched either with the div numerator or with the inequalities. I guess it would be useful in this case to factor out a function to just add the inequalities and not add an id. I think we can keep that for another patch though.

LGTM, but please wait for others.

bondhugula added inline comments.Sep 21 2021, 8:29 PM
mlir/lib/Analysis/PresburgerSet.cpp
168

The -> the

205

Code comment here.

mlir/unittests/Analysis/PresburgerSetTest.cpp
86–93

What's ids? Please document this.

arjunp updated this revision to Diff 374155.Sep 22 2021, 1:40 AM

Address Uday's comments.

arjunp marked 3 inline comments as done.Sep 22 2021, 1:47 AM

Thanks for the review!

bondhugula accepted this revision.Sep 24 2021, 2:15 AM

This looks good to me.

mlir/lib/Analysis/PresburgerSet.cpp
292–293

const ArrayRef isn't meaningful - ArrayRef is const by design.

293–299

Rephrase first sentence here - doesn't parse well.

mlir/unittests/Analysis/PresburgerSetTest.cpp
83–86

Nit: Use backticks when referring to the arguments by name here.

105–106

Missing doc comment although this is from before.

110–114

Missing doc comment although this is from before.

This revision is now accepted and ready to land.Sep 24 2021, 2:15 AM
arjunp updated this revision to Diff 374787.Sep 24 2021, 3:05 AM
arjunp marked 2 inline comments as done.

Address Uday's comments.

arjunp marked 3 inline comments as done.Sep 24 2021, 3:05 AM
This revision was landed with ongoing or failed builds.Sep 24 2021, 3:06 AM
This revision was automatically updated to reflect the committed changes.