home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / unix / aix / 8182 < prev    next >
Encoding:
Text File  |  1992-07-25  |  2.3 KB  |  47 lines

  1. Newsgroups: comp.unix.aix
  2. Path: sparky!uunet!newsgate.watson.ibm.com!yktnews!admin!yktnews!prener
  3. From: prener@watson.ibm.com (Dan Prener)
  4. Subject: Re: xlf compiler preprocessors
  5. Sender: news@watson.ibm.com (NNTP News Poster)
  6. Message-ID: <PRENER.92Jul25200112@prener.watson.ibm.com>
  7. In-Reply-To: alhy@unixhub.slac.stanford.edu's message of 25 Jul 92 12:11:34 GMT
  8. Date: Sun, 26 Jul 1992 01:01:12 GMT
  9. Disclaimer: This posting represents the poster's views, not necessarily those of IBM
  10. References: <4840@unixhub.SLAC.Stanford.EDU>
  11. Nntp-Posting-Host: prener.watson.ibm.com
  12. Organization: IBM T.J. Watson Research Center, Hawthorne, New York
  13. Followup-To: comp.unix.aix
  14. Lines: 31
  15.  
  16. In article <4840@unixhub.SLAC.Stanford.EDU> alhy@unixhub.slac.stanford.edu (J. Scott Berg) writes:
  17.  
  18. >Can anyone explain to me why/when/if I should use the -Pk or -Pv
  19. >preprocessors instead of/in addition to the -O optimization?  I have
  20. >some fortran code (LAPACK, in particular) that I want to optimize for
  21. >speed.  The manual makes it rather unclear what exactly -O does, so I
  22. >can't figure out if -Pk and/or -Pv do more or less optimization
  23. >("There may be other optimizations performed also" is written after a
  24. >list that is headed with "The OPT option performs some of the
  25. >optimization techniques outlined below").  Thanks
  26.  
  27. The preprocessors are exactly that: PREprocessors, performing a variety
  28. of source-to-source transformations.  When you use one of them, you should
  29. definitely also use -O.  As to whether one of the preprocessors will get
  30. you performance better than that obtained using only -O, the best approach
  31. is to try it and time your program.
  32.  
  33. The -O option will perform such general-purpose optimizations as
  34. common-subexpression elimination, strength reduction, elimination of
  35. computations whose results are never used, dead induction-variable
  36. elimination, constant propagation, etc., as well as machine-specific
  37. optimizations such as casting loops in a form that takes advantage of
  38. the hardware's (usually) zero-time loop terminating instruction,
  39. instruction scheduling, etc.
  40.  
  41. The preprocessors will do some of the above and will also do loop
  42. unrolling, loop interchange, strip mining, replacement of code by
  43. calls to highly optimized BLAS library routines where appropriate,
  44. etc.
  45. --
  46.                                    Dan Prener (prener@watson.ibm.com)
  47.