-qhot

Purpose

Performs high-order loop analysis and transformations (HOT) during optimization.

The -qhot compiler option is a powerful alternative to hand tuning that provides opportunities to optimize loops and array language. This compiler option will always attempt to optimize loops, regardless of the suboptions you specify.

Syntax

Read syntax diagramSkip visual syntax diagram
        .-nohot---------------------------------------.   
>>- -q--+-hot--+------------------------------------+-+--------><
               |    .- :--------------------------. |     
               |    V                             | |     
               '-=----+-noarraypad--------------+-+-'     
                      +-arraypad--+-----------+-+         
                      |           '-=--number-' |         
                      |           .-1-.         |         
                      +-level--=--+-0-+---------+         
                      +-vector------------------+         
                      +-novector----------------+         
                      +-fastmath----------------+         
                      '-nofastmath--------------'         

Defaults

  • -qnohot
  • -qhot=noarraypad:level=0:novector:fastmath when -O3 is in effect.
  • -qhot=noarraypad:level=1:vector:fastmath when -qsmp, -O4 or -O5 is in effect.
  • Specifying -qhot without suboptions is equivalent to -qhot=noarraypad:level=1:vector:fastmath.

Parameters

arraypad (option only) | noarraypad (option only)
Permits the compiler to increase the dimensions of arrays where doing so might improve the efficiency of array-processing loops. (Because of the implementation of the cache architecture, array dimensions that are powers of two can lead to decreased cache utilization.) Specifying -qhot=arraypad when your source includes large arrays with dimensions that are powers of 2 can reduce cache misses and page faults that slow your array processing programs. This can be particularly effective when the first dimension is a power of 2. If you use this suboption with no number, the compiler will pad any arrays where it infers there may be a benefit and will pad by whatever amount it chooses. Not all arrays will necessarily be padded, and different arrays may be padded by different amounts. If you specify a number, the compiler will pad every array in the code.
Note: Using arraypad can be unsafe, as it does not perform any checking for reshaping or equivalences that may cause the code to break if padding takes place.
number (option only)
A positive integer value representing the number of elements by which each array will be padded in the source. The pad amount must be a positive integer value. To achieve more efficient cache utilization, it is recommended that pad values be multiples of the largest array element size, typically 4, 8, or 16.
level=0 (option only)
Performs a subset of the high-order transformations and sets the default to novector:noarraypad:fastmath.
level=1 (option only)
Performs the default set of high-order transformations.
level=2 (option only)
Performs the default set of high-order transformations and some more aggressive loop transformations. -qhot=level=2 must be used with -qsmp. This option performs aggressive loop analysis and transformations to improve cache reuse and exploit loop parallelization opportunities.
vector (option only) | novector
When specified with -qnostrict and -qignerrno, or an optimization level of -O3 or higher, vector causes the compiler to convert certain operations that are performed in a loop on successive elements of an array (for example, square root, reciprocal square root) into a call to a routine in the Mathematical Acceleration Subsystem (MASS) library in libxlopt.

The vector suboption supports single-precision and double-precision floating-point mathematics, and is useful for applications with significant mathematical processing demands.

novector disables the conversion of loop array operations into calls to MASS library routines.

Because vectorization can affect the precision of your program results, if you are using -O3 or higher, you should specify -qhot=novector if the change in precision is unacceptable to you.

fastmath (option only) | nofastmath (option only)
You can use this suboption to tune your application to either use fast scalar versions of math functions or use the default versions.

For C/C++, you must use this suboption together with -qignerrno, unless -qignerrno is already enabled by other options.

-qhot=fastmath enables the replacement of math routines with available math routines from the XLOPT library only if -qstrict=nolibrary is enabled.

-qhot=nofastmath disables the replacement of math routines by the XLOPT library. -qhot=fastmath is enabled by default if -qhot is specified regardless of the hot level.

Usage

If you do not also specify an optimization level when specifying -qhot on the command line, the compiler assumes -O2.

If you want to override the default level setting of 1 when using -qsmp, -O4 or -O5, be sure to specify -qhot=level=0 or -qhot=level=2 after the other options.

You can use the -qreport option in conjunction with -qhot or any optimization option that implies -qhot to produce a pseudo-C report showing how the loops were transformed. The loop transformations are included in the listing report if either the -qreport or -qlistfmt option is also specified. This LOOP TRANSFORMATION SECTION of the listing file also contains information about data prefetch insertion locations. In addition, when you use -qprefetch=assistthread to generate prefetching assist threads, a message Assist thread for data prefetching was generated also appears in the LOOP TRANSFORMATION SECTION of the listing file. Specifying -qprefetch=assistthread guides the compiler to generate aggressive data prefetching at optimization level -O3 -qhot or higher. For more information, see -qreport.

Predefined macros

None.



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