KhronosGroup / KhronosGroup/SPIRV-Tools

reduce: StructuredLoopToSelectionReductionOpportunity should handle loops with a continue target that is also the merge of an inner construct

Open
#2,400 0 comments 0 reactions 0 assignees View on GitHub
component:reducer
Dominant language
C++
Stars
1.4k
Forks
709
Avg merge
1d 22h
Merged PRs (30d)
28

Description

`StructuredLoopToSelectionReductionOpportunity` simplifies loops to selections, but it will give up conservatively if the continue target of the loop happens to also be a merge block of some other construct. E.g.

```
Loop header
Select header
Select merge / Loop continue target <-- we give up if we see this

Loop merge
```

We should handle this.

Contributor guide

Open the contributing guide

Research direction

Locate StructuredLoopToSelectionReductionOpportunity and trace the conservative check for a loop continue target that is also an inner construct's merge block. Reproduce the Loop header, Select header, and shared Select merge scenario described in the issue; done means the loop is reduced to a selection instead of being abandoned.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.