Skip to content

SSA CFG: assert that a spill mload saw a store on every path leading up to it - #17220

Merged
clonker merged 1 commit into
developfrom
ssa-cfg-assert-stores-dominate-loads
Nov 13, 2026
Merged

clonker merged 1 commit into
developfrom
ssa-cfg-assert-stores-dominate-loads

Conversation

@clonker

@clonker clonker commented Nov 13, 2026

Copy link
Copy Markdown
Member

@blishko blishko left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks reasonable to me, I just have one question.

m_spillEmitter && m_spillEmitter->hasAddress(_op.slot),
fmt::format("Tried storing variable {} without a spill slot", _op.slot)
);
m_stores.emplace(_op.slot, _block);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should we check that it was not in m_stores already?
Do we have an invariant that there is at most one store for each slot?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I deliberately didn't assert anything in that regard because we may want to actually have more than one store in the future. Right now we spill right after the definition site but that is not always optimal.

@clonker
clonker merged commit 6b98a66 into develop Nov 13, 2026
83 checks passed
@clonker
clonker deleted the ssa-cfg-assert-stores-dominate-loads branch November 13, 2026 16:38
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.

SSA CFG: Invalid spilling order when instructions have the same definition stac

2 participants