My professor mentioned that gcc
can be run with -flto
. I am wondering why the intermediary (GIMPLE in GCC case) are needed.
Why is the assembly not sufficient?
He mentioned that this allows the compiler to (at link time) see from what the code was generated, rather than just looking at the code itself, and generate new code if necessary.
If this is the only reason, why would this be necessary? Is the code not already optimized (under the assumption you are using -flto
correctly and passing the same flags)?