Re: Reordering of functions

"Nikolai Kim" <nkim@odmsemi.com>
Mon, 18 Feb 2008 22:33:31 +0100

          From comp.compilers

Related articles
Reordering of functions plfriko@yahoo.de (Tim Frink) (2008-02-18)
Re: Reordering of functions nkim@odmsemi.com (Nikolai Kim) (2008-02-18)
Re: Reordering of functions bisqwit@iki.fi (Joel Yliluoma) (2008-02-19)
Re: Reordering of functions cfc@shell01.TheWorld.com (Chris F Clark) (2008-02-19)
Re: Reordering of functions gah@ugcs.caltech.edu (glen herrmannsfeldt) (2008-02-20)
Re: Reordering of functions plfriko@yahoo.de (Tim Frink) (2008-02-21)
Re: Reordering of functions plfriko@yahoo.de (Tim Frink) (2008-02-21)
Re: Reordering of functions plfriko@yahoo.de (Tim Frink) (2008-02-21)
[4 later articles]
| List of all articles for this month |
From: "Nikolai Kim" <nkim@odmsemi.com>
Newsgroups: comp.compilers
Date: Mon, 18 Feb 2008 22:33:31 +0100
Organization: Compilers Central
References: 08-02-051
Keywords: optimize, architecture
Posted-Date: 19 Feb 2008 12:52:21 EST

hi,


Function reordering depends heavily on the size of the functions, in
most cases such a reordering goes hand in hand with the
profile-information, and the latter is usually targeted at a "main"
application. whether such code-positioning makes sense, can't be said
definitely. Pettis/Hansen state in their paper, that such an
interprocedural optimization combined with bb-positioning within
functions may be very promising allowing gains from 2 to 15 %
depending on the application.


In fact, most compiler/frameworks support function-inlining which may
lead to even bigger functions, which again may lead to a cache being
to small to hold more than just one function, in such cases such a
reordering does not make much sense. the one could turn off inlining,
this may cause a slight efficiency- improvement and together with the
inner-procedural placement-strategies be of more meaning, but whether
it would be better if you had inlining turned on is an other question.


nk


"Tim Frink" <plfriko@yahoo.de> schrieb im Newsbeitrag
> Assume a modern processor with all state-of-the art features like
> prefetching, branch prediction and a superscalar pipeline. Further
> assume that all caches are disabled. Will the program runtime change
> when just the order of functions is changed (without any other code
> transformation)?
>
> I'm of the opinion that a reordering of function should have little
> influence on the program execution, maybe due to some prefetch effects
> but thes should be marginal. Of course, with caches this situation
> would look different.


Post a followup to this message

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