A very clear example on when different type of optimizations are used is in the embedded world. Optimizations for size instead of speed are extremely common there. When you're extremely tight on resources, you just can't trust the compiler to know better than you, you have to try different optimization strategies to see what have the best size/speed combination for you.