-mtune (-qtune)

Pragma equivalent

None.

Purpose

Tunes instruction selection, scheduling, and other architecture-dependent performance enhancements to run best on a specific hardware architecture. Allows specification of a target SMT mode to direct optimizations for best performance in that mode.

Syntax

Read syntax diagramSkip visual syntax diagram
                 .-power8-.   
                 +-pwr8---+   
>>- -m--tune--=--+-pwr9---+------------------------------------><
                 '-power9-'   

Read syntax diagramSkip visual syntax diagram
                 .-balanced-.                        
>>- -q--tune--=--+-pwr8-----+--+-----------------+-------------><
                 +-pwr9-----+  |    .-st-------. |   
                 '-auto-----'  '-:--+-balanced-+-'   
                                    +-smt2-----+     
                                    +-smt4-----+     
                                    '-smt8-----'     

Defaults

-mtune=pwr8 or -mtune=power8

-qtune=balanced:balanced when no valid -qarch setting is in effect. Otherwise, the default depends on the effective -qarch setting. You can find details in Acceptable -qarch and -qtune combinations.

Parameters for CPU suboptions

The following CPU suboptions allow you to specify a particular architecture for the compiler to target for best performance:

auto
Optimizations are tuned for the platform on which the application is compiled. You can specify the auto suboption with -qtune only.
balanced
Optimizations are tuned across a selected range of recent hardware. You can specify the balanced suboption with -qtune only.
power8
Optimizations are tuned for the POWER8® hardware platform. You can specify this suboption with -mtune only.
power9
Optimizations are tuned to utilize the POWER9™ technology. You can specify this suboption with -mtune only.
pwr8
Optimizations are tuned for the POWER8 hardware platform.
pwr9
Optimizations are tuned to utilize the POWER9 technology.

Parameters for SMT suboptions

The following simultaneous multithreading (SMT) suboptions allow you to optionally specify an execution mode for the compiler to target for best performance. You can specify these SMT suboptions with -qtune only.

balanced
Optimizations are tuned for performance across various SMT modes for a selected range of recent hardware.
st
Optimizations are tuned for single-threaded execution.
smt2
Optimizations are tuned for SMT2 execution mode (two threads).
smt4
Optimizations are tuned for SMT4 execution mode (four threads).
smt8
Optimizations are tuned for SMT8 execution mode (eight threads).

Usage

By arranging (scheduling) the generated machine instructions to take maximum advantage of hardware features such as cache size and pipelining, -mtune or -qtune can improve performance. It only has an effect when used in combination with options that enable optimization.

Although changing the -mtune or -qtune setting may affect the performance of the resulting executable, it has no effect on whether the executable can be executed correctly on a particular hardware platform.

You can find the acceptable combinations of -qarch and -qtune in the following table.
Table 1. Acceptable -qarch and -qtune combinations
-qarch option Default -qtune setting Available -qtune CPU settings Available -qtune SMT settings
pwr8 pwr8:st auto | pwr8 | pwr9 | balanced balanced | st | smt2 | smt4 | smt8
pwr9 pwr9:st auto | pwr9 | balanced balanced | st | smt2 | smt4 | smt8

Predefined macros

None.

Examples

The executable program testing is compiled from myprogram.c. To specify testing is to be optimized for a POWER8 hardware platform, enter:
xlc -o testing myprogram.c -mtune=pwr8
The executable program testing is compiled from myprogram.c. To specify testing is to be optimized for a POWER8 hardware platform and configured for the SMT4 mode, enter:
xlc -o testing myprogram.c -qtune=pwr8:smt4


Voice your opinion on getting help information Ask IBM compiler experts a technical question in the IBM XL compilers forum Reach out to us