[Mlir-commits] [mlir] [MLIR] `vector.constant_mask` to support unaligned cases (PR #116520)

Andrzej WarzyƄski llvmlistbot at llvm.org
Sun Nov 17 12:52:01 PST 2024


banach-space wrote:

> In the case of unaligned indexing and vector.constant_mask, notice that numFrontPadElems is always strictly smaller than numSrcElemsPerDest, which means that with a non-zero numFrontPadElems, the compressed constant_mask op will not have any preceding zeros elements in the innermost dimemsion but the values and size relevant might change due to the extra step of shifting and aligning elements.

There's quite a bit of detail here, but the goal and justification are unclear to me. Is the intent something along these lines?

    Ensure that vector.constant_mask is always used when creating a constant mask (instead of requiring arith.constant).
    This simplifies the logic and facilitates support for cases where the original mask is rank N, with N > 1.

> This patch enables multi-dimensional support by simply observing the abovementioned property and eliminating the constraints.

Could you clarify this statement? Phrases like "multi-dimensional support" are quite broad. From what I understand, this patch specifically adds support for extracting 1-D masks from N-D masks (where N > 1). True "multi-dimensional support" would involve directly handling full N-D masks (e.g., 2-D masks) rather than just reducing their rank.

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


More information about the Mlir-commits mailing list