Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Estimating loop iterations
Hi all.
Can anyone point me to any literature on estimating number of times
a loop would iterate. I noticed gcc 4 can estimate based on access
functions, size of data used etc in the loop. Anybody know what paper
is it based on ?

thanks
[Where is the Fortran FREQUENCY statement now that we need it? -John]


Report this thread to moderator Post Follow-up to this message
Old Post
drizzle
05-07-05 08:57 AM


Re: Estimating loop iterations
drizzle wrote:

>    Can anyone point me to any literature on estimating number of times
> a loop would iterate. I noticed gcc 4 can estimate based on access
> functions, size of data used etc in the loop. Anybody know what paper
> is it based on ?

> [Where is the Fortran FREQUENCY statement now that we need it? -John]

I wondered about it a year or two ago.  I saw it in the 704 Fortran
manual when I was looking for something else.  It seems that it
didn't last very long.  Since its use was optional, I am not sure
why it would go away.  The compiler could always ignore it.

The C reg attribute is sometimes used as an indication that a
variable is used more than others, but compilers are allowed to
ignore that.

Other than FREQUENCY, it is interesting how many Fortran features
are pretty much unchanged since Fortran I.

-- glen
[I heard that FREQUENCY went away both because nobody used it and because
at least with 1960 optimizing technology, it didn't tell the compiler anythi
ng
useful. -John]


Report this thread to moderator Post Follow-up to this message
Old Post
glen herrmannsfeldt
05-08-05 01:58 AM


Re: Estimating loop iterations
http://www.mirror5.com/software/gcc...filedriven.html

has some references, especially the Larus and Wu paper.


"drizzle" <drizzle76@gmail.com> wrote in message
>    Can anyone point me to any literature on estimating number of times
> a loop would iterate. I noticed gcc 4 can estimate based on access
> functions, size of data used etc in the loop. Anybody know what paper
> is it based on ?

Report this thread to moderator Post Follow-up to this message
Old Post
sandya
05-08-05 01:58 AM


Re: Estimating loop iterations
On 7 May 2005 16:58:29 -0400, John Levine commented:

> [I heard that FREQUENCY went away both because nobody used it and because
> at least with 1960 optimizing technology, it didn't tell the compiler anyt
hing
> useful. -John]

I heard that the reason it was taken away after the first few FORTRAN
compilers implemented it round the wrong way ... but it didn't affect the
quality of the code produced. Also programmers were found to be poor at
determining which execution paths are actually followed,

Regards, Trevor

<>< Re: deemed!
[Yes, that agrees with what I've heard. -John]

Report this thread to moderator Post Follow-up to this message
Old Post
Trevor Jenkins
05-09-05 01:57 AM


Re: Estimating loop iterations
Trevor Jenkins wrote:
> On 7 May 2005 16:58:29 -0400, John Levine commented:
 

> I heard that the reason it was taken away after the first few FORTRAN
> compilers implemented it round the wrong way ... but it didn't affect the
> quality of the code produced. Also programmers were found to be poor at
> determining which execution paths are actually followed,

Well, FREQUENCY has two, somewhat unrelated uses.  One was for
relative branch frequency.  For processors that do static branch
prediction (and I don't believe the 704 was one) with instruction or
prefix bits, it could be used.

The other use is for DO loops where it specifies the expected number
of iterations.  There might be some things optimizers could do
differently based on that number.  That seems to be the use that the
OP was asking about.

-- glen
[The point of the branch prediction was for the Fortran three-way arithmetic
IF, to tell it which test to put first.  Pretty marginal. -John]

Report this thread to moderator Post Follow-up to this message
Old Post
glen herrmannsfeldt
05-09-05 08:58 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Compilers archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 09:52 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.