Skip to content

SSA-CFG: Fix stack adjustments for codegen on conditional jump#16688

Merged
blishko merged 1 commit into
developfrom
ssa-fix-stack-adjustments
May 7, 2026
Merged

SSA-CFG: Fix stack adjustments for codegen on conditional jump#16688
blishko merged 1 commit into
developfrom
ssa-fix-stack-adjustments

Conversation

@blishko

@blishko blishko commented May 7, 2026

Copy link
Copy Markdown
Contributor

When running codegen on a block which ends in a conditional jump, we save the stack before we continue with zero branch and then we restore it when come back and continue with non-zero branch. Notifying the assebly about the restored stack size is part of resetting the state and needs to happen before we attempt any stack shuffling. prepareBlockExitStack might shuffle the stack and so assembly notification must happen before that.

@blishko blishko requested a review from clonker May 7, 2026 15:15
@blishko blishko enabled auto-merge May 7, 2026 15:38
When running codegen on a block which ends in a conditional jump, we
save the stack before we continue with zero branch and then we restore
it when come back and continue with non-zero branch.
Notifying the assebly about the restored stack size is part of resetting
the state and needs to happen before we attempt any stack shuffling.
`prepareBlockExitStack` might shuffle the stack and so assembly
notification must happen before that.
@blishko blishko force-pushed the ssa-fix-stack-adjustments branch from a74e6a0 to 7da228d Compare May 7, 2026 15:46
@blishko blishko merged commit 23182d6 into develop May 7, 2026
77 of 82 checks passed
@blishko blishko deleted the ssa-fix-stack-adjustments branch May 7, 2026 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants