home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.compilers
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!eff!world!iecc!compilers-sender
- From: idacrd!desj@uunet.UU.NET (David desJardins)
- Subject: Re: static estimation of conditional branches?
- Reply-To: idacrd!desj@uunet.UU.NET (David desJardins)
- Organization: IDA Center for Communications Research, Princeton
- Date: Sat, 12 Dec 1992 04:37:35 GMT
- Approved: compilers@iecc.cambridge.ma.us
- Message-ID: <92-12-049@comp.compilers>
- Keywords: optimize
- References: <92-12-029@comp.compilers> <92-12-047@comp.compilers>
- Sender: compilers-sender@iecc.cambridge.ma.us
- Lines: 35
-
- 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
- --
- Send compilers articles to compilers@iecc.cambridge.ma.us or
- {ima | spdcc | world}!iecc!compilers. Meta-mail to compilers-request.
-