Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Compilers > Re: Reordering ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 11 Topic 2331 of 2474
Post > Topic >>

Re: Reordering of functions

by Tim Frink <plfriko@[EMAIL PROTECTED] > Feb 21, 2008 at 09:53 AM

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.

yes, but the gain they achieve has two reasons:

1) they use a direct-mapped instruction cache and the contiguously
placement of functions which call each other frequently might avoid
conflict cache misses since these functions are not mapped to the
same cache locations after reordering (I excluded this option in
my assumption)
2) they assume that the number of page faults will be minimized
since functions which call each other frequently will be likely
stored in the same page.

While writing this here another issue comes to my mind. When virtual
memory is used a reordering of functions might influence the TLB (if this
"cache" is not disabled) leading to different program execution.

> In fact, most compiler/frameworks sup****t 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.

Well, this does not answer my question. ;-)
Sure, when a function is completely inlined into the code than its
position in the code is irrelevant. However, a compiler will not inline
large functions (you told the reason with caches) so that the question
of their placement in memory still remains.

Tim
 




 11 Posts in Topic:
Reordering of functions
Tim Frink <plfriko@[EM  2008-02-18 17:22:52 
Re: Reordering of functions
"Nikolai Kim" &  2008-02-18 22:33:31 
Re: Reordering of functions
Tim Frink <plfriko@[EM  2008-02-21 09:53:21 
Re: Reordering of functions
=?ISO-8859-15?Q?Jan_Vorbr  2008-02-25 11:39:05 
Re: Reordering of functions
Joel Yliluoma <bisqwit  2008-02-19 11:33:56 
Re: Reordering of functions
Tim Frink <plfriko@[EM  2008-02-21 09:41:38 
Re: Reordering of functions
glen herrmannsfeldt <g  2008-02-24 01:59:56 
Re: Reordering of functions
Chris F Clark <cfc@[EM  2008-02-19 09:55:43 
Re: Reordering of functions
Tim Frink <plfriko@[EM  2008-02-21 09:36:08 
Re: Reordering of functions
Chris F Clark <cfc@[EM  2008-02-24 17:57:01 
Re: Reordering of functions
George Neuner <gneuner  2008-02-25 17:15:36 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Jul 26 1:17:44 CDT 2008.