This is an archive of the discontinued LLVM Phabricator instance.

[MLIR][Presburger] Implement findSymbolicIntegerLexMax for IntegerRelation
ClosedPublic

Authored by iambrj on Jul 22 2023, 4:34 AM.

Details

Summary

This patch implements findSymbolicIntegerLexMax for IntegerRelation

Diff Detail

Event Timeline

iambrj created this revision.Jul 22 2023, 4:34 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 22 2023, 4:34 AM
iambrj requested review of this revision.Jul 22 2023, 4:34 AM
Groverkss added inline comments.Jul 22 2023, 1:01 PM
mlir/include/mlir/Analysis/Presburger/IntegerRelation.h
672–693

nit: I think you can just share the documentation of lexmin and lexmax functions. Just easier to maintain.

mlir/include/mlir/Analysis/Presburger/Simplex.h
531–532
538
539–544

Please change the documentation to reflect lexmin -> lexopt

mlir/lib/Analysis/Presburger/IntegerRelation.cpp
257

Can you write a doc comment explaining the flipping stratergy we use?

mlir/unittests/Analysis/Presburger/IntegerRelationTest.cpp
141

I think a few more tests would be nice.

iambrj updated this revision to Diff 543802.Jul 24 2023, 8:14 PM

Address comments

iambrj marked 3 inline comments as done.Jul 24 2023, 8:18 PM
iambrj added inline comments.
mlir/include/mlir/Analysis/Presburger/IntegerRelation.h
672–693

I am unsure how to do this, do you suggest the lexmax function documentation be moved to lexmin or just scrapped altogether?

iambrj updated this revision to Diff 544037.Jul 25 2023, 10:37 AM

Delete commented code in unittest

Groverkss accepted this revision.Jul 25 2023, 10:45 AM

LGTM.

mlir/include/mlir/Analysis/Presburger/IntegerRelation.h
672–693

Just add a "Same as findSymbolicIntegerLexMin but produces lexmax instead of lexmin" comment and it should be fine.

mlir/lib/Analysis/Presburger/IntegerRelation.cpp
259–260

"With the sign of each dimension variable in range flipped" is better.

This revision is now accepted and ready to land.Jul 25 2023, 10:45 AM
iambrj updated this revision to Diff 544045.Jul 25 2023, 11:04 AM

Address comments

iambrj marked 5 inline comments as done.Jul 25 2023, 11:08 AM