This is an archive of the discontinued LLVM Phabricator instance.

[MLIR][Presburger] Use IdKind for removeIdRange in PresburgerSpace
ClosedPublic

Authored by Groverkss on Mar 6 2022, 2:59 PM.

Details

Summary

This patch moves PresburgerSpace::removeIdRange(idStart, idLimit) to
PresburgerSpace::removeIdRange(kind, idStart, idLimit), i.e. identifiers
can only be removed at once for a single kind.

This makes users of PresburgerSpace to not assume any inside ordering of
identifier kinds.

Diff Detail

Event Timeline

Groverkss created this revision.Mar 6 2022, 2:59 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 6 2022, 2:59 PM
Groverkss requested review of this revision.Mar 6 2022, 2:59 PM
Groverkss updated this revision to Diff 413318.Mar 6 2022, 3:01 PM
  • Fix use of removeIdRange in convertDimToLocal
arjunp added inline comments.Mar 6 2022, 10:39 PM
mlir/lib/Analysis/Presburger/IntegerRelation.cpp
178

Please write the capture explicitly to indicate that idstart and idlimit are not being captured here

187

Drop parentheses for the condition

195

Write a short comment saying why idStart will never need to be updated

1152

Why is this SetDim and not Range? We are in Relation right?

mlir/lib/Analysis/Presburger/PresburgerSpace.cpp
139

Drop these parentheses?

mlir/lib/Dialect/Affine/Analysis/AffineStructures.cpp
1737

I don't understand why we would ever need to update other id kinds?

Groverkss updated this revision to Diff 413614.Mar 7 2022, 1:27 PM
Groverkss marked 6 inline comments as done.
  • Address Arjun's comments
mlir/lib/Analysis/Presburger/IntegerRelation.cpp
1152

This should ideally be shifted to IntegerPolyhedron or be given an IdKind to convert to Local. I can send this as a separate patch.

mlir/lib/Dialect/Affine/Analysis/AffineStructures.cpp
1737

We still need to keep it right? This is just a virtual function that just updates numDomain/numRange incase SetDim is updated.

arjunp added inline comments.Mar 8 2022, 3:10 AM
mlir/lib/Analysis/Presburger/IntegerRelation.cpp
175
178
179–180

This is supposed to be start and limit I think.

1152

Okay.

mlir/lib/Dialect/Affine/Analysis/AffineStructures.cpp
1737

Ah, because you are considering SetDim to include both domain and range. This seems a little confusing, but I guess that's not for this patch.

Groverkss updated this revision to Diff 414299.EditedMar 10 2022, 1:15 AM
Groverkss marked 5 inline comments as done.
  • Adress Arjun's comments
arjunp accepted this revision.Mar 10 2022, 1:53 AM

LGTM, please resolve the remaining comment below.

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

Please rename removeRange -> removeIdKindInRange

This revision is now accepted and ready to land.Mar 10 2022, 1:53 AM
Groverkss updated this revision to Diff 414307.Mar 10 2022, 1:58 AM
Groverkss marked an inline comment as done.
  • rename removeRange -> removeIdKindInRange
This revision was landed with ongoing or failed builds.Mar 10 2022, 2:11 AM
This revision was automatically updated to reflect the committed changes.