[Mlir-commits] [mlir] [mlir][memref] Verify out-of-bounds access for `memref.subview` (PR #131876)
Andrzej WarzyĆski
llvmlistbot at llvm.org
Tue Mar 25 02:46:09 PDT 2025
================
@@ -3025,6 +3028,14 @@ LogicalResult SubViewOp::verify() {
return produceSubViewErrorMsg(SliceVerificationResult::LayoutMismatch,
*this, expectedType);
+ // Verify that offsets, sizes, strides do not run out-of-bounds with respect
+ // to the base memref.
+ SliceBoundsVerificationResult boundsResult =
+ verifyInBoundsSlice(baseType.getShape(), staticOffsets, staticSizes,
+ staticStrides, /*generateErrorMessage=*/true);
+ if (!boundsResult.isValid)
+ return getOperation()->emitError(boundsResult.errorMessage);
----------------
banach-space wrote:
Why not re-use `produceSubViewErrorMsg`?
https://github.com/llvm/llvm-project/pull/131876
More information about the Mlir-commits
mailing list