Skip to content
  1. Mar 07, 2004
  2. Mar 01, 2004
  3. Feb 27, 2004
  4. Feb 26, 2004
  5. Feb 25, 2004
    • Chris Lattner's avatar
      My faith in programmers has been found to be totally misplaced. One would · 8d1da1ab
      Chris Lattner authored
      assume that if they don't intend to write to a global variable, that they
      would mark it as constant.  However, there are people that don't understand
      that the compiler can do nice things for them if they give it the information
      it needs.
      
      This pass looks for blatently obvious globals that are only ever read from.
      Though it uses a trivially simple "alias analysis" of sorts, it is still able
      to do amazing things to important benchmarks.  253.perlbmk, for example,
      contains several ***GIANT*** function pointer tables that are not marked
      constant and should be.  Marking them constant allows the optimizer to turn
      a whole bunch of indirect calls into direct calls.  Note that only a link-time
      optimizer can do this transformation, but perlbmk does have several strings
      and other minor globals that can be marked constant by this pass when run
      from GCCAS.
      
      176.gcc has a ton of strings and large tables that are marked constant, both
      at compile time (38 of them) and at link time (48 more).  Other benchmarks
      give similar results, though it seems like big ones have disproportionally
      more than small ones.
      
      This pass is extremely quick and does good things.  I'm going to enable it
      in gccas & gccld.  Not bad for 50 SLOC.
      
      llvm-svn: 11836
      8d1da1ab
  6. Feb 13, 2004
  7. Feb 09, 2004
  8. Feb 08, 2004
  9. Feb 04, 2004
  10. Feb 02, 2004
  11. Jan 09, 2004
  12. Dec 28, 2003
  13. Dec 23, 2003
  14. Dec 07, 2003
  15. Nov 22, 2003
  16. Nov 21, 2003
  17. Nov 20, 2003
  18. Nov 17, 2003
  19. Nov 11, 2003
  20. Nov 09, 2003
  21. Nov 06, 2003
  22. Nov 05, 2003
  23. Nov 02, 2003
  24. Oct 31, 2003
  25. Oct 29, 2003
  26. Oct 27, 2003
Loading