Documentation of optimization flags/levels


I have tried to find documentation about the optimization flags available in the current version of clang (ToT) without much success (both in the webpage, the manual, and google). Google always points me to: but I see no information there regarding optimization levels/flags (only for the visual studio emulation).

Does anyone have a link to this documentation?

I’m particularly interested in:

  • which optimization flags are there and a description of what they do (e.g. -ffast-math),
  • which optimization levels are there (e.g. O2) and which flags does each level enable,
  • which potentially-useful llvm optimization options are there (e.g. -mllvm -inline-threshold=value) and a link to the llvm docs that describe them.

Gonzalo BG