I’m just bringing this up for broader attention to see if there are any concerns. The revision linked below is self-explanatory:
https://reviews.llvm.org/D121270
It updates the MemRef type’s doc to state that memrefs in different memory spaces
cannot alias with each other. This allows aliasing checks and analysis to be more powerful enforcing useful guarantees and canonicalization.
In LLVM itself, address spaces aren’t mutually disjoint and so pointers from different address spaces can alias. (One can cast across address spaces.) However, the memref
type is better not viewed as such a low-level abstraction, and it appears good to restrict things. Note that one can still separately model low-level address spaces and aliasing in the LLVM dialect or similarly “close to the target” dialects – the memref type is deabstracted and expected to not be used in such dialects when such modeling is desired.