[Mlir-commits] [mlir] [MLIR][AMDGPU] Implement reifyResultShapes for FatRawBufferCastOp (PR #171839)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu Dec 11 11:57:54 PST 2025


================
@@ -0,0 +1,33 @@
+// RUN: mlir-opt -resolve-shaped-type-result-dims -split-input-file %s | FileCheck %s
+
+func.func @fat_raw_buffer_cast_static_dim(%arg0: memref<2x3xf32>) -> (index, index) {
+  %c0 = arith.constant 0 : index
+  %c1 = arith.constant 1 : index
+  %cast = amdgpu.fat_raw_buffer_cast %arg0 : memref<2x3xf32>
+      to memref<2x3xf32, #amdgpu.address_space<fat_raw_buffer>>
+  %d0 = memref.dim %cast, %c0 : memref<2x3xf32, #amdgpu.address_space<fat_raw_buffer>>
----------------
MaheshRavishankar wrote:

The way this will actually end up working is that you will end up calling `reifyResultShapes` twice, each for the dim operation and you will throw away the non-reified dimensions. It is "better" to just implement `reifyDimOfResult`.

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


More information about the Mlir-commits mailing list