Re: Is interprocedural optimization worth it?

"Mark Lacey \[MSFT\]" <>
6 Apr 2002 23:15:00 -0500

          From comp.compilers

Related articles
Is interprocedural optimization worth it? (Dmitry Shaporenkov) (2002-03-31)
Re: Is interprocedural optimization worth it? (Mark Lacey \[MSFT\]) (2002-04-06)
| List of all articles for this month |

From: "Mark Lacey \[MSFT\]" <>
Newsgroups: comp.compilers
Date: 6 Apr 2002 23:15:00 -0500
Organization: Compilers Central
References: 02-03-174
Keywords: optimize
Posted-Date: 06 Apr 2002 23:15:00 EST


It's a difficult question to answer without knowing what architecture
you're generating code for, and what interproc optimizations you're
considering. Not having access to the entire code generator can
definitely be a significant drawback.

The latest revision of the Microsoft Visual C++ compiler does
whole-program optimization at link-time. See: for more information.

My experience from having worked on this definitely showed that
inlining across the entire program can often be a big win, but it can
be relatively hard to tune this inlining without profile information
being available. It can also be a big loss if not tuned properly (in
particular inlining very agressively, on all but the smallest
programs, tends to blow the I-cache out so badly that it's an overall

Improved memory disambiguation can have a large effect on
architectures where you have a lot of registers (like IA-64) but less
of an effect on architectures where you have very few registers (like

You may want to consider referencing one of the recent compiler texts
and the papers referenced in those texts before embarking on a
detailed design or implementation. Muchnick's book (Advanced Compiler
Design and Implementation) has a chapter on interprocedural
optimizations and if it's like the rest of the book (sorry, don't have
it handy) it should have a lot of references.

Mark Lacey
mlacey at microsoft dot com
Microsoft Visual C++ Program Management

"Dmitry Shaporenkov" <> wrote in message
> My question is, does anybody know the successful examples of
> interprocedural optimizers in modern C compilers, commercial or free?
> Or, aliasing problems and procedure boundaries are too hard obstacles
> to make such optimizations really useful (on the other hand, is it
> better to inline as much code as possible)? It would also be
> interesting which interprocedural optimizations are performed in
> compilers, and which of them produce best results?

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.