Remove wrongly placed optimization in codegen.