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:
prompt>ifc -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:
prompt>ifc
-oipo_file -ipo a.o
b.o c.o
The ifc command performs IPO for objects containing IR and creates a new list of object(s) to be linked. The ifc command calls GCC ld to link the specified object files and produce ipo_file.exe 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:
prompt>ifc -ipo -oipo_file a.f b.f c.f
For ItaniumŪ-based applications, use the same steps with the efc command.
Instead of ifc or efc, 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.