Specifications

Chapter 3 Performance-Centric Compiler Switches 39
Compiler Usage Guidelines for AMD64 Platforms
32035 Rev. 3.22 November 2007
3.13.3 Other Switches
In addition to the generic switches, the following switches may improve the performance of the
program. It is worth experimenting with these switches.
Use the -xO[1|2|3|4|5] switch to enable various levels of general optimization algorithms. Usually
using a higher number results in faster execution, but in some cases -xO2 or -xO3 may be faster than
-xO4 or -xO5.
Note: The -fast switch implies the -O5 switch.
The -xprofile=collect:[name] and -xprofile=use:[name] flags enable profile guided optimization.
The flags must be specified both when compiling and linking. After compiling with the
-xprofile=collect:[name] flag, run the program on a typical dataset. Then compile with
-xprofile=use:[name] to utilize the resulting profile data to tune the program.
The -xcrossfile flag enables optimization across all source files. This flag must be combined with
-xO4 or -xO5 to be effective.
Note: The -fast switch implies the -xO5 switch.
Additional performance improvements can be gained in floating point programs using the
-fsimple[=n] switch. The -fsimple=2 switch enables aggressive floating point optimizations, but
sacrifices numeric accuracy. This flag is implied by -fast.