Path: utzoo!utgpu!water!watmath!clyde!cbosgd!ihnp4!inuxc!iuvax!pur-ee!uiucdcs!uxc.cso.uiuc.edu!ccvaxa!aglew From: aglew@ccvaxa.UUCP Newsgroups: comp.arch Subject: Re: taken -vs- untaken branches, Fo Message-ID: <28200085@ccvaxa> Date: 9 Jan 88 19:31:00 GMT References: <839@ima.ISC.COM> Lines: 48 Nf-ID: #R:ima.ISC.COM:839:ccvaxa:28200085:000:1899 Nf-From: ccvaxa.UUCP!aglew Jan 9 13:31:00 1988 ..> The Fortran FREQUENCY statement: ..> John Levine (paraphrased) says that the lesson is that the programmer ..> should not provide the frequency hints, the system should. I would rather that you had said "the system should be able to", but "the programmer can if he really wants to". First, a high level directive like FREQUENCY can be generated either by the programmer or automatically by the language system, so why not make this functionality available to the programmer? Second, in many cases the programmer *does* know the frequency of certain statements, particularly if he's implementing a well known and well analyzed algorithm. It may be impossible or expensive for the language system to discover this automatically. Why not make it possible to use all the available information? Finally, it is possible that the frequency directive could be extended in ways that are not immediately automatable, eg: /* A computation involving Y and X */ IF x > 0 THEN FREQUENCY y<1 ? 0.25 : 0.75 ... :: x <= 0 THEN FREQUENCY y<1 ? 0.75 : 0.25 ... FI This might be, for example, used to generate two different copies of code, if y is known far enough in advance. I think it is more likely that compilers can be built that *use* this sort of information, than it is that a system can automatically *discover* this sort of thing in the near future. Andy "Krazy" Glew. Gould CSD-Urbana. 1101 E. University, Urbana, IL 61801 aglew@gould.com - preferred, if you have nameserver aglew@gswd-vms.gould.com - if you don't aglew@gswd-vms.arpa - if you use DoD hosttable aglew%mycroft@gswd-vms.arpa - domains are supposed to make things easier? My opinions are my own, and are not the opinions of my employer, or any other organisation. I indicate my company only so that the reader may account for any possible bias I may have towards our products.