Andrzej Warzyński e59414f9bf
[mlir][sme] Use signed comparison in ArmSMEToSCF (#156834)
This change switches from `ult` to `slt` in the comparison generated by
`TileLoadOpWithMaskAndPadNonZeroConversion`.

From the updated test:
```
%[[ROW_IS_ACTIVE:.*]] = arith.cmpi slt, %[[TILE_SLICE_INDEX]], %[[NUM_ROWS]] : index
```

Here:
- `%[[TILE_SLICE_INDEX]]` is always non-negative.
- `%[[NUM_ROWS]]` represents the number of remaining rows.

`%[[NUM_ROWS]]` is computed as:

```mlir
    %c-4 = arith.constant -4 : index
    %c-4_vscale = arith.muli %c-4, %vscale_11 : index
    %num_rows_remaining = arith.addi %num_rows_init, %c-4_vscale : index
```

(inserted by the "arm-sme-vector-legalization" pass, see
`VectorLegalization.cpp`).

Because of the subtraction, `%num_rows_remaining` can be negative.
Therefore, the comparison must be signed (`slt`) rather than unsigned
(`ult`).

Fixes: https://github.com/iree-org/iree/issues/21714
2025-09-05 08:58:52 +01:00
..