You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now BTreeSet<Attr> is done really hackily, with non-Ord leaves (and/or "there should be only one of this kind of attribute") being wrapped in OrdAssertEq (where non-equal comparisons just panic).
A better design might look like BTreeMap<AttrKey, AttrValue>, with AttrValue either containing the same set of variants (but only the "payload" information), or something more like LLVM's "metadata" syntax (i.e. regular IR constants plus a few other structured forms that aren't well-represented as values etc.).
There's a few variations but without dependent types we can't do too much to optimize on multiple axis (whereas dependent types could have "a different value type based on the associated key" etc.).
I think initially I also wanted to do weirder interning of attributes and specialize for the "small number of attributes" case (i.e. use a bit in AttrSet to indicate whether the rest of the integer refers to an interned Attr or a set thereof etc.) but that's probably too silly to consider.
The text was updated successfully, but these errors were encountered:
Right now
BTreeSet<Attr>
is done really hackily, with non-Ord
leaves (and/or "there should be only one of this kind of attribute") being wrapped inOrdAssertEq
(where non-equal comparisons just panic).A better design might look like
BTreeMap<AttrKey, AttrValue>
, withAttrValue
either containing the same set of variants (but only the "payload" information), or something more like LLVM's "metadata" syntax (i.e. regular IR constants plus a few other structured forms that aren't well-represented as values etc.).There's a few variations but without dependent types we can't do too much to optimize on multiple axis (whereas dependent types could have "a different value type based on the associated key" etc.).
I think initially I also wanted to do weirder interning of attributes and specialize for the "small number of attributes" case (i.e. use a bit in
AttrSet
to indicate whether the rest of the integer refers to an internedAttr
or a set thereof etc.) but that's probably too silly to consider.The text was updated successfully, but these errors were encountered: