Closed paulthomson closed 4 years ago
I ran this on a newer build of spirv-opt and the error changed:
error: line 37: OpLoopMerge must immediately precede either an OpBranch or OpBranchConditional instruction. OpLoopMerge must be the second-to-last instruction in its block.
OpLoopMerge %35 %38 None
error: line 0: Validation failed after pass inline-entry-points-exhaustive
The following SPIR-V is the issue I think:
%36 = OpLabel
OpLoopMerge %35 %38 None
OpKill
I am not sure if the original issue was fixed (intentionally or otherwise), or is just evading reproduction due to other changes.
Fixed by #2842 I believe.
bug_report.zip
Issue found using GraphicsFuzz.
Tool versions:
To reproduce:
glslangValidator -V shader.frag -o shader.frag.spv
spirv-opt shader.frag.spv -o temp.spv --validate-after-all --eliminate-dead-branches --merge-return --eliminate-dead-branches --merge-blocks --inline-entry-points-exhaustive --eliminate-dead-inserts --inline-entry-points-exhaustive --ccp --eliminate-dead-branches --private-to-local --combine-access-chains --eliminate-dead-branches --merge-blocks --eliminate-dead-inserts --simplify-instructions
The following shader files are included in the attached archive, some of which are also shown inline below:
0_glsl/shader.frag:
1_spirv_asm/shader.frag.asm: