[Mlir-commits] [mlir] [MemRef] Document `subview` runtime verifier (PR #214506)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu Aug 6 08:16:46 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-mlir-memref

Author: ioana ghiban (ioghiban)

<details>
<summary>Changes</summary>

Make the option of runtime verification of `memref.subview` explicit via documentation.

---
Full diff: https://github.com/llvm/llvm-project/pull/214506.diff


1 Files Affected:

- (modified) mlir/include/mlir/Dialect/MemRef/IR/MemRefOps.td (+4-2) 


``````````diff
diff --git a/mlir/include/mlir/Dialect/MemRef/IR/MemRefOps.td b/mlir/include/mlir/Dialect/MemRef/IR/MemRefOps.td
index 8f530b2dbd62e..052462dbdf6d3 100644
--- a/mlir/include/mlir/Dialect/MemRef/IR/MemRefOps.td
+++ b/mlir/include/mlir/Dialect/MemRef/IR/MemRefOps.td
@@ -2174,8 +2174,10 @@ def SubViewOp : MemRef_OpWithOffsetSizesAndStrides<"subview", [
     The offset, size and stride operands must be in-bounds with respect to the
     source memref. When possible, the static operation verifier will detect
     out-of-bounds subviews. Subviews that cannot be confirmed to be in-bounds
-    or out-of-bounds based on compile-time information are valid. However,
-    performing an out-of-bounds subview at runtime is undefined behavior.
+    or out-of-bounds based on compile-time information are valid. The
+    `-generate-runtime-verification` pass can insert runtime bound checks.
+    Otherwise, performing an out-of-bounds subview at runtime is undefined
+    behavior.
 
     Example 1:
 

``````````

</details>


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


More information about the Mlir-commits mailing list