Re: static estimation of conditional branches?

idacrd!desj@uunet.UU.NET (David desJardins)
Sat, 12 Dec 1992 04:37:35 GMT

          From comp.compilers

Related articles
[3 earlier articles]
Re: static estimation of conditional branches? tom@derby.cs.wisc.edu (1992-12-09)
Re: static estimation of conditional branches? tsych@sedona.intel.com (1992-12-09)
Re: static estimation of conditional branches? hagerman@ece.cmu.edu (1992-12-09)
Re: static estimation of conditional branches? bill@amber.csd.harris.com (1992-12-10)
Re: static estimation of conditional branches? hrubin@pop.stat.purdue.edu (1992-12-11)
Re: static estimation of conditional branches? henry@zoo.toronto.edu (1992-12-11)
Re: static estimation of conditional branches? idacrd!desj@uunet.UU.NET (1992-12-12)
Re: static estimation of conditional branches? jfisher@hplabsz.hpl.hp.com (1992-12-11)
Re: static estimation of conditional branches? chased@rbbb.Eng.Sun.COM (1992-12-12)
Re: static estimation of conditional branches? glew@pdx007.intel.com (1992-12-12)
Re: static estimation of conditional branches? henry@zoo.toronto.edu (1992-12-13)
Re: static estimation of conditional branches? hrubin@pop.stat.purdue.edu (1992-12-13)
Re: static estimation of conditional branches? drw@euclid.mit.edu (1992-12-14)
[3 later articles]
| List of all articles for this month |

Newsgroups: comp.compilers
From: idacrd!desj@uunet.UU.NET (David desJardins)
Organization: IDA Center for Communications Research, Princeton
Date: Sat, 12 Dec 1992 04:37:35 GMT
Keywords: optimize
References: 92-12-029 92-12-047

The moderator wrote:
> [As I recall, Fortran II dropped FREQUENCY because it was infrequently
> used and made little difference. I've heard that it may even have been
> implemented backwards and nobody noticed. -John]


Henry Spencer <henry@zoo.toronto.edu> writes:
> The other problem that occurs with such facilities is that programmer
> intuition is notoriously unreliable about such things.


I don't understand this statement in this context in this context. I know
it's fashionable in this group to claim that compilers are supergeniuses
and humans are idiots. This might even sometimes be the case for examples
like, "Should the variable FOO be held in a register?" After all, a
typical programmer would not know enough about the compiler internals and
machine architecture to know all of the tradeoffs involved in this
decision.


But any programmer who is making a serious effort to write high-
performance code must know approximately how often each of the conditional
branches in critical sections is taken. That's not a matter of
"intuition." It's a question of understanding what the code is doing: an
understanding which is fundamental to optimization.


And we are just talking about communicating those facts from the
programmer to the compiler, with no judgments about their implications
attached. It's up to the compiler to draw the appropriate conclusions, if
any. I don't see how this can be "unreliable."


Of course, I too endorse the feedback of profiler information as a more
convenient (to the user) way to achieve similar results.


                                                                                David desJardins
--


Post a followup to this message

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