argotorg / argotorg/solidity

Discussion on redesigning the constant optimizer

Open
#16,814 4 comments 0 reactions 0 assignees View on GitHub
high effort high impact optimizer
Dominant language
C++
Stars
25.7k
Forks
6.2k
Avg merge
2d 19h
Merged PRs (30d)
29

Description

We want consolidate discussion about constant optimizer, collect proposals for re-design and pick the best solution.

Currently, there are two constant optimizers, one lives at the [Yul level](https://github.com/ethereum/solidity/blob/develop/libyul/backends/evm/ConstantOptimiser.h), one at the [evmasm level](https://github.com/ethereum/solidity/blob/develop/libevmasm/ConstantOptimiser.h).
They are similar, but not the same. Differences are analyzed [here](https://notes.argot.org/s/@solidity-constant-optimizer-yul-vs-evmasm).

There have been a few attempts to modify the constant optimizations recently:
- https://github.com/argotorg/solidity/pull/15935
- https://github.com/argotorg/solidity/pull/16729
- https://github.com/argotorg/solidity/pull/16738
- https://github.com/argotorg/solidity/pull/16788

Contributor guide

Open the contributing guide

Research direction

Start by comparing libyul/backends/evm/ConstantOptimiser.h with libevmasm/ConstantOptimiser.h and read the linked analysis of their differences. Review the listed pull requests to understand prior proposals. Done means reaching agreement on a redesign direction, rather than implementing a specifically scoped change.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.