A function order list is text that specifies the order in which the linker should link the non-static functions of your program. This improves the performance of your program by reducing paging and improving code locality. Profile-guided optimizations support the generation of a function order list to be used by the linker. The compiler determines the order using profile information.
To generate a function order list, use the profmerge and proforder utilities.
Use the following guidelines to create a function order list:
The order list only affects the order of non-static functions.
You must compile with /Gy to enable function-level linking. (This option is active if you specify either option /O1 or /O2.)
The Intel® compiler provides two methods of optimizing the layout of functions in the executable:
Using a function order list
Using the -ipo (Linux*) or /Qipo (Windows*) compiler option
Each method has its advantages. A function order list, created with proforder, lets you optimize the layout of non-static functions; that is, external and library functions whose names are exposed to the linker.
The compiler cannot affect the layout order for functions it does not compile, such as library functions. The function layout optimization is performed automatically when IPO is active.
Function Type |
Code Layout
|
Function
|
---|---|---|
Static |
X |
No effect |
Extern |
X |
X |
Library |
No effect |
X |
This section describes the general process used to generate a function order list using both the profmerge and proforder utilities. Assume you have a Fortran program that consists of the following files:
file1.f
file2.f
Additionally, assume you have created a directory for the profile data files in c:\profdata. Perform the following steps to generate and use a function order list.
Compile your program by specifying prof-gen and prof-dir:
Example |
---|
ifort /FeMYPROG /Qprof-gen /Qprof-dirc:\profdata file1.f file2.f |
Run the instrumented program on one or more sets of input data.
Example |
---|
MYPROG.exe |
The program produces a .dyn file each time it is executed. Note that this might take some time depending on the options specified.
Merge the data from instrumented program from one or more runs of the instrumented program using the profmerge tool to produce the pgopti.dpi file.
Example |
---|
profmerge /prof-dirc:\profdata |
Generate the function order list using the proforder tool. By default, the function order list is produced in the file proford.txt:
Example |
---|
proforder /prof-dirc:\profdata /o MYPROG.txt |
Compile your application with profile feedback by specifying the prof-use and the /ORDER option to the linker. Again, use the -prof-dir (Linux) or /Qprof-dir (Windows) option to specify the location of the profile files:
Example |
---|
ifort /FeMYPROG /Qprof-use /Qprof-dirc:\profdata file1.f file2.f |