This is an archive of the discontinued LLVM Phabricator instance.

[MLIR][Presburger] Merge PresburgerLocalSpace and PresburgerSpace
ClosedPublic

Authored by Groverkss on Mar 23 2022, 2:13 PM.

Details

Summary

This patch is a cleanup patch that merges PresburgerLocalSpace and
PresburgerSpace. Asserting that there are no locals is shifted to the
users of PresburgerSpace themselves.

The reasoning for this patch is that PresburgerLocalSpace did not contribute
much and only introduced additional complexity as locals could still be present
in PresburgerSpace, just not writable. This could introduce problems if a
PresburgerSpace with locals was copied to PresburgerLocalSpace which expected
no locals in a PresburgerSpace.

Diff Detail

Event Timeline

Groverkss created this revision.Mar 23 2022, 2:13 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 23 2022, 2:13 PM
Groverkss requested review of this revision.Mar 23 2022, 2:13 PM
arjunp added inline comments.Mar 23 2022, 4:03 PM
mlir/include/mlir/Analysis/Presburger/PresburgerRelation.h
1–2

Please fix this.

mlir/include/mlir/Analysis/Presburger/PresburgerSpace.h
113–121

I prefer to call isEqual -> isCompatible and isEqualWithLocals -> isEqual.

I find it weird to say things are equal when they have different locals. I would rather say they are compatible in that case.

Groverkss updated this revision to Diff 417967.Mar 24 2022, 9:53 AM
Groverkss marked 2 inline comments as done.
  • Address Arjun's comments.
  • Move PresburgerSpace::isEqual -> PresburgerSpace::isSpaceCompatible.
  • Move PresburgerSpace::isEqualWithLocal -> PresburgerSpace::isSpaceEqual.

PresburgerSpace::isSpaceEqual/Compatible seems a little weird, to have Space twice. I understand that after inheriting we want IntegerRelation::isSpaceEqual, though. Is isSpaceEqual even used anywhere? Can we just drop it and just keep isCompatible? IntegerRelation::isCompatible seems like a reasonable name

PresburgerSpace::isSpaceEqual/Compatible seems a little weird, to have Space twice. I understand that after inheriting we want IntegerRelation::isSpaceEqual, though. Is isSpaceEqual even used anywhere? Can we just drop it and just keep isCompatible? IntegerRelation::isCompatible seems like a reasonable name

IsSpaceEqual is required for functions that assume number of locals are equal, for example: IntegerRelation::append, IntegerRelation::isEqual, IntegerRelation::isSubsetOf, IntegerRelation::unionBoundingBox.

arjunp accepted this revision.Mar 24 2022, 12:58 PM

Those probably need to be updated to support differing locals by merging.

Anyway, let's land this as is for now.

This revision is now accepted and ready to land.Mar 24 2022, 12:58 PM
This revision was landed with ongoing or failed builds.Mar 24 2022, 5:06 PM
This revision was automatically updated to reflect the committed changes.