[Mlir-commits] [mlir] [mlir][vector][nfc] Add tests + update docs for narrow-type emulation (PR #115460)
Andrzej Warzyński
llvmlistbot at llvm.org
Fri Nov 8 12:37:56 PST 2024
banach-space wrote:
> ```
> %mask = [0, 1, 1, 1, 1, 1, 0, 0]
> ```
> The preceding zeros are common for the unaligned cases introduced here: #113411.
Hm, I was trying to come up with an example and am struggling 😅 . For instance:
```mlir
%1 = vector.maskedload %0[%c2], %mask, %passthru : memref<10xi2>, vector<8xi1>, vector<8xi2> into vector<8xi2>
```
Even though `i2` is (most likely) not byte-aligned, the emulated load should start with a byte that contains the first value to load, right? So, for this initial mask for `i2` (loading at %c2):
```mlir
%mask_for_i2 = [1, 1, 1, 1, 1, 1, 1, 0]
```
we should generate the following mask for `i8` (loading at %c0):
```mlir
%mask_for_i8 = [1, 1]
```
To rephrase, I feel that we will almost always start with `[1, 1, ...]` (at least one leading "1") and then compress that to: `[1, ...]` (at least one leading "1").
Hope I'm not missing something obvious 🤔
https://github.com/llvm/llvm-project/pull/115460
More information about the Mlir-commits
mailing list