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

Han-Chung Wang llvmlistbot at llvm.org
Mon Nov 18 11:06:15 PST 2024


https://github.com/hanhanW requested changes to this pull request.

Thanks for the patch! IIUC, it is working because we scope the emulation on vector.maskedload with 1-D result vector. There are two "mask" in the emulation. One is used by the vector.maskedload, which ensures that we load enough bits from the memory. The other is used in final result, which selects the bits from loaded data and passthru. In this patch, we observe that we can simplify the first mask logic, which looks good to me. Please correct me if I misread something. :)

> 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.

+1 on what @banach-space said, I had the same confusion. I checked the code and found that the maskedload emulation is scoped to 1D cases:

https://github.com/llvm/llvm-project/blob/cab732861c4885b714c70f2945de9f1dd4d725fa/mlir/lib/Dialect/Vector/Transforms/VectorEmulateNarrowType.cpp#L605-L608

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


More information about the Mlir-commits mailing list