aopt386.pas 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. {
  2. $Id$
  3. Copyright (c) 1998 by Jonas Maebe
  4. This unit calls the optimization procedures to optimize the assembler
  5. code for i386+
  6. This program is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2 of the License, or
  9. (at your option) any later version.
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with this program; if not, write to the Free Software
  16. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17. ****************************************************************************
  18. }
  19. Unit aopt386;
  20. Interface
  21. Uses
  22. aasm;
  23. Procedure Optimize(AsmL: PAasmOutput);
  24. Implementation
  25. Uses
  26. globtype,
  27. globals,i386,DAOpt386,POpt386,CSOpt386;
  28. Procedure Optimize(AsmL: PAasmOutput);
  29. Var BlockEnd: Pai;
  30. Begin
  31. {setup labeltable, always necessary}
  32. DFAPass1(AsmL);
  33. {peephole optimizations}
  34. PeepHoleOptPass1(AsmL);
  35. PeepHoleOptPass1(AsmL);
  36. {data flow analyzer}
  37. If (cs_slowoptimize in aktglobalswitches) Then
  38. Begin
  39. BlockEnd := DFAPass2(AsmL);
  40. If BlockEnd <> Nil Then
  41. {common subexpression elimination}
  42. CSE(AsmL, Pai(AsmL^.First), BlockEnd);
  43. End;
  44. {more peephole optimizations}
  45. PeepHoleOptPass2(AsmL);
  46. {dispose labeltabel}
  47. ShutDownDFA;
  48. End;
  49. End.
  50. {
  51. $Log$
  52. Revision 1.23 1998-12-11 00:02:43 peter
  53. + globtype,tokens,version unit splitted from globals
  54. Revision 1.22 1998/08/19 16:07:57 jonas
  55. * changed optimizer switches + cleanup of DestroyRefs in daopt386.pas
  56. Revision 1.21 1998/08/06 19:40:29 jonas
  57. * removed $ before and after Log in comment
  58. Revision 1.20 1998/08/05 16:00:08 florian
  59. * some fixes for ansi strings
  60. * log to Log changed
  61. }