[Mlir-commits] [mlir] [mlir][memref] Detect negative `offset` or `size` for `subview` (PR #72059)

Matthias Springer llvmlistbot at llvm.org
Sun Nov 12 18:48:59 PST 2023


================
@@ -2842,8 +2851,18 @@ static LogicalResult produceSubViewErrorMsg(SliceVerificationResult result,
   llvm_unreachable("unexpected subview verification result");
 }
 
-/// Verifier for SubViewOp.
 LogicalResult SubViewOp::verify() {
+  for (int64_t offset : getStaticOffsets()) {
----------------
matthias-springer wrote:

Can we move those checks to `mlir::detail::verifyOffsetSizeAndStrideOp` and mention in the interface description that offsets and sizes must be non-negative?

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


More information about the Mlir-commits mailing list