This is an archive of the discontinued LLVM Phabricator instance.

[MLIR][Presburger] Refactor division representation to DivisionRepr
ClosedPublic

Authored by Groverkss on Jul 5 2022, 8:15 AM.

Details

Summary

This patch refactors existing implementations of division representation storage
into a new class, DivisionRepr. This refactoring is done so that the common
division utilities can be shared in an upcoming patch.

Diff Detail

Event Timeline

Groverkss created this revision.Jul 5 2022, 8:15 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 5 2022, 8:15 AM
Groverkss requested review of this revision.Jul 5 2022, 8:15 AM
arjunp added inline comments.Jul 6 2022, 7:24 AM
mlir/include/mlir/Analysis/Presburger/Utils.h
107–114

Please differentiate betwen local vars and divisions (locals that have div reprs) in this comment.

108–109

Do you mean the coefficients of the dividends?

mlir/lib/Analysis/Presburger/IntegerRelation.cpp
921–922

localOffset

933–935

Can you make a clearRepr function?

mlir/lib/Analysis/Presburger/Matrix.cpp
96
mlir/lib/Analysis/Presburger/Utils.cpp
219

please add an assert for dividend size

Groverkss updated this revision to Diff 442599.Jul 6 2022, 8:50 AM
Groverkss marked 6 inline comments as done.
  • Address Arjun's comments
arjunp added inline comments.Jul 6 2022, 8:56 AM
mlir/include/mlir/Analysis/Presburger/Utils.h
108
109

I don't understand what this ordering means. Like, won't it be in the same order as that ordering of the vars in the original constraint set? That set might have locals with no div reprs in between locals with div reprs.

129–133

Isn't DivRepr redundant here, we can just write Repr I think

mlir/lib/Analysis/Presburger/IntegerRelation.cpp
929–936

nit

Groverkss updated this revision to Diff 442892.Jul 7 2022, 6:46 AM
Groverkss marked 4 inline comments as done.
  • Address Arjun's comments
arjunp accepted this revision.Jul 7 2022, 6:48 AM
This revision is now accepted and ready to land.Jul 7 2022, 6:48 AM