HP aC++/HP C Programmer's Guide (B3901-90036; A.06.26; September 2011)
NOTE: This option will be ignored if it is placed in a loop other than the innermost
loop.
Profile-Based Optimization Options
Profile-based optimization is a set of performance-improving code transformations based
on the runtime characteristics of your application.
+Oprofile
+Oprofile=[use|collect]
The +Oprofile option instructs the compiler to instrument the object code for collecting
runtime profile data. The profiling information can then be used by the linker to perform
profile-based optimization. When an application finishes execution, it will write profile
data to the fileflow.data or to the file/path in the environment variable FLOW_DATA
(if set).
+Oprofile=use[:filename] causes the compiler to look for a profile database file.
If a filename is not specified, the compiler will look for a file named "flow.data" or the
file/path specified in the FLOW_DATA environment variable. If a filename is specified,
it overrides the FLOW_DATA environment variable.
After compiling and linking with +Oprofile=collect, run the resultant program using
representative input data to collect execution profile data. Profile data is stored in
flow.data by default. The name is generated as flow.<suffix> if there is already
a flow.datafile present in the current directory. Finally, recompile with the
+Oprofile=use option (passing it the appropriate filename if necessary) to perform
profile-based optimization.
Example:
aCC +Oprofile=collect -O -o prog.pbo prog.C
The above command compiles prog.C with optimization, prepares the object code for
data collection, and creates the executable file prog.pbo. Running prog.pbo collects
runtime information in the file flow.data in preparation for optimization with
+Oprofile=use.
+Oprofile=collect [:<qualifiers>]
<qualifiers> are a comma-separated list of profile collection qualifiers.
Supported profile collection qualifiers:
arc Enables collection of arc counts.
dcache Enables collection of data cache misses.
stride Enables collection of stride data.
loopiter Enables collection of loop iteration counts..
78 Command-Line Options