Interprocedural Optimization: Examples

Example: -Qip (Linux: -ip)

prompt>icl -Qip myprog.cpp

Example: -Qipo (Linux: -ipo)

The following is a two step example from the Intel® C++ Compiler User's Guide:

  1. prompt>icl -Qipo -c myfile_a.c myfile_b.c myfile_c.c
    Use -c to stop compilation after generating .obj files. Each object file has the intermediate result (IR) for the corresponding source file. With the preceding results, you can now optimize interprocedurally:
  2. prompt>icl -Fenu_ipo_file -Qipo myfile_a.obj myfile_b.obj myfile_c.obj
    The -Fe option stores the executable in nu_ipo_file.exe. Multifile IPO is applied only to modules that have an IR, otherwise the object file passes to the link stage.

You can also combine the above two steps in the following command line:

prompt>icl -Qipo -Fenu_ipo_file myfile_a.c myfile_b.c myfile_c.c

You can also use the xilink tool to create multifile IPO executables. See the Intel compiler User's Guide for more information.