HP Compilers for HP Integrity Servers (September 2011)

compiler and handles many additional cases; the +Oinfo option can be used to
determine whether this optimization has been performed.
Although full interprocedural optimizations are only available in the presence of -ipo
or +O4, the compiler performs “lightweight” interprocedural optimization at +O2 and
above. This phase can improve performance of applications with frequent use of static
variables and functions. Lightweight IPO enables the following optimizations:
Dead function elimination for static routines.
Dead variable elimination for static variables.
Address exposure analysis for static variables.
The interprocedural analysis phase is also able to expose and warn on additional source
problems, for example, for variables that are declared with incompatible attributes in
different source files.
The HP compilers deliver many high-level math functions as high-performance
implementations in intermediate form (as IELF object files), allowing the compiler to inline
these functions. This results in the usual benefits gained from inlining, such as avoidance
of call overhead or broadening of scope, and can help the instruction scheduler hide
load and store latencies.
The high level loop optimizer has been significantly improved, and performs the following
classic loop optimizations based on array access patterns (the loop optimizer is enabled
at optimization levels two (+O2) and higher):
Loop interchange
Loop distribution
Loop fusion
Loop unrolling
Loop unswitching
Loop cloning
Parallelization
Loop blocking
Loop unroll-and-jam
Scalar replacement
Recognition of memset/memcpy type loops
Loop rerolling
These optimizations are designed to improve locality of array access, improving the
utilization of the data cache. Parallelization distributes the work of a loop body among
available processors.
18 HP compilers for HP Integrity servers