Skip to content

SSA: Remove some shuffler logic#16600

Open
blishko wants to merge 1 commit intodevelopfrom
ssa-remove-more-shuffler-logic
Open

SSA: Remove some shuffler logic#16600
blishko wants to merge 1 commit intodevelopfrom
ssa-remove-more-shuffler-logic

Conversation

@blishko
Copy link
Copy Markdown
Contributor

@blishko blishko commented Apr 15, 2026

This piece of logic was swapping top to the tail region if case the top is not in its right place and it wants to be in tail anyway.

I don't have an explanation why this is useful, but it seems to improve code generation on most external benchmarks.

This piece of logic was swapping top to the tail region if case the top
is not in its right place and it wants to be in tail anyway.

I don't have an explanation why this is useful, but it seems to improve
code generation on most external benchmarks.
Comment on lines -188 to +189
// gas ssaCFGOptimized: 809663
// gas ssaCFGOptimized code: 570000
// gas ssaCFGOptimized: 809711
// gas ssaCFGOptimized code: 570600
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is a small regression, but it is the only one on external contracts.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

regression by 0.0059% for runtime and by 0.105% for deploy.. i think it's fine..

// gas legacy: 4234020
// gas legacyOptimized: 2318668
// gas ssaCFGOptimized: 1882355
// gas ssaCFGOptimized: 1841235
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is actually a 2% improvement.

Comment on lines -11 to +12
// SWAP3| * | lit2 v2 v0
// POP| v0 | lit2 v2
// DUP3| v0 | lit2 v2 v0
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is a bit unfortunate, I would like to fix this somehow.

@blishko blishko requested a review from clonker April 15, 2026 13:23
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