[Mlir-commits] [mlir] [mlir] MemrefToLLVM: Support `llvm.address_space` as memory space and do not generate noop `addrspacecast`s (PR #173387)

Matthias Springer llvmlistbot at llvm.org
Tue Dec 23 12:19:46 PST 2025


================
@@ -289,6 +289,26 @@ func.func @address_space(%arg0 : memref<32xf32, affine_map<(d0) -> (d0)>, 7>) {
 
 // -----
 
+// ALL-LABEL: func @llvm_address_space_cast
+//  ALL-SAME:   (%[[ARG:.*]]: memref<f32, #llvm.address_space<3>>)
+func.func @llvm_address_space_cast(%arg0 : memref<f32, #llvm.address_space<3>>) -> memref<f32, 3 : i32> {
----------------
matthias-springer wrote:

I'm a bit confused by `#llvm.address_space`. Never seen it before. Why would we have `memref<..., #llvm.address_space<3>>` instead of `memref<..., 3>`?

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


More information about the Mlir-commits mailing list