<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/60626>60626</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Incorrect results in sparse_tanh.mlir and sparse_matmul.mlir
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            mlir:sparse,
            mlir
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          banach-space
      </td>
    </tr>
</table>

<pre>
    Hi,

In https://reviews.llvm.org/D143514 I updated some SparseCompiler integration tests to use SVE code-gen path. In two cases the generated output disagrees with the expected output.

**sparse_tanh.mlir**
Expected output:
```
// CHECK-NEXT: {{( -0.761[0-9]*, 0.761[0-9]*, 0.96[0-9]*, 0.99[0-9]*, 0.99[0-9]*, 0.99[0-9]*, 0.99[0-9]*, 0.99[0-9]*, 1 )}}
```
Generated output:
```
( -0.761594, 0, 0, 0.761594, 0, 0, 0, 0, 0, 0, 0, 0.964028, 0, 0, 0, 0, 0, 0.995055, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 )
```
Note the non-zero values at the end in one case and zeros in the other.

**sparse_matmul.mlir**
Output generated by non-sve RUN lines:
```
[30.5,  4.2,  4.6,  7,  8,  0,  0,  0,  0,  0, 0,  0,  0,  0,  0,  0]
```
Output generated by the SVE RUN line:
```
[30.5,  4.2,  4.6,  7,  8,  4.32995e-304,  5.24135e-304, 8.48805e-314,  3.95253e-322,  3.95253e-322,  9.2689e-310,  9.27115e-310,  0, 2,  0,  0]
```
All values are effectively correct except `2` at the end. The test passes nonetheless as the `CHECK` line only verifies the first 5 values:
```
/ CHECK: [30.5,  4.2,  4.6,  7, 8{{.*}}]
```

-Andrzej
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0Vd2O4ygTfRp8U7KFsfHPhS-6O51vWp_UK-3MrvZuhe1KzIiABTg9PU-_A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