Skip to content

SSA: Strengthen shuffler requirements#16602

Merged
blishko merged 2 commits intodevelopfrom
ssa-strengthen-shuffler-requirements
Apr 20, 2026
Merged

SSA: Strengthen shuffler requirements#16602
blishko merged 2 commits intodevelopfrom
ssa-strengthen-shuffler-requirements

Conversation

@blishko
Copy link
Copy Markdown
Contributor

@blishko blishko commented Apr 15, 2026

First, we use ranges::contains to make the code a bit more concise.
Afterwards, we strengthen the requirements on what task can be passed to a shuffler.

Without this requirement, I was able to create a test case on which the shuffler was looping.
However, in that case, I was requiring that a literal (not present in the input stack) must be present in the tail (the liveness data). Then I realized that such a case should actually not be allowed. If a value can be freely generated, we should not track it in the liveness data.
Note that this might need to change for the values spilled into memory.

For context, this is a test example that would currently loop, but would be rejected with the proposed change:

initial: [v1, v3, v2]
targetStackTop: [v2, v3]
targetStackTailSet: {v1, lit0}
targetStackSize: 4

Copy link
Copy Markdown
Member

@clonker clonker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the stack spilling will use a different mechanism from canBeFreelyGenerated so this is fine!

@blishko blishko merged commit 3f0569c into develop Apr 20, 2026
82 of 83 checks passed
@blishko blishko deleted the ssa-strengthen-shuffler-requirements branch April 20, 2026 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants