[Mlir-commits] [mlir] [mlir][AMDGPU] Plumb address space 7 through MLIR, add address_space attr. (PR #125594)

Prashant Kumar llvmlistbot at llvm.org
Mon Feb 10 11:47:45 PST 2025


================
@@ -76,11 +83,168 @@ static Value getLinearIndexI32(ConversionPatternRewriter &rewriter,
   return index ? index : createI32Constant(rewriter, loc, 0);
 }
 
+/// Compute the contents of the `num_records` field for a given memref
+/// descriptor - that is, the number of bytes that's one element past the
+/// greatest possible valid index into the memref.
+static Value getNumRecords(ConversionPatternRewriter &rewriter, Location loc,
+                           MemRefType memrefType,
+                           MemRefDescriptor &memrefDescriptor,
+                           ArrayRef<int64_t> strides,
+                           uint32_t elementByteWidth) {
+  if (memrefType.hasStaticShape() &&
----------------
pashu123 wrote:

I think we can have an assert before 
```suggestion
assert(memrefType.hasStaticShape() && ...)
  ```

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


More information about the Mlir-commits mailing list