Specifications
30 Performance-Centric Compiler Switches Chapter 3
32035 Rev. 3.22 November 2007
Compiler Usage Guidelines for AMD64 Platforms
-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.
The -xipo=2 flag enable interprocedural optimization (this option is preferred over -xcrossfile, which
was pre-ipo).
The -xprefetch and -xprefetch_level=1,2,3. causes prefetch with various metric triggers
-xalias_level, which communicates that a given program is known to adhere to certain aliasing
restrictions -xvector=simd,lib which causes generation of SIMD instructions for chips that support
SIMD(all, for Opteron).
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 flag enables aggressive floating point optimizations, but
sacrifices numeric accuracy. This flag is implied by -fast.
3.8 GCC Compilers (32-Bit) for Linux®
The 32-bit GNU Compiler Collection (GCC) compilers can be installed and run on 32-bit Linux and
64-bit Linux on AMD Athlon™ 64 and AMD Opteron™ processors. The GCC compilers come in a
number of different varieties. This section discusses the following different GCC compilers:
• gcc 4.2.0 from Free Software Foundation (FSF)
• gcc 4.2.0 compiler from SuSE Linux Enterprise Server 10
• gcc 4.2.0 compiler from SuSE Linux 10.1
3.8.1 Recommended Compiler Versions
The Linux distributions from SuSE and Red Hat include a default 32-bit GCC compiler and optional
compilers. From a performance standpoint, the optional compilers are recommended. Table 5 shows
the recommended (optional) compiler versions for the current SuSE and Red Hat distributions.
Table 5. GCC Versions Included with Linux
®
Distributions
Linux® Distribution Default GCC
Compiler Version
Recommended (Optional) Compiler Version
Red Hat Enterprise
Linux
®
3
3.2 gcc-ssa
SuSE Linux Enterprise
Server 10
4.1 gcc 4.2.0