Generating EVM Bytecode from Yul in the new via IR Pipeline
summary
New via‑IR pipeline converts Yul to EVM by building a control‑flow graph, algorithmically assigning full stack layouts per block and operation, then emitting opcodes while maintaining a symbolic stack validation to guarantee correctness. The transform removes many redundant DUP/SWAP sequences, yields a few percent gas reduction and smaller code size, and reduces stack‑too‑deep errors to almost none (exceptions: inline assembly and recursion). It cooperates with the Yul optimizer to spill variables to memory and creates new debugger tooling requirements. CFG→annotated stack layouts→opcodes
AI-written summary · about
chapters (9)
- 0:00Compiler internals overview
- 3:53Goals of code transformation
- 5:13Three-step architecture
- 6:52Control flow graph generation
- 8:46Algorithmic stack layout
- 12:28Bytecode generation and safety
- 15:25Debugging and tooling
- 17:01Results and performance
- 18:40Q&A on compiler optimization
related talks
30mHow to solve stack too deep errors: a Yul to EVM pipeline
16m`via IR` speedrun
28mSSA CFG Yul A new viaIR backend
23mSynthesizing Efficient Super-Instruction Sets for Ethereum Virtual Machine
11mUsing Pyrope To Create Transformable RISC V Architectures
33mRuby the Hard Way: Writing Bytecode to Optimize Plain Ruby
40mCompiling Ruby
11mFormally Verifying YUL Level Static Analyses and Optimization with Coq
