Controlling optimization from the command line requires that you determine which optimizations you need for your application. You then specify those optimizations using command-line options that begin with /O (and in some cases /G).
If there is any conflict between options, the compiler uses the last option specified on the command line. The command line
CL /Oa /Ol /Ot TEST.C
compiles the program TEST.C. It specifies that the compiler can
Optimize on the assumption that you are doing no aliasing (/Oa)
Perform loop optimization (/Ol)
Perform other general speed-enhancing optimizations (/Ot)
The preceding command line can also be written
CL /Oalt TEST.C