Overview of Venom compiler passes
masterThe Venom compiler uses a pluggable architecture of passes to transform and optimize IR. The primary categories are:
- Transformation passes: Modify the IR structure (e.g.,
Normalization,Dataflow Transformation). - Analysis/augmentation passes: Generate supplementary information (e.g.,
Control Flow Graph (CFG) calculation,Data Flow Graph (DFG) calculation,Liveness analysis). - Optimization passes: Improve code efficiency (e.g.,
Dead code elimination).
Critical Pass Requirements:
- Normalization: Essential for code emission. The code emitter requires the IR to be in a 'normalized' form where basic blocks do not have multiple inputs and outputs, ensuring a well-defined stack layout.
- Execution Order: Some passes depend on others. For example, the code emitter requires a normalization pass, which in turn requires the IR to be augmented with code flow information.