Slide 48 of 67
Notes:
Now let’s return to discussion of the C compiler and the C compiler optimization levels. We can run the C compiler without any extra optimization at all, or we can request one of several optimization levels. These various levels optimize the code to make the program run faster.
Level 0 is primarily a C language improvement. It performs control-flow graph simplification and also allocates variables to registers. Rather than take a variable, make up a name, and place it in a memory location, the compiler assigns it to a register because it's accessed a lot. This improves performance.
Level 0 optimization also performs loop rotation, eliminates code that's not used or not accessed, and simplifies expressions and statements, resulting in fewer binary operations and fewer instructions.