[Mlir-commits] [mlir] [NFC][mlir][vector] Handle potential static cast assertion. (PR #152957)

Md Asghar Ahmad Shahid llvmlistbot at llvm.org
Mon Aug 18 20:01:03 PDT 2025


shahidact wrote:

> Looks like a good fix, but a test would be extra nice. Not possible to add one in the same file as the original PR?

```
#map = affine_map<(d0, d1, d2) -> (d0, d2)>
#map1 = affine_map<(d0, d1, d2) -> (d2, d1)>
#map2 = affine_map<(d0, d1, d2) -> (d0, d1)>
func.func @crash_test(
      %arg0: tensor<8x4xi8>, %arg1: tensor<4x8xi8>,
      %arg2: tensor<8x8xi32>) -> tensor<8x8xi32> {
    %0 = linalg.generic {
      indexing_maps = [#map, #map1, #map2],
      iterator_types = ["parallel", "parallel", "reduction"]}
      ins(%arg0, %arg1 : tensor<8x4xi8>, tensor<4x8xi8>)
      outs(%arg2 : tensor<8x8xi32>) {
    ^bb0(%in: i8, %in_0: i8, %out: i32):
      %0 = arith.extsi %in : i8 to i32
      %1 = arith.extsi %in_0 : i8 to i32
      %2 = arith.muli %0, %1 : i32
      %3 = arith.addi %out, %2 : i32
      linalg.yield %3 : i32
    } -> tensor<8x8xi32>
    return %0 : tensor<8x8xi32>
}
```
I encountered the assert with above test case using the downstream vectorizer pass. I could not reproduce the assert with transform interpreter. Hence, I did not add the test case.

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


More information about the Mlir-commits mailing list