This is an archive of the discontinued LLVM Phabricator instance.

[MLIR][Presburger][NFC] Use getters for IntegerPolyhedron members
ClosedPublic

Authored by Groverkss on Feb 3 2022, 4:01 AM.

Details

Summary

This patch makes IntegerPolyhedron and derived classes use of getters to access
IntegerPolyhedron space information (numIds, numDims, numSymbols) instead of
directly accessing them.

This patch makes it easier to change the underlying implementation of the way
identifiers are stored, making it easier to extend/modify existing implementation.

Diff Detail

Event Timeline

Groverkss created this revision.Feb 3 2022, 4:01 AM
Groverkss requested review of this revision.Feb 3 2022, 4:01 AM
Groverkss edited the summary of this revision. (Show Details)Feb 3 2022, 4:01 AM
Groverkss updated this revision to Diff 405575.Feb 3 2022, 4:03 AM
  • Remove private label
arjunp requested changes to this revision.Feb 3 2022, 5:09 AM

Please write the rationale for this change in the patch description.

mlir/lib/Analysis/Presburger/IntegerPolyhedron.cpp
181–185

I think it would be great to replace this logic with uniform handling of each type of variable that does not depend on their internal ordering. Just write a free function getNumOverlap that returns the number of common elements between two intervals and you can call it once for each kind.

236–242
This revision now requires changes to proceed.Feb 3 2022, 5:09 AM
Groverkss edited the summary of this revision. (Show Details)Feb 3 2022, 9:23 PM
Groverkss updated this revision to Diff 405870.Feb 3 2022, 10:24 PM
Groverkss marked 2 inline comments as done.
  • Address Arjun's comments
Groverkss edited the summary of this revision. (Show Details)Feb 3 2022, 10:24 PM
arjunp accepted this revision.Feb 4 2022, 4:36 AM
arjunp added inline comments.
mlir/include/mlir/Analysis/Presburger/IntegerPolyhedron.h
507
This revision is now accepted and ready to land.Feb 4 2022, 4:36 AM
Groverkss updated this revision to Diff 406156.Feb 4 2022, 10:04 PM
Groverkss marked an inline comment as done.
  • Fix getIdKindOverlap docs
Groverkss updated this revision to Diff 406171.Feb 5 2022, 4:00 AM

Rebase (Flang seems to give error on windows build)