Dialect can opt-in to handle versioning in a custom way. The input IR may start
with the keyword dialect_versions, followed by a dictionary attribute where
the keys are dialect names and the value are attributes representing the
producer version for the given dialect. There is no restriction on what kind of
attribute a dialect is using to model its versioning.
On parsing the version is made available through the parser, and a dialect for
which a version is present has the ability to use the stored version to upgrade
the IR.
I like using an attribute for this as it leaves it all up to the dialect to define. Do we impose any kind of constraints on this though? i.e., if these were dialect attributes, would they need to be upgraded as well (if the dialect changed)?