Command Line for Creating an IPO Executable

The command line options to enable IPO for compilations targeted for both the IA-32 and Itanium® architectures are identical.

To produce mock object files containing IR, compile your source files with -ipo as follows:

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

This produces a.o, b.o, and  c.o object files.  These files contain 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 by adding -ipo to your link command line. The following example produces an executable named app:

ifort -oapp -ipo a.o b.o c.o

This command invokes the compiler on the objects containing IR and creates a new list of object(s) to be linked. The command then calls GCC ld to link the specified object files and produce app, as specified by the -o option. IPO is applied only to the object files that contain IR; otherwise the object file passes to link stage.

For the above step, you can use the  xild tool instead of ifort.

The two steps described above can be combined, as shown in the following:

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