| -bmaxdata |
By default, 32-bit executables only access one segment, or 256 MB,
of memory. By linking with "-bmaxdata", you can increase
this range up to eight segments, or 2 GB. Specifying
"0x80000000" allows the full 2 GB range.
This option does
not specify the size of memory the executable actually uses,
but the maximum amount it could possibly use. |
The following options provide a high level of optimization for C and
C++ that is also safe.
cc -g -O3 -qmaxmem=-1 -qstrict ...
The "-g" tells the compiler to include information in the
executable to allow effective debugging. It doesn't inhibit
optimization at all, so we advise that you always include it.
The "-qmaxmem=-1" allows the compiler to use more memory
for space-intensive optimizations. (It has nothing to do with the
amount of memory used by the executable.)
Be removing the "-qstrict", you can allow for higher
optimization, but the order of arithmetic operations may be
changed. This can lead to mathematically equivalent but numerically
different results.
For potentially higher performance for C++ codes, you can turn on
inlining using "-Q".
xlC -g -O3 -qmaxmem=-1 -qstrict -Q ...
For potentially higher performance for C codes, you may want to experiment
with higher levels of optimization. The following options provide
"high-order transformations", which help optimize loops. These options
are not available for C++.
cc -g -O4 -qnoipa -qmaxmem=-1 -qstrict ...
Again, you can leave off the "-qstrict" if you want to allow
the order of arithmetic operations to change. The "-O4"
option includes inter-procedural analysis (IPA), and we recommend
turning it off using "-qnoipa". For typical computational
codes, we have found that IPA
increases compile time dramatically without significantly increasing
performance.
If you want to experiment with IPA, you could try the
following. Again, these options are not available for C++.
cc -g -O5 -qmaxmem=-1 ...
The only difference between "-O4" and "-O5" is the
level of IPA; "-O5" uses the highest (and most time
consuming) level.
For more information on compiler options, see "man
cc". Full documentation on Visual Age C++, the product that
includes the IBM C and C++ compilers, is available at the following
URL in PDF form.
For details about the command-line compilers described here, download Batch
Compiler and Other Tools from the above page.
For more information on performance optimization and
parallelization, see the following IBM Redbooks, available online.