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.