You can solve this by having one &quot;language&quot; that can represent all intermediate stages. This has a nice side effect of allowing you to easily change the ordering of passes if that turns out to produce better results.