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

    <tr>
        <th>Summary</th>
        <td>
            [mlir] Convert-scf-to-spirv pass erase the "scf.yield" and reports error " 'scf.parallel' op expects body to terminate with 'scf.yield'"
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

    <tr>
      <th>Reporter</th>
      <td>
          Colloportus0
      </td>
    </tr>
</table>

<pre>
    After fixing the issue [59989](https://github.com/llvm/llvm-project/issues/59989) , now `convert-scf-to-spirv` pass report the following error on this example

example:
```
module {
  func.func @func(%arg0: i64) {
    %0 = builtin.unrealized_conversion_cast %arg0 : i64 to index 
 %alloc = memref.alloc() : memref<16xf32> 
    scf.parallel (%arg1) = (%0) to (%0) step (%0) {
      %cst = arith.constant 1.000000e+00 : f32
 memref.store %cst, %alloc[%arg1] : memref<16xf32>
      scf.yield
 }
    return
  }
}
```

error message:
'scf.parallel' op expects body to terminate with 'scf.yield'
temp.mlir:5:5: note: see current operation:
"scf.parallel"(%0, %0, %0) ({
^bb0(%arg1: index):
%2 = "spirv.Constant"() {value = 1.000000e+00 : f32} : () -> f32
"memref.store"(%2, %1, %arg1) : (f32, memref<16xf32>, index) -> ()
}) {operand_segment_sizes = array<i32: 1, 1, 1, 0>} : (index, index, index) -> ()

What I am curious about is,  the region in the above example terminated with "scf.yield", but the region in the error message does not. Why would that happen? Is scf.yield eliminated by --convert-scf-to-spirv pass?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVd2OqzgMfpr0xioKppRy0YtOOZXOE5zLUQC3ZBUSlIT5OU-_SoDCrM7sxWpn2lAH-fNn-0ssnJMPTXRm-QvLq50YfWfs-WqUMoOxfnR8V5v283y5e7Jwlx9SP8B3BNK5kYDlL3lZnkqWVwxPnfeDY9mF4Y3h7SF9N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