Mailing Lists
Flux Projects

CMI Logo


  • [November 24, 2003]: CMI 1.0.0 released

What is CMI?

Welcome to CMI the Cross-Module Inliner, from the Flux Research Group at the University of Utah's School of Computing.

CMI is an optimizing frontend for gcc which allows gcc to inline across module boundaries without requiring you to put inline functions in header files or even mark inline functions for inlining.


  • makes your code go faster;
  • makes your code smaller;
  • makes your embedded software use less stack space;
  • is a preprocessor for gcc;
  • supports most gcc extensions and is able to deal with such notoriously tricky code as the glibc header files;
  • works by merging multiple C files into one file, topologically sorting the definitions so that definitions come before uses, and marks functions as inline;
  • controls code-bloat by deleting dead code and inlining up until a user-specified budget is reached;
  • can use user-specified heuristics to select which functions to inline (we include a tool which uses gprof output to choose inlinings to illustrate this);

CMI is part of an ongoing R&D effort. We seek feedback, external users, and collaborators whose experiences and insight will help evolve CMI.



Making programs faster: In its default mode, CMI inlines functions which are small or called just once. This achieves respectable speedups at the cost of some code bloat.

Program Speed RatioCode Bloat
gzip +23%+70%
vpr +8%+18%
mcf +7% -6%
crafty +6%+45%
parser +1%+66%
perlbmk 0%+12%
gap -4%+12%
bzip2 +7% +2%

Note that some programs go slower. This tends to happen when there is a single hotspot that has already been so carefully tuned so that any change will make things worse or where the program has many hotspots.

Note that the code size sometimes goes down. This is partly because CMI deletes dead code and partly because inlining isn't a simple space-time tradeoff.

Finally, note that CMI doesn't work on all programs. For example, the SPEC benchmark vortex declares a variable rows as both a pointer and an int. CMI can't resolve conflicts like this.

Using profile data to control code bloat: CMI can also use profiling data obtained from previous runs of your program. This achieves respectable speedups with very little code bloat.

ProgramSpeedupCode Bloat
gzip +19% 0%
vpr +5% +6%
mcf +8% +3%
crafty +17% +21%
parser +6%+114%
perlbmk 0% +23%
gap +4% +10%
bzip2 +4% +9%

Reducing Stack Size: CMI can be used to optimize for more than just speed and code size. For example, using a stack size analyzer to guide your choice of inlinings, you can reduce the stack requirements of embedded software. (This is described in more detail in Eliminating stack overflow by abstract interpretation. John Regehr, Alastair Reid and Kirk Webb, In Proceedings of the Third International Conference on Embedded Software (EMSOFT'03), Philadelphia, PA, October 15-17 2003.)

Stack SizeCode Size
100% 0%
90% -5%
80% -2%
70% +4%


Feel free to peruse the CMI release announcement, license, installation instructions, and documentation. All of these documents are included with the distributions.


Download the distribution of your choice:

To build from source, you will need to install GHC 6.0 (a Haskell compiler) which is available for many platforms from http://haskell.org/ghc,


CMI is released under a GNU public license, version 2.

Bug reports/feedback

Please send bug reports and feedback to alchemy-users@flux.cs.utah.edu. This mailing list is open to subscribers only; see the description of the Alchemy mailing lists for more information.

[ CMI ] [ CPU Broker ] [ Hourglass ] [ Jiazzi ] [ Knit ] [ Maya ] [ SPAK ]
[ Network Testbed ] [ Alchemy ] [ Self-Spreading Transport Protocols ]
Flux Research Group / School of Computing / University of Utah

Problems? Contact the Flux Web Admin.
Last updated January 09, 2005.