HP aC++/HP C Programmer's Guide (B3901-90036; A.06.26; September 2011)

The FLOW_DATA environment variable can be used to specify the name of the profile
data file with either the +Oprofile=collect or +Oprofile=use options.
The +Oprofile=use:filename command line option can be used to specify the name
of the profile data file when used with the +Oprofile=use option.
Example 1
In the following example, the FLOW_DATA environment variable is used to override the
flow.data file name. The profile data is stored instead in /users/profiles/
prog.data.
export FLOW_DATA=/users/profiles/prog.data
aCC -c +Oprofile=collect sample.C
aCC -o sample.exe +Oprofile=collect sample.o
sample.exe < input.file1
aCC -o sample.exe +Oprofile=use +O3 sample.C
Example 2
In this example, the +Oprofile=use:filename option is used to override the
flow.data file name with the name /users/profiles/prog.data.
aCC -c +Oprofile=collect +O3 sample.C
aCC -o sample.exe +Oprofile=collect sample.o
sample.exe < input.file1
mv flow.data /users/profile/prog.data
aCC -o sample.exe +Oprofile=use:/users/profiles/prog.data +O3 sample.C
Performing Profile-Based Optimization
To optimize the program based on the previously collected runtime profile statistics,
recompile the program as follows:
aCC -o sample.exe +Oprofile=use +O3 sample.C
For more information on profile-based optimization, refer to the HP-UX Online Linker and
Libraries User’s Guide.
Pragmas That Control Optimization
Compiler options provide a high-level, global approach to optimization. To give you
more refinement in optimization, HP aC++ provides pragma OPT_LEVEL.
See “Optimization Pragmas” (page 124) for more information.
Pragmas That Control Optimization 199