KhronosGroup / KhronosGroup/SPIRV-Tools

spirv-opt --eliminate-dead-branches generates code that spirv-val rejects

Open
#2,450 3 comments 0 reactions 1 assignee Claimed by @alan-baker View on GitHub
component:validation
Dominant language
C++
Stars
1.4k
Forks
709
Avg merge
1d 22h
Merged PRs (30d)
28

Description

[This archive contains files necessary to reproduce the problem](https://github.com/KhronosGroup/SPIRV-Tools/files/2964204/files_to_reproduce.zip)

Generating SPIR-V from variant_136_reduced_final.frag using glslangValidator, and then optimizing it with the --eliminate-dead-branches option leads to SPIR-V that the validator rejects with:

```
error: line 34: block 23 branches to the selection construct, but not to the selection header 8
%23 = OpLabel
```

Issue found using [GraphicsFuzz](https://github.com/google/graphicsfuzz).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.