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: Prediction ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 20 Topic 2371 of 2529
Post > Topic >>

Re: Prediction of local code modifications

by glen herrmannsfeldt <gah@[EMAIL PROTECTED] > Mar 28, 2008 at 02:44 AM

Tim Frink wrote:
(snip)

> My optimizations deal with moving basic blocks (determined by some
> cost functions) from the slow main memory to a small but fast memory
> thus allowing a fast access to these particular blocks. However, I
> have large problems with the "optimized" code. The moved blocks
> benefit from the faster memory but due to the moving the addresses of
> the subsequent instructions obviously change.
(snip)

> Thus, my problem is that I can achieve a local optimization for the
> moved blocks but the resulting global influence is not predictable
> and might even undo the benefits and even result in a degraded
> runtime of the program.

> How do compiler developers cope with this problem? Are there any
> approaches which allow to predict the influence of a local code
> optimization on the global code performance for complex processors?

If I understand your question right, the answer is 'dynamic programming'.

Dynamic programming, which is neither dynamic nor programming, allows
one to do global optimization given weights (cost functions) of the
various choices.

http://en.wikipedia.org/wiki/Dynamic_programming

http://www.ics.uci.edu/~dan/class/161/notes/6/Dynamic.html

First popularized by biologists comparing protein sequences, it was
then used by the unix 'diff' program for finding a minimal set of
differences between two files.  (Again, with the appropriate
weighting.)  In general, dynamic programming allows one to do in
polynomial time what would otherwise seem to take exponential time.

The use of dynamic programming for code generation in compilers is
described in the book about LCC,

http://drhanson.s3.amazonaws.com/storage/do***ents/linux.html

and likely in other compiler books.

-- glen
 




 20 Posts in Topic:
Prediction of local code modifications
Tim Frink <plfriko@[EM  2008-03-27 14:30:25 
Re: Prediction of local code modifications
glen herrmannsfeldt <g  2008-03-28 02:44:26 
Re: Prediction of local code modifications
"preston.briggs@[EMA  2008-03-28 14:26:42 
Re: Prediction of local code modifications
Max Hailperin <max@[EM  2008-03-28 19:40:17 
Re: Prediction of local code modifications
glen herrmannsfeldt <g  2008-03-29 11:33:00 
Re: Prediction of local code modifications
"preston.briggs@[EMA  2008-03-29 23:35:53 
Re: Prediction of local code modifications
Tim Frink <plfriko@[EM  2008-04-01 09:23:23 
Re: Prediction of local code modifications
"preston.briggs@[EMA  2008-04-01 23:01:46 
Re: Prediction of local code modifications
Max Hailperin <max@[EM  2008-04-02 07:42:57 
Re: Prediction of local code modifications
Tim Frink <plfriko@[EM  2008-04-03 21:22:40 
Re: Prediction of local code modifications
George Neuner <gneuner  2008-04-04 18:23:56 
Re: Prediction of local code modifications
Tim Frink <plfriko@[EM  2008-04-08 21:06:19 
Re: Prediction of local code modifications
gneuner <gneuner@[EMAI  2008-04-19 20:42:21 
Re: Prediction of local code modifications
Chris F Clark <cfc@[EM  2008-04-02 11:24:17 
Re: Prediction of local code modifications
glen herrmannsfeldt <g  2008-04-03 00:02:21 
Re: Prediction of local code modifications
Max Hailperin <max@[EM  2008-04-03 10:22:36 
Re: Prediction of local code modifications
Chris F Clark <cfc@[EM  2008-04-04 20:13:17 
Re: Prediction of local code modifications
Matthias Blume <find@[  2008-04-04 00:21:38 
Re: Prediction of local code modifications
Chris F Clark <cfc@[EM  2008-04-05 09:43:16 
Re: Prediction of local code modifications
Mayan Moudgill <mayan@  2008-04-05 21:35:56 

Post A Reply:
  Go here to Signup

AddThis Feed Button


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

Contact
tan12V112 Sun Oct 12 4:41:38 CDT 2008.