home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / programm / 2088 < prev    next >
Encoding:
Internet Message Format  |  1992-07-23  |  2.8 KB

  1. Path: sparky!uunet!gatech!purdue!mentor.cc.purdue.edu!pop.stat.purdue.edu!hrubin
  2. From: hrubin@pop.stat.purdue.edu (Herman Rubin)
  3. Newsgroups: comp.programming
  4. Subject: Compilers: was: Re: Advantages/disadvantages of macros/inlining?
  5. Keywords: macro inline
  6. Message-ID: <54942@mentor.cc.purdue.edu>
  7. Date: 23 Jul 92 22:33:38 GMT
  8. References: <1992Jul13.162208.7651@webo.dg.com> <54558@mentor.cc.purdue.edu> <1992Jul22.154647.877@tc.fluke.COM>
  9. Sender: news@mentor.cc.purdue.edu
  10. Organization: Purdue University Statistics Department
  11. Lines: 51
  12.  
  13. In article <1992Jul22.154647.877@tc.fluke.COM> kurt@tc.fluke.COM (Kurt Guntheroth) writes:
  14. >hrubin@pop.stat.purdue.edu (Herman Rubin) writes:
  15.  
  16. >>On the one hand, computer people are stupidly insisting that the
  17. >>compiler can do all, and that human attempts to improve what compilers
  18. >>can do are futile.  Now we hear the complaint that the compiler will
  19. >>choke on the problem.
  20.  
  21. >>On the one hand, we hear that there are lots of registers.  On the
  22. >>other hand, we hear that there are not enough for inlining.
  23.  
  24. >>Herman Rubin, Dept. of Statistics, Purdue Univ., West Lafayette IN47907-1399
  25.  
  26. >Well, it's all true.
  27.  
  28. >On a large program, a world-class compiler can do far better than even an
  29. >experienced programmer at discovering optimizations.  I would expect the
  30. >compiler to win every time on non-toy problems.
  31.  
  32. The compiler can only do the optimizations is knows about.  If the human is
  33. restricted to such weak things as Fortran or C, a world-class compiler 
  34. would win most of the time.  But there are quite a few things which the
  35. HLLs are unable to do anything reasonable with.
  36.  
  37. >On some RISC processors, there are virtually unlimited registers; hundreds
  38. >of them.
  39.  
  40. One of the people in the computing center here told me that even the
  41. CISC Cyber 205, with its 256 registers, about 240 useful by the programs,
  42. sometimes runs out.  It also has relatively fast load/store of register
  43. blocks.
  44.  
  45. >On the other hand, there are constructs (like inlining) that can make it
  46. >more difficult for some compilers to do a good job.  Are these world class
  47. >compilers?  Maybe and maybe not, but it doesn't rob the truth from the first
  48. >assertion.  The best compilers on the best machines translating appropriate
  49. >languages can do far better than a human.
  50.  
  51. >And there are machines with absolutely miserable register sets, and
  52. >compilers with code generation strategies optimized for machines with many
  53. >registers often suck big-time on machines with few or difficult-to-use
  54. >registers.
  55.  
  56. But the compilers, even the world class ones, are woefully ignorant.  Of
  57. course, the answer is to let the human instruct the compiler, and the 
  58. instruction may have to be to try out this large variety of procedures.
  59. -- 
  60. Herman Rubin, Dept. of Statistics, Purdue Univ., West Lafayette IN47907-1399
  61. Phone: (317)494-6054
  62. hrubin@pop.stat.purdue.edu (Internet, bitnet)  
  63. {purdue,pur-ee}!pop.stat!hrubin(UUCP)
  64.