<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/70813>70813</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[mlir][spirv] type mismatch for bb argument when convert-cf-to-spirv
</td>
</tr>
<tr>
<th>Labels</th>
<td>
mlir:spirv
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
python3kgae
</td>
</tr>
</table>
<pre>
**Command line**
mlir-opt --convert-cf-to-spirv
**Input mlir**
```
module {
func.func @main_graph(%arg0: memref<3xf32>, %arg1: memref<3xf32>) -> memref<3xf32> {
%alloc = memref.alloc() {alignment = 16 : i64} : memref<3xf32>
%c0 = arith.constant 0 : index
%c3 = arith.constant 3 : index
%c1 = arith.constant 1 : index
cf.br ^bb1(%c0 : index)
^bb1(%0: index): // 2 preds: ^bb0, ^bb2
%1 = arith.cmpi slt, %0, %c3 : index
cf.cond_br %1, ^bb2, ^bb3
^bb2: // pred: ^bb1
%2 = memref.load %arg0[%0] : memref<3xf32>
%3 = memref.load %arg1[%0] : memref<3xf32>
%4 = arith.addf %2, %3 : f32
memref.store %4, %alloc[%0] : memref<3xf32>
%5 = arith.addi %0, %c1 : index
cf.br ^bb1(%5 : index)
^bb3: // pred: ^bb1
return %alloc : memref<3xf32>
}
}
```
**Output**
error: type mismatch for bb argument #0 of successor #0
cf.br ^bb1(%c0 : index)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVdGOrCgQ_Rp8IRoEbfTBh-7p6WSf9hMmiKjsIhjA2Zm_34D2XM3tzp1JOkLDqTqHqqJgzslBC9GA8gLKa8IWPxrbzJ9-NJr8OzCRtKb7bAA-A3x-MdPEdAeV1GJdAegK0BnCSUmbmtnDNOVGvwvrU96n3qRulvYdrrDtGw3_0vPio9neETih7Rf_TqZblICAXu48_aJ5Fj4QFGhiUr8Nls0jwBXAJbMDAuQMJzFZ0QPyQj56ggF5BfgFrvv5k_0apoC8_r6z54bRh1KGQ0CuGzaLC5G_DmCm5KAnoX3E5CcYCOWpAPQKH3PvvXMUzZiVfsy40c4z7SFanehOfBzR5BGaPEPnj9D5IzTvs9ZCUL62bb6Glu814PoO3UPQAUDCLr4BfIMYzlZ0LixFPIrpCDN8EHjQN80SOuW3zKFt5A8Px_twnu4taMZlvnN_n5GDYLxXF7R9ScsPgvA-z8qwDt6LrLxEUeV3ckqeeMl_5KXYBYd1XR_1bVFZgxKMviw2OueNFdH8fgVitf6EuDwSy0M6vlk95fPiId_JhRV-sXp__Z6rBvS69ZKvybGp7LvQ34ufF39oZcJaYwOB_5wFnKSbmOcj7I2FbQuZHZb1dmOCoOmhWzgXzhkbV35whZKuIV1NapaIJj_VFT2RoqqTselrUfWcVDWqKD6xlmJEaSlyRGlet4ImssEIkxyRPC-KoqiyElHSnnhH-1L0jFagQGJiUmVKvU-ZsUMinVtEQ1GVk0SxVigXGz7GsQGTc-zSAOPwBNgmmKXtMjhQICWdd78ceelVfCyiYXkF5WW1La9_CNh_o9DwwduQLFY1o_dzaBBrHQzSj0ubcTMBfAvU25DO1vwjuAf4Fg_kAL7FM_0fAAD__8OR3XY">