home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / compiler / 2021 < prev    next >
Encoding:
Text File  |  1992-12-12  |  1.4 KB  |  35 lines

  1. Newsgroups: comp.compilers
  2. Path: sparky!uunet!enterpoop.mit.edu!world!iecc!compilers-sender
  3. From: glew@pdx007.intel.com (Andy Glew)
  4. Subject: Re: static estimation of conditional branches?
  5. Reply-To: glew@pdx007.intel.com (Andy Glew)
  6. Organization: Intel Corp., Hillsboro, Oregon
  7. Date: Sat, 12 Dec 1992 23:37:37 GMT
  8. Approved: compilers@iecc.cambridge.ma.us
  9. Message-ID: <92-12-053@comp.compilers>
  10. References: <92-12-029@comp.compilers> <92-12-037@comp.compilers>
  11. Keywords: optimize
  12. Sender: compilers-sender@iecc.cambridge.ma.us
  13. Lines: 20
  14.  
  15. > I surmised that the original poster was asking if there was any empirical
  16. > data to say that "most if-tests are taken" or "most if-tests are not
  17. > taken".  However, I would think that such conclusions would be heavily
  18. > influenced by programming style and the programmer's personal preferences.
  19.  
  20. This does suggest a heuristic such as the following:
  21.  
  22. If one side of a conditional contains exit(nonzero), the word "error", or
  23. an fprintf(stderr,...) or perror(), predict that side of the conditional
  24. not to be taken.
  25.  
  26. Sure, it's dirty.  But it's better than annotating with a #pragma.  And
  27. it's the sort of thing human programmers do all the time.
  28. --
  29. Andy Glew, glew@ichips.intel.com
  30. Intel Corp., M/S JF1-19, 5200 NE Elam Young Pkwy, 
  31. Hillsboro, Oregon 97124-6497
  32. -- 
  33. Send compilers articles to compilers@iecc.cambridge.ma.us or
  34. {ima | spdcc | world}!iecc!compilers.  Meta-mail to compilers-request.
  35.