Issue 240114
Summary [mlir][Vector] Improve Vector masking
Labels mlir
Assignees
Reporter dhairyashilRG
    
> [!NOTE]
> This is an umbrella ticket to track Vector masking bugs and fixes that don't block removing `in_bounds` (#227821) and aren't part of unifying the masking representation (#239511). It's tracked under the Vector index of meta-issues: #235708. Numbered items are from the [`in_bounds` audit](https://github.com/llvm/llvm-project/issues/227821#issuecomment-6664834723) (same numbers).

### Bugs

**Mask ignored or applied wrongly**

| Description | Issue / PR |
|---|---|
| 6. `LowerColumnTransferReadToLoops` (ArmSME) ignores the mask operand and the padding | None yet |
| `vector.multi_reduction` canonicalization returns the source instead of the accumulator under an all-false `vector.mask` | #239741 |
| `-lower-vector-mask` drops the mask operand of the masked op | #225244, fix in #226128 |
| `-convert-vector-to-scf` peels the wrong mask dim when the transfer has a permutation map | #239710 |

**`vector.mask` gives invalid IR or a crash**

| Description | Issue / PR |
|---|---|
| 14. `DropInnerMostUnitDimsTransfer{Read,Write}` | None yet |
| 15. `-convert-vector-to-amx` (write), and `VectorContractToAMXDotProduct` (accumulator write in the loop case) | None yet |
| 16. `-arm-sme-vector-legalization`: `LowerColumnTransferReadToLoops`, `LegalizeMultiTileTransferWriteAsStoreLoop` and `LowerIllegalTransposeStoreViaZA` | None yet |
| 17. `TransferOpRewriter` in `ExtractAddressComputations.cpp` | None yet |
| `-ownership-based-buffer-deallocation` creates a constant inside the `vector.mask` region | #99662 |
| Bufferizing an empty `vector.mask` crashes | #231811 |
| `eliminate-vector-masks` crashes on a rank-0 `vector.create_mask` | #240008 |

**`in_bounds` lost or wrong** (goes away with `in_bounds`, but live today)

| Description | Issue / PR |
|---|---|
| 9. `CastAwayTransfer{Read,Write}LeadingOneDim` drops an out-of-bounds leading unit dim | #239699 |
| 10. `LegalizeMultiTileTransferWriteAsStoreLoop` (ArmSME) drops the out-of-bounds flag of dim 0 | None yet |
| 11. `LiftIllegalVectorTransposeToMemory` (ArmSME) turns an out-of-bounds read into an out-of-bounds `memref.subview` | None yet |
| 12. `LowerIllegalTransposeStoreViaZA` (ArmSME) copies `in_bounds` without permuting it | None yet |

**Other**

| Description | Issue / PR |
|---|---|
| 18. `-scf-parallel-loop-fusion` doesn't compare the vector types of a read and a write | None yet |
| 19. `LegalizeTransferRead` (ArmSVE) doesn't scale the index of the collapsed scalable dim | #239583 |

### Other open PRs

| Description | PRs |
|---|---|
| Unrolling `create_mask` / `constant_mask` with a lower-rank target shape asserts | #217514, #234448 (same crash) |
| Transfer unrolling: transpose the mask before extracting from it | #144889 |
| `fold-tensor-subset-ops`: fold masked `transfer_read` through `extract_slice` | #228140 (#227993) |
| Mem2Reg: promote transfers wrapped in `vector.mask` | #234251 |
| NVGPU async copies: clamp the masked size, and decline `vector.mask` | #238719, #238721 |

PRs tracked in #227821 (#221307, #239288, #239554, #239599) and #239511 (#239602) aren't repeated here.

---
Please feel free to edit this ticket and add new items.

cc @banach-space @FedericoBruzzone @Vaisman

_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to