These samples are designed to illustrate using multi-file Interprocedural Optimization (IPO). In addition, these file can illustrate how to generate an IPO report.
See Included Samples for other samples included with the compiler.
Source |
Locations | ||||
---|---|---|---|---|---|
ipo_sample_init
|
|
These sample files illustrate both the process and concepts in multi-file IPO. For example, the samples include functions that will be inlined only when the sources are compiled using Interprocedural optimization on the whole program.
Compile all sources with IPO enabled. (You can combine these options with the appropriate compiler report option to generate the IPO report.)
Platform |
Commands |
---|---|
Linux and Mac OS |
ifort -ipo ipo_sample_main.f90 ipo_sample_init.f90 ipo_sample_sum.f90 |
Windows |
ifort /Qipo ipo_sample_main.f90 ipo_sample_init.f90 ipo_sample_sum.f90 |
The compiler generates messages for many of the IPO stages. The following examples illustrate typical messages. (Mac OS messages are similar to those listed for Linux; however, the linker phase messages are different.)
Platform |
Status Messages |
---|---|
Linux |
ipo: remark #11000: performing multi-file optimizations ipo: remark #11005: generating object file /tmp/ipo_ifortyiejLX.o |
Windows |
ipo: remark #11000: performing multi-file optimizations ipo: remark #11005: generating object file ipo_3076.obj Microsoft (R) Incremental Linker
Version 8.00.50727.42 -out:ipo_sample_init.exe |
Windows only: In the compilation directory you'll notice that in addition to the executable there are new object files (.obj).
These mock object files contain the intermediate representation for each of the associated source files. These mock object files are used to generate the object file that is, in turn, used in the linking phase to generate the final executable.
Linux and Mac OS: To get the equivalent mock object files (.o), use the -c option.
See Using IPO for more information about these mock object files and how you can use them.
Run the executable.
Platform |
Commands |
---|---|
Linux and Mac OS |
./a.out |
Windows |
ipo_sample_main |