vtil::optimizer
The optimizer namespace exposes composable pass interfaces and convenience pipelines like apply_all and apply_all_profiled.
Apply all passes
#include <vtil/compiler>
vtil::optimizer::apply_all(rtn);Profiled pipeline
#include <vtil/compiler>
vtil::optimizer::apply_all_profiled(rtn);Individual passes
| Pass | Description |
|---|---|
dead_code_elimination_pass | Remove writes with no live uses |
mov_propagation_pass | Forward register values and simplify copies |
stack_propagation_pass | Resolve stack-relative memory |
register_renaming_pass | Rename temporaries for clarity |
symbolic_rewrite_pass<true> | Apply symbolic simplifications across IL expressions |
branch_correction_pass | Repair/normalize branch forms after rewrites |
Composing passes
using namespace vtil::optimizer;
apply_each<
dead_code_elimination_pass,
mov_propagation_pass,
stack_propagation_pass
>{}(rtn);Transformation diff
Inspect each transformation stage and switch between passes to see line-level changes.
Initial state - before any optimization pass
Before optimization
1block->mov(t0, 1);2block->mov(t1, t0);3block->str(REG_SP, 0, t1);4block->vexit(0);