[Mlir-commits] [mlir] [mlir][vector] reject negative strides for `vector.load`/`vector.store` (PR #204611)

Andrzej WarzyƄski llvmlistbot at llvm.org
Mon Jun 22 02:55:03 PDT 2026


banach-space wrote:

> **Moved out of the PR summary**
> 
> Please consider to read the following đŸ«¶
> 
> In `ConvertVectorToLLVM` we are currently using `hasNonNegativeStrides` for lots of ops:
> 
> 1. `VectorLoadStoreConversion<vector::LoadOp>` --> YES VERIFIER (with this PR)
> 2. `VectorLoadStoreConversion<vector::StoreOp>` --> YES VERIFIER (with this PR)
> 3. `VectorLoadStoreConversion<vector::MaskedLoadOp>` --> NO VERIFIER
> 4. `VectorLoadStoreConversion<vector::MaskedStoreOp>` --> NO VERIFIER
> 5. `VectorGatherOpConversion` --> YES VERIFIER (but doesn't check negative stride)
> 6. `VectorScatterOpConversion` --> YES VERIFIER (but doesn't check negative stride)
> 
> https://github.com/llvm/llvm-project/blob/a696a09aa7a40a3f764157b090367dd74399d863/mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp#L226-L234
> 
> We should think about it. Do we want to have the verifier for them too? :D
> 
> I don't have a strong position on this (I have a limited view on the matter). Let me know; I'm open to updating the PR in this direction.

That's effectively implemented in https://github.com/llvm/llvm-project/pull/204842/, right? Thank you!

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


More information about the Mlir-commits mailing list