IBM Power7 Optimization And Tuning Manual page 25

Table of Contents

Advertisement

Target processor chip tuning options: The XL compiler -qtune option specifies that the
code produced must be tuned to run optimally on particular processor chips. The
executable that is produced still runs on other processor chips, but might not be tuned for
them. Some of the possible options to consider are:
– -qarch=ppc64 -qtune=pwr7 for an executable that is optimized to run on POWER7, but
that can run on all 64-bit implementations of the Power Architecture (POWER7,
POWER6, POWER5, and so on)
– -qtune=balanced for an executable that must run well across both POWER6 and IBM
POWER7 Systems™
– -mtune=power7 to tune for POWER7 on GCC
Strict options: Sometimes the compilers can produce faster code by subtly altering the
semantics of the original source code. An example of this scenario is expression
reorganization. Especially for floating point code, the effect of expression reorganization
can produce different results. For some applications, these optimizations must be
prevented to achieve valid results. For the XL compilers, certain semantic-altering
transformations are allowed by default at higher optimization levels, such as -O3, but those
transformations can be disabled by using the -qstrict option (for example, -O3
-qstrict). For GCC, the default is strict mode, but you can use -ffast-math to enable
optimizations that are not concerned with Not a Number (NaN), signed zeros, infinities,
floating point expression reorganization, or setting the errno variable. The new -Ofast
GCC option includes -O3 and -ffast-math, and might include other options in the future.
Source code compatibility options: The XL compilers assume that the C and C++ source
code conforms to language rules for aliasing. On occasion, older source code fails when
compiled with optimization, because the code violates the language rules. A workaround
for this situation is to use the -qalias=noansi option. The GCC workaround is the
-fno-strict-aliasing option.
Profile Directed Feedback (PDF): PDF is an advanced optimization feature of the
compilers that you should consider for performance critical applications.
Interprocedural Analysis (IPA): IPA is an advanced optimization feature of the compilers
that you should consider for performance critical applications.
Compiler options: Compiler options do not change for POWER7+.
A simple way to experiment with the C, C++, and Fortran compilation options is to repeatedly
build an application with different option combinations, and then to run it and measure
performance to see the effect. If higher optimization levels produce invalid results, try adding
one or both of the -qstrict and -qalias options with the XL compilers, or
-fno-strict-aliasing with GCC.
Not all source files must be compiled with the same set of options, but
compiled at the minimum optimization level. There are cases where optimization was not
used on just one or two important source files, and that caused an application to suffer from
reduced performance.
Chapter 1. Optimization and tuning on IBM POWER7 and IBM POWER7+
all
files must be
9

Advertisement

Table of Contents
loading

This manual is also suitable for:

Power7+

Table of Contents