argotorg / argotorg/solidity

Improve documentation on Yul standard cleanup sequence

Open
#13,817 6 comments 0 reactions 0 assignees View on GitHub
documentation :book: low effort low impact must have eventually
Dominant language
C++
Stars
25.7k
Forks
6.2k
Avg merge
2d 19h
Merged PRs (30d)
29

Description

This issue is based on a Twitter discussion with @leonardoalt. IMHO it would be very valuable to document what sequence is run if `optimizerSteps = ''` is set. Based on my analysis [here](https://twitter.com/pcaversaccio/status/1604192588352798723), the default Yul cleanup sequence is (which is only documented in the source code currently):
- BlockFlattener (`f`)
- DeadCodeEliminator (`D`)
- ControlFlowSimplifier (`n`)
- LiteralRematerialiser (`T`)
- ForLoopConditionOutOfBody (`O`)
- CommonSubexpressionEliminator (`c`)

But further things are actually run (see [here](https://twitter.com/leonardoalt/status/1604214614853668865)). There is further information as pointed out by @leonardoalt [here](https://twitter.com/leonardoalt/status/1604258182360186880), but still not clear what exactly is run in the case `optimizerSteps = ''`. Having a small section on this topic that clarifies everything would be highly valuable since the optimiser itself & its optimiser steps are already extremely complex.

Contributor guide

Open the contributing guide

Research direction

The issue points to the optimizer source code and linked Twitter analyses; start by tracing the Yul cleanup sequence used when optimizerSteps = ''. Document the complete sequence, including the steps beyond the listed six, in a small documentation section, and verify that it matches the implementation.

Written by the indexing model from the issue text.

Assessment

Tech stack
solidity
Domain
compilers, documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.