1

what is compiler feedback(not linker feedback) based optimization? How to get this feedback file for arm gcc compiler?

Aptrij
  • 11
  • 5

1 Answers1

1

Read the chapter of the GCC documentation dedicated to optimizations (and also the section about ARM in GCC: ARM options)

You can use:

  • link-time optimization (LTO) by compiling and linking with -flto in addition of other optimization flags (so make CC='gcc -flto -O2'): the linking phase also do optimizations (so the compiler is linking files containing not only object code, but also intermediate GIMPLE internal compiler representation)
  • profile-guided optimization (PGO, with -fprofile-generate, -fprofile-use, -fauto-profile etc...): you first generate code with profiling instructions, you run some representative benchmarks to get profiling information, and you compile a second time using these profiling information.

You could mix both approaches and give a lot of other optimization flags. Be sure to be consistent with them.

On x86 & x86-64 (and ARM natively) you might also use -mtune=native and there are lots of other -mtune possibilities.

Some people call profile-based optimization compiler feedback optimization (because dynamic runtime profile information is given back into the compiler). I prefer the "profile-guided optimization" term. See also this old question.

Community
  • 1
  • 1
Basile Starynkevitch
  • 223,805
  • 18
  • 296
  • 547