Specifications

Chapter 3 Performance-Centric Compiler Switches 33
Compiler Usage Guidelines for AMD64 Platforms
32035 Rev. 3.22 November 2007
-funroll-loops. This switch causes loops, the iterations of which can be determined at compile time
or entry into the loop to be unrolled. Some loops are therefore unrolled.
This switch can be used with all three versions of the 32-bit GCC Compilers for Linux.
-Bsymbolic. GCC 4.2 no longer uses the -Bsymbolic compiler switch. Instead, GCC 4.2 now offers
the -combine -fwhole-program switch combination, which should be used together. This switch
combination requires that makefiles be changed to use a single command to compile and link all files
of an application, slowing down builds. So the -combine -fwhole-program switch combination,
should only be used for non-debug builds. Unfortunately, these options may fail when compiling
some files.
minline-all-stringops. When using the GCC 4.2.0 compiler on Red Hat Enterprise Linux 4,
experiment with the switch -minline-all-stringops. This switch is not recommended for GCC 4.2.0
on SuSE Linux Enterprise Server.
This switch can be used with all three versions of the 32-bit GCC Compilers for Linux.
Linking with ACML. The AMD Core Math Library (ACML) includes BLAS, LAPACK and FFT
routines that are optimized for AMD Athlon™ 64 and AMD Opteron™ processors. If the program
uses these routines, using ACML in place of generic C/Fortran implementation may greatly improve
the performance. For additional details on how to install this library and use it, see
http://developer.amd.com/assets/acml_userguide.pdf.
ACML can be used with all 3 versions of 32-bit GCC Compilers for Linux discussed in this
application note.
Generate 32-bit binaries with -m32. The 32-bit GCC compilers generate 32-bit binaries by
default. The user can also use 64-bit GCC compilers to generate 32-bit binaries by using the -m32
switch. Use the switches recommended in this section along with the -m32 switch.
This switch can be used with all three versions of the GCC Compilers for Linux talked about here.
SuSE GCC 4.2.0
(for C/C++ and Fortran) and
Red Hat gcc-ssa
(for C/C++ and Fortran) and
SuSE GCC 4.2.0
Step 1.Compile the program with -fprofile-arcs.
Step 2.Run the executable produced in Step 1. Running this
executable generates several files with profile
information (*.da).
Step 3.Recompile the program with -fbranch-probabilities.
FSF GCC 4.2.0
(for C/C++ and Fortran) and
Red Hat GCC 4.2.0
Step 1.Compile the program with -fprofile-generate.
Step 2.Run the executable produced in Step 1. Running this
executable generates several files with profile
information (*.da).
Step 3.Recompile the program with -fprofile-use.
Table 7. Profile Guided Optimization for 32-Bit GCC Compilers for Linux
®