Using MLIR attributes instead of metadata has many advantages:
- No indirection: Attributes can simply refer to each other seemlessly without having to use the indirection of SymbolRefAttr. This also gives us correctness by construction in a lot of places as well
- Multithreading save: The Attribute infrastructure gives us thread-safety for free. Creating operations and inserting them into a block is not thread-safe. This is a major use case for e.g. the inliner in MLIR which runs in parallel
- Easier to create: There is no need for a builder or a metadata region
This patch therefore does exactly that. It leverages the new distinct attributes to create distinct alias domains and scopes in a deterministic and threadsafe manner.
ultra nit...