home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.compilers
- Path: sparky!uunet!enterpoop.mit.edu!world!iecc!compilers-sender
- From: glew@pdx007.intel.com (Andy Glew)
- Subject: Re: static estimation of conditional branches?
- Reply-To: glew@pdx007.intel.com (Andy Glew)
- Organization: Intel Corp., Hillsboro, Oregon
- Date: Sat, 12 Dec 1992 23:37:37 GMT
- Approved: compilers@iecc.cambridge.ma.us
- Message-ID: <92-12-053@comp.compilers>
- References: <92-12-029@comp.compilers> <92-12-037@comp.compilers>
- Keywords: optimize
- Sender: compilers-sender@iecc.cambridge.ma.us
- Lines: 20
-
- > 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
- --
- Send compilers articles to compilers@iecc.cambridge.ma.us or
- {ima | spdcc | world}!iecc!compilers. Meta-mail to compilers-request.
-