There are some general optimization guidelines for IPO that you should keep in mind:
Applications where the compiler does not have sufficient IL coverage to do Whole Program analysis may not perform as well as those where IL information is complete.
Large IPO compilations might trigger internal limits of other compiler optimization phases.
In addition to the general guidelines, there are some practices to avoid while using IPO. The following list summarizes the activities to avoid:
Do not do the link phase of an IPO compilation using IL files produced by a different compiler.
Do not include major optimizations on the compile line and not include them on the link line.
Do not link IL files with the -prof-use (Linux*) or /Qprof-use (Windows*) option unless the IL files were generated with the -prof-use (Linux) or /Qprof-use (Windows) compile.
There are two key aspects to achieving improved performance with IPO:
Manipulating inlining heuristics
Applicability of whole program analysis
Whole Program Analysis (WPS), when it can be done, enables many IP optimizations. It is sometimes misunderstood. During the WPS process, the compiler reads all .il, .obj, and .lib files to determine if all references are resolved and whether or not a given symbol is defined in an .il file.
Symbols that are included in an .il file for both data and functions are candidates for Whole Program manipulation. Currently, .il information is generated for files compiled with IPO. The compiler embeds .il information inside the objects so that IPO information can be included inside libraries, DLLs, and shared objects.
A variable or function that is defined in a module with IL and is never referenced in a module without IL is subject to WP optimizations. Other variables (and functions) are not subject to these optimizations. A number of important IPO optimizations can be controlled with internal switches and IP optimization masks.