KhronosGroup / KhronosGroup/SPIRV-Tools

loop peeling does not keep the cfg up-to-date.

Open
#2,237 1 comment 0 reactions 0 assignees View on GitHub
component:optimization fuzzer-found-issue
Dominant language
C++
Stars
1.4k
Forks
709
Avg merge
1d 22h
Merged PRs (30d)
28

Description

Running ./command in the attachment should reproduce the problem.

Brief summary: running spirv-opt (debug build) with arguments:

--eliminate-local-multi-store --eliminate-dead-branches --merge-return --loop-peeling

leads to the following error (numbers have been replaced with _ to avoid duplicates):

Predecessors for _ are different:
Real: _ _
Recorded: _ _ _
spirv-opt: source/opt/pass.cpp:_: spvtools::opt::Pass::Status spvtools::opt::Pass::Run(spvtools::opt::IRContext*): Assertion `ctx->IsConsistent()' failed.

SPIRV-Tools v2018.7-dev v2018.6-94-geaa351a5

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

[4662.zip](https://github.com/KhronosGroup/SPIRV-Tools/files/2689835/4662.zip)

Contributor guide

Open the contributing guide

Research direction

Run the attached ./command with a debug spirv-opt build and the listed optimization passes to reproduce the assertion. Start at the loop-peeling pass and source/opt/pass.cpp, then investigate why the CFG predecessors differ; done means the command completes without the IsConsistent() assertion.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.