Generating Function Order Lists

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.

Function Order List Usage Guidelines (Windows*)

Use the following guidelines to create a function order list:

Comparison of Function Order Lists and IPO Code Layout

The Intel® compiler provides two methods of optimizing the layout of functions in the executable:

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 Order List Effects

Function Type

Code Layout
with -ipo (/Qipo)

Function
Ordering
with proforder

Static

X

No effect

Extern

X

X

Library

No effect

X

Example of Generating a Function Order List

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:

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.

  1. Compile your program by specifying prof-gen and prof-dir:

Example

ifort /FeMYPROG /Qprof-gen /Qprof-dirc:\profdata file1.f file2.f

  1. 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.

  1. 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

  1. 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

  1. 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
/link /ORDER:@MYPROG.txt