If we have a spv.mlir.selection op nested in a spv.mlir.loop
op, when serializing the loop's block, we might need to jump
from the selection op's merge block, which might be different
than the immediate MLIR IR predecessor block. But we still need
to get the block argument from the MLIR IR predecessor block.
Also, if the spv.mlir.selection is in the spv.mlir.loop's
header block, we need to make sure OpLoopMerge is emitted
in the current block before start processing the nested selection
op. Otherwise we'll see the LoopMerge in the wrong SPIR-V
basic block.
Depends On D115541
Why did you removed seq?
Also, it probably can be changed to smth like this:
as we know this is the same block that contains BranchConditionalOp.
Also, I have tried similar fix locally before, but it was failing on
With spv.Load was destroyed while have uses