Which information does GCC collect when I enable -fprofile-generate
and which optimization does in fact uses the collected information (when setting the -
"What Every Programmer Should Know About Memory" by Ulrich Drepper https://people.freebsd.org/~lstewart/articles/cpumemory.pdf http://www.akkadia.org/drepper/cpumemory.pdf
In section 7.4
The result should run faster as it should be better at prefetching code into the processor instruction cache.
-fprofile-generate
enables -fprofile-arcs
, -fprofile-values
and -fvpt
.
-fprofile-use
enables -fbranch-probabilities
, -fvpt
, -funroll-loops
, -fpeel-loops
and -ftracer
Source: http://gcc.gnu.org/onlinedocs/gcc-4.7.2/gcc/Optimize-Options.html#Optimize-Options
PS. Information about LTO also on that page.