Newsgroups: | comp.compilers |
From: | glew@pdx007.intel.com (Andy Glew) |
Organization: | Intel Corp., Hillsboro, Oregon |
Date: | Sat, 12 Dec 1992 23:37:37 GMT |
References: | 92-12-029 92-12-037 |
Keywords: | optimize |
> I surmised that the original poster was asking if there was any empirical
> data to say that "most if-tests are taken" or "most if-tests are not
> taken". However, I would think that such conclusions would be heavily
> influenced by programming style and the programmer's personal preferences.
This does suggest a heuristic such as the following:
If one side of a conditional contains exit(nonzero), the word "error", or
an fprintf(stderr,...) or perror(), predict that side of the conditional
not to be taken.
Sure, it's dirty. But it's better than annotating with a #pragma. And
it's the sort of thing human programmers do all the time.
--
Andy Glew, glew@ichips.intel.com
Intel Corp., M/S JF1-19, 5200 NE Elam Young Pkwy,
Hillsboro, Oregon 97124-6497
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.