Creating a Multifile IPO Executable

This topic describes how to create a multifile IPO executable for compilations targeted for IA-32 and Itanium®-based systems.

If you separately compile and link your source modules with -ipo:

  1. Compile with -ipo as follows:
    prompt>icpc -ipo -c a.cpp b.cpp c.cpp
  2. Use the -c option to stop compilation after generating .o files. Each object file has the IR for the corresponding source file. With preceding results, you can now optimize interprocedurally:
    prompt>icpc -ipo a.o b.o c.o

Multifile IPO is applied only to modules that have an IR, otherwise the object file passes to the link stage. For efficiency, combine steps 1 and 2:

prompt>icpc -ipo a.cpp b.cpp c.cpp

See Using Profile-Guided Optimization: An Example for a description of how to use multifile IPO with profile information for further optimization.