Replace `--ir` output with `--ir-optimized`
- Dominant language
- C++
- Stars
- 25.7k
- Forks
- 6.2k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 29
Description
This is a different approach to the problem described in #13801.
`--ir` is the output straight from the codegen without any processing applied to it, while `--ir-optimized` is that code parsed again and then passed through `YulStack`, which may or may not apply optimizations to it, but will at the very least reformat it.
After #13972 `--ir` output is no longer the same as the unoptimized IR. The unoptimized IR has some minimal transformations applied to it to prevent "Stack too deep" errors. `--ir-optimized` is what the Yul->EVM actually runs on, and is the thing that should be given to the user.
My proposal here is to remove the current `--ir` output and then rename `--ir-optimized` to `--ir`. The same should be done in Standard JSON. The change is breaking.
Contributor guide
Research direction
Begin with the compiler's CLI handling of `--ir` and `--ir-optimized`, then trace the corresponding Standard JSON option. Confirm which path produces the YulStack-processed IR, and update both interfaces so the optimized output is exposed as `--ir`; done means the old behavior is removed consistently despite the breaking change.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, solidity
- Domain
- api, cli, compilers
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100