This is an archive of the discontinued LLVM Phabricator instance.

[MLIR][Presburger] Implement findSymbolicIntegerLexMin/Max for PresburgerRelation
ClosedPublic

Authored by iambrj on Jul 30 2023, 10:46 AM.

Details

Summary

This patch implements findSymbolicIntegerLexMin/Max for PresburgerRelation

Diff Detail

Event Timeline

iambrj created this revision.Jul 30 2023, 10:46 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 30 2023, 10:46 AM
iambrj requested review of this revision.Jul 30 2023, 10:46 AM
Groverkss added inline comments.Aug 2 2023, 2:40 AM
mlir/lib/Analysis/Presburger/PresburgerRelation.cpp
190–191

Can't you just do getSpace() ?

205–219

These functions are almost the same. Can you make a static function with a boolean flag and call it from both?

mlir/unittests/Analysis/Presburger/PresburgerRelationTest.cpp
194–228

I think some more tests would be nice for this. Maybe something with more dimension variables.

iambrj updated this revision to Diff 547481.Aug 5 2023, 6:39 AM

Address comments

iambrj marked 3 inline comments as done.Aug 5 2023, 6:40 AM
Groverkss added inline comments.Aug 7 2023, 9:57 AM
mlir/include/mlir/Analysis/Presburger/PresburgerRelation.h
121–123

Sorry for being unclear, I did not mean a static class function. I meant a static function as a local function inside the implementation.

mlir/unittests/Analysis/Presburger/PresburgerRelationTest.cpp
256–258

nit: Can you format these such that each new expression is on a new line?

281

Please remove debug statements.

286–297

It's better if these checks are near the definitions.

iambrj updated this revision to Diff 548052.Aug 7 2023, 8:52 PM

Address comments

iambrj updated this revision to Diff 548053.Aug 7 2023, 8:54 PM

Fix styling

iambrj marked 3 inline comments as done.Aug 7 2023, 8:58 PM
Groverkss accepted this revision.Aug 7 2023, 9:44 PM

LGTM, one small change.

mlir/lib/Analysis/Presburger/PresburgerRelation.cpp
198

Why not use result.lexopt directly instead?

This revision is now accepted and ready to land.Aug 7 2023, 9:44 PM
Groverkss added inline comments.Aug 7 2023, 9:46 PM
mlir/lib/Analysis/Presburger/PresburgerRelation.cpp
198

Maybe you can just do SymbolicLexOpt &s = result.lexopt and PresburgerSet &unboundedDomain = result.unboundedDomain.

iambrj updated this revision to Diff 548064.Aug 7 2023, 10:35 PM

Address comments

iambrj marked 2 inline comments as done.Aug 7 2023, 10:36 PM
This revision was landed with ongoing or failed builds.Aug 7 2023, 11:24 PM
This revision was automatically updated to reflect the committed changes.