This is an archive of the discontinued LLVM Phabricator instance.

[MLIR] Rename Shape dialect's `join` to `meet`.
ClosedPublic

Authored by arames on Sep 29 2021, 1:12 PM.

Details

Summary

For the type lattice, we (now) use the "less specialized or equal" partial
order, leading to the bottom representing the empty set, and the top
representing any type.

This naming is more in line with the generally used conventions, where the top
of the lattice is the full set, and the bottom of the lattice is the empty set.
A typical example is the powerset of a finite set: generally, meet would be the
intersection, and join would be the union.

top:  {a,b,c}
     /   |   \
 {a,b} {a,c} {b,c}
   |  X     X  |
   {a} { b } {c}
      \  |  /
bottom: { }

This is in line with the examined lattice representations in LLVM:

  • lattice for BitTracker::BitValue in Hexagon/BitTracker.h
  • lattice for constant propagation in HexagonConstPropagation.cpp
  • lattice in VarLocBasedImpl.cpp
  • lattice for address space inference code in InferAddressSpaces.cpp

Diff Detail

Event Timeline

arames created this revision.Sep 29 2021, 1:12 PM
arames requested review of this revision.Sep 29 2021, 1:12 PM
jpienaar accepted this revision.Sep 30 2021, 1:19 PM

I'm fine with renaming, preference if you could add to the change description other instances inside LLVM that follow the convention (e.g., it is a convention, grounding the convention with the usages in the same project would be preferable)

This revision is now accepted and ready to land.Sep 30 2021, 1:19 PM

+1 to Jacques suggestion to listing some prior art here. In the project ideally or in the industry as well would be good.

silvas accepted this revision.Sep 30 2021, 1:25 PM
arames updated this revision to Diff 377346.Oct 5 2021, 1:53 PM

Expand commit message with details and related instances.

arames edited the summary of this revision. (Show Details)Oct 5 2021, 1:54 PM
arames added a comment.Oct 5 2021, 2:01 PM

All the lattice descriptions I could find and decipher in LLVM seemed to match the convention.
Of course, one could absolutely use the other way.

As discussed previously, on top of matching the convention, I think it will be valuable for types, as it will match the "join" operation for the dataflow analysis.

silvas accepted this revision.Oct 5 2021, 4:24 PM
This revision was automatically updated to reflect the committed changes.