Add effect analysis and optimization calls to codegen.