[Mlir-commits] [mlir] [MLIR][Linalg] Add static shape masking option in vectorization (PR #214812)

Dhairyashil R G llvmlistbot at llvm.org
Sat Aug 8 08:42:33 PDT 2026


dhairyashilRG wrote:

Nice to see this gap filled, the `assume_dynamic_dims_match_vec_sizes` asymmetry is real. I applied it on `5506a9af0572`; `check-mlir` is green and clang-format is clean, so just one question.

`vectorizeMaskBoundsPrecondition` compares the bound's UB against `vectorSizes[dim]`, which for a scalable dim is the pre-`vscale` size. With `vector_sizes [[4]]` on a `tensor<?xf32>` elementwise op, a bound provably ≤ 16 is rejected, while ≤ 4 goes through and the un-bounded baseline vectorizes fine, even though `vector<[4]xf32>` is 16 lanes at `vscale == 4`.

I realise that's conservative rather than unsound, and `vscale` isn't known at compile time. But would an optional `VscaleRange` through `ScalableValueBoundsConstraintSet::computeScalableBound` be worth it here, the way `eliminateVectorMasks` does in `VectorMaskElimination.cpp`? Dynamic shapes plus masking is mostly an SVE/SME story, so it seems a shame to close that door. (Compile-time observation, no SVE hardware on my end.)

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


More information about the Mlir-commits mailing list