Phase order optimization in compilers