Creating a Multifile IPO Executable with Command Line

Enable multifile IPO for compilations targeted for IA-32 architecture and for compilations targeted for ItaniumŪ architecture as follows in the example below.

Compile your source files with -ipo as follows:

Compile source files to produce object files: 
ifort -ipo -c
a.f b.f c.f

Produces a.o, b.o, and  c.o object files containing Intel compiler intermediate representation (IR) corresponding to the compiled source files a.f, b.f, and c.f. Using -c to stop compilation after generating .o files is required. You can now optimize interprocedurally.

Link object files to produce application executable: 
ifort
-oipo_file -ipo a.o b.o c.o

The ifort command performs IPO for objects containing IR and creates a new list of object(s) to be linked. The ifort command calls GCC ld to link the specified object files and produce ipo_file executable specified by the -o option. Multifile IPO is applied only to the source files that have an IR, otherwise the object file passes to link stage.

The -oname option stores the executable in ipo_file. Multifile IPO is applied only to the source files that have an IR, otherwise the object file passes to link stage.

For efficiency, combine steps 1 and 2:

ifort -ipo -oipo_file a.f b.f c.f

Instead of ifort, you can use the xild tool.

For a description of how to use multifile IPO with profile information for further optimization, see Example of Profile-Guided Optimization.