As part of the XL compiler optimization suite, the HOT transformations focus specifically on loops which typically account for the majority of the execution time for most applications. HOT transformations perform in-depth loop analysis to minimize their execution time. Loop optimization analysis includes:
The goals of these optimizations include:
Compiling with -O3 and higher triggers HOT transformations by default. You can also see performance benefits by specifying -qhot with -O2, or adding more -qhot optimizations than the default level=0 at -O3.
You can see particular -qhot benefits if your application contains Fortran 90-style array language constructs, as HOT transformations include elimination of intermediate temporary variables and statement fusion.
You can also use directives to assist in loop analysis. Assertive directives such as INDEPENDENT or CNCALL allow you to describe important loop characteristics or behaviors that HOT transformations can exploit. Prescriptive directives such as UNROLL or PREFETCH allow you to direct the HOT transformations on a loop-by-loop basis. You can also specify the -qreport compiler option to generate information about loop transformations. The report can assist you in deciding where best to include directives to improve the performance of your application.
In addition to general loop transformation, -qhot supports suboptions that you can specify to enable additional transformations detailed in this section.
When targeting a PowerPC processor that supports Vector Multimedia Extension (VMX) , specifying -qhot=simd allows the optimizer to transform code into VMX instructions when you are compiling with -qenablevmx. These machine instructions can execute up to sixteen operations in parallel. The most common opportunity for this transformation is with loops that iterate over contiguous array data, performing calculations on each element. You can use the NOSIMD directive to prevent the transformation of a particular loop.
When you specify any of the following:
you enable -qhot=vector by default. Specifying -qnostrict with optimizations other than -O4 and -O5 ensures that the compiler looks for long vectorization opportunities. This can optimize loops in source code for operations on array data by ensuring that operations run in parallel where applicable. The compiler uses standard machine registers for these transformations and does not restrict vector data size; supporting both single- and double-precision floating-point vectorization. Often, HOT vectorization involves transformations of loop calculations into calls to specialized mathematical routines supplied with the compiler such as the Mathematical Acceleration Subsystem (MASS) libraries. These mathematical routines use algorithms that calculate results more efficiently than executing the original loop code.
For more information on optimization levels like -O4 and the other compiler options they imply, see Advanced command-line optimization.
An array dimension that is a power of two can lead to a decrease in cache utilization. The -qhot=arraypad suboption allows the compiler to increase the dimensions of arrays where doing so could improve the efficiency of array-processing loops. Using this suboption can reduce cache misses and page faults that slow your array processing programs. The HOT transformations will not necessarily pad all arrays, and can pad different arrays by different amounts in order to gain performance. You can specify a padding factor to apply to all arrays. This value is typically a multiple of the largest array element size. Pad arrays with discretion as array padding uses more memory and the performance trade-off does not benefit all applications. Also, these HOT transformations do not include checks for array data overlay, as with Fortran EQUIVALENCE, or array shaping operations.