Interprocedural Analysis (IPA) allows the compiler to generate better and/or smaller code by inspecting more than just one function or data object at the same time. This technology is currently used by the inliner.
The compiler supports three different interprocedural analysis modes: off (default), file, and program.
With the function mode -ipa off, functions are optimized and code is generated when the function has been parsed. This mode allows no interprocedural analysis.
With the mode -ipa file, a translation unit is completely parsed before any code or data is generated. This allows optimizations and inlining on a per-file basis. This mode will require more memory and it can be slightly slower than the -ipa off mode. The compiler will also do an early dead code/data analysis in this mode, so objects with internal linkage that are not referenced will be dead-stripped in the compiler rather than in the linker.
With the mode -ipa program all translation units are completely parsed. Optimizations and code generation are done in a final stage enabling true "whole program" optimizations. For example, auto-inlining of functions that are defined in another translation unit.
"Program IPA" can require a lot of memory and will also be slower, especially in the change/build/debug cycle because all code generation and optimizations will have to be redone whenever a program has to be relinked.
Using this mode from command-line tools is more complicated. If you specify all source files on the command-line you can use -ipa program:
mwcc56800e -ipa program test1.c test2.c [all sources and libraries]...
This will compile, optimize, codegen, and link binary in "program" ipa mode.
If you want to separate compilation from linking you can either use:
mwcc56800e -ipa program -c test1.c
This generates test1.o file (empty) and a test1.irobj file.
mwcc56800e -ipa program -c test2.c
This generates test2.o file (empty) and a test2.irobj file.
mwcc56800e -ipa program test1.o test2.o [all *.o and libraries]...
This will optimize, codegen, and link binary in "program" ipa mode.
If you want to invoke the linker separately you will have to use:
mwcc56800e -ipa program -c test1.c
This generates test1.o file (empty) and a test1.irobj file.
mwcc56800e -ipa program -c test2.c
This generates test2.o file (empty) and a test2.irobj file.
mwcc56800e -ipa program-final test1.irobj test2.irobj [all *.irobjs]...
This will optimize and codegen in "program" ipa mode and update the .o files.
mwld56800e -o test.exe test1.obj test2.obj [all *.objs and libraries]...
This will link binaries.
The .irobj files contain an intermediate program representation. Thus the build step corresponding to "make clean" should remove these when the matching .o file is deleted.