[mlir][spirv] Fix nested control flow serialization
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. Reviewed By: Hardcode84 Differential Revision: https://reviews.llvm.org/D115560
Loading
Please sign in to comment