Given this SPIRV Input:
in.zip
Running
spirv-val in.spv --scalar-block-layout
returns no errors.
However, if we run the merge return pass on this spirv and then validate its output, we will get an error:
spirv-opt in.spv --scalar-block-layout --merge-return -o out.spv
spirv-val out.spv --scalar-block-layout
Produces:
error: line 171: NonSemantic.Shader.DebugInfo.100 DebugFunctionDefinition: must be in the entry basic block of the function
%38 = OpExtInst %void %2 DebugFunctionDefinition %34 %main
Observed with SPIRV-Tools v2024.4 v2024.4.rc2-0-g4d2f0b40.