sr.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /* $Id$ */
  2. /*
  3. * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
  4. * See the copyright notice in the ACK home directory, in the file "Copyright".
  5. */
  6. /* I N T E R N A L D A T A S T R U C T U R E S O F
  7. *
  8. * S T R E N G T H R E D U C T I O N
  9. *
  10. */
  11. typedef struct iv *iv_p;
  12. typedef struct code_info *code_p;
  13. /* An induction variable */
  14. struct iv {
  15. offset iv_off; /* offset of the induction variable */
  16. line_p iv_incr; /* pointer to last instr. of EM-code that
  17. * increments the induction variable */
  18. offset iv_step; /* step value */
  19. };
  20. /* All information about a reducible piece of code is collected in
  21. * a single structure.
  22. */
  23. struct code_info {
  24. loop_p co_loop; /* the loop the code is in */
  25. bblock_p co_block; /* the basic block the code is in */
  26. line_p co_lfirst; /* first instruction of the code */
  27. line_p co_llast; /* last instruction of the code */
  28. line_p co_ivexpr; /* start of linear expr. using iv */
  29. line_p co_endexpr; /* end of the expression */
  30. int co_sign; /* sign of iv in above expr */
  31. iv_p co_iv; /* the induction variable */
  32. offset co_temp; /* temporary variable */
  33. int co_tmpsize; /* size of the temp. variable (ws or ps)*/
  34. int co_instr; /* the expensive instruction (mli,lar..)*/
  35. union {
  36. line_p co_loadlc; /* LOC lc instruction (for mult.)*/
  37. line_p co_desc; /* load address of descriptor
  38. * (for lar etc.) */
  39. } c_o;
  40. };
  41. #define LOAD 0
  42. #define STORE 1
  43. #define DLINK(l1,l2) l1->l_next=l2; l2->l_prev=l1
  44. #define same_local(l1,l2) (off_set(l1) == off_set(l2))
  45. #define LP_BLOCKS lp_extend->lpx_sr.lpx_blocks
  46. #define LP_DONE lp_extend->lpx_sr.lpx_done
  47. #define LP_HEADER lp_extend->lpx_sr.lpx_header
  48. #define LP_INSTR lp_extend->lpx_sr.lpx_instr
  49. /* Parameters to be provided by environment: */
  50. extern int ovfl_harmful; /* Does overflow during multiplication
  51. * cause a trap ?
  52. */
  53. extern int arrbound_harmful; /* Is it harmful to take the address of
  54. * a non-existing array element ?
  55. */
  56. extern int sli_threshold; /* Try to optimize SLI if shift-count larger than
  57. * this
  58. */
  59. extern int Ssr; /* #optimizations found */
  60. /* core allocation macros */
  61. #define newiv() (iv_p) newstruct(iv)
  62. #define newcinfo() (code_p) newstruct(code_info)
  63. #define newsrlpx() (lpext_p) newstruct(lpext_sr)
  64. #define oldiv(x) oldstruct(iv,x)
  65. #define oldcinfo(x) oldstruct(code_info,x)
  66. #define oldsrlpx(x) oldstruct(lpext_sr,x)