HP Compilers for HP Integrity Servers (September 2011)

instrumentation code to collect edge weights, data access address strides, and loop
iteration counts. When the binary is subsequently run, in addition to the profile data
collected by the instrumented code, HP Caliper samples load data cache profile
information using the performance monitor unit (PMU). All collected profile information
is written into a data file, which is used by the compiler for the subsequent
+Oprofile=use build.
New for Integrity servers, HP compilers also provide profile-based optimization using
compiler options and source code pragmas. These options and pragmas fine-tune profile
data or substitute for profile data in situations where the collection of a typical application
input might be difficult. Some sources of difficulty include:
Representative input data sets might not be readily available.
Application or system configurations representative of all customer usage profiles
might not be practical to duplicate.
The option +Ofrequently_called indicates to the compiler those functions that are
called relatively frequently. The option takes a list or a filename as an argument;
the file should contain a white-space separated list of function names. The file option
allows function name lists to be generated through an automated tool.
Similarly, +Orarely_called identifies those functions that are relatively rarely called.
Alternatively, this information can be expressed through the source code using the
FREQUENTLY_CALLED and RARELY_CALLED pragmas.
The ESTIMATED_FREQUENCY pragma is a block-scope pragma that indicates the
estimated relative execution frequency of the current block as compared with the
immediately surrounding block. This can be used to indicate the average trip count in
the body of a loop, or to indicate the fraction of time a then clause is executed. The
pragma accepts a constant argument which is the expected execution frequency or loop
count.
14 HP compilers for HP Integrity servers