[Mlir-commits] [mlir] 748d575 - [MemRef] Document `reinterpret_cast` verifiers (#214505)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Tue Aug 11 05:11:59 PDT 2026
Author: ioana ghiban
Date: 2026-08-11T14:11:53+02:00
New Revision: 748d575edf61b5865e42cd8a78cbb492de8f3df3
URL: https://github.com/llvm/llvm-project/commit/748d575edf61b5865e42cd8a78cbb492de8f3df3
DIFF: https://github.com/llvm/llvm-project/commit/748d575edf61b5865e42cd8a78cbb492de8f3df3.diff
LOG: [MemRef] Document `reinterpret_cast` verifiers (#214505)
Make the loose semantics assumed by `memref.reinterpret_cast` explicit
via documentation.
Added:
Modified:
mlir/include/mlir/Dialect/MemRef/IR/MemRefOps.td
Removed:
################################################################################
diff --git a/mlir/include/mlir/Dialect/MemRef/IR/MemRefOps.td b/mlir/include/mlir/Dialect/MemRef/IR/MemRefOps.td
index 8f530b2dbd62e..3122e7b633870 100644
--- a/mlir/include/mlir/Dialect/MemRef/IR/MemRefOps.td
+++ b/mlir/include/mlir/Dialect/MemRef/IR/MemRefOps.td
@@ -1511,6 +1511,12 @@ def MemRef_ReinterpretCastOp
Consecutive `reinterpret_cast` operations on memref's with static
dimensions.
+ This operation is intended for cases where the user can guarantee the
+ validity of the constructed descriptor. Neither static nor runtime
+ verification check that the resulting descriptor is in-bounds. Accessing
+ memory outside the underlying allocation through the resulting memref is
+ undefined behavior.
+
We distinguish between *underlying memory* — the sequence of elements as
they appear in the contiguous memory of the memref — and the
*strided memref*, which refers to the underlying memory interpreted
More information about the Mlir-commits
mailing list