[Mlir-commits] [mlir] [mlir] Implement a memory-space cast bubbling-down transform (PR #159454)

Fabian Mora llvmlistbot at llvm.org
Fri Sep 19 13:21:26 PDT 2025


fabianmcg wrote:

> Re naming: we could follow LLVM here and call it -memref-infer-memory-spaces
This is not exclusive to memrefs.

> As a general comment, the notion of a lossless memory cast is something that'll need an attribute interface on memory spaces, not an op interface.

See my other comment, that was a poorly chosen name and I'll change.

However, this is an op interface as it is the cast op the one that determines whether it can be propogated or not without altering program semantics. For example, a `amdgpu.fat_raw_buffer_cast` will never allow propagation.

> So ... what if we just made this infer-memory-spaces to rewrite out as many casts to the null memory space as you can get your hands on?

`ptr` doesn't allow null memory space.

https://github.com/llvm/llvm-project/pull/159454


More information about the Mlir-commits mailing list