sel-sched-dump.h 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. /* Instruction scheduling pass. Log dumping infrastructure.
  2. Copyright (C) 2006-2019 Free Software Foundation, Inc.
  3. This file is part of GCC.
  4. GCC is free software; you can redistribute it and/or modify it under
  5. the terms of the GNU General Public License as published by the Free
  6. Software Foundation; either version 3, or (at your option) any later
  7. version.
  8. GCC is distributed in the hope that it will be useful, but WITHOUT ANY
  9. WARRANTY; without even the implied warranty of MERCHANTABILITY or
  10. FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  11. for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with GCC; see the file COPYING3. If not see
  14. <http://www.gnu.org/licenses/>. */
  15. #ifndef GCC_SEL_SCHED_DUMP_H
  16. #define GCC_SEL_SCHED_DUMP_H
  17. /* These values control the dumping of control flow graph to the .dot file. */
  18. enum sel_dump_cfg_def
  19. {
  20. /* Dump only current region. */
  21. SEL_DUMP_CFG_CURRENT_REGION = 2,
  22. /* Dump note_list for this bb. */
  23. SEL_DUMP_CFG_BB_NOTES_LIST = 4,
  24. /* Dump availability set from the bb header. */
  25. SEL_DUMP_CFG_AV_SET = 8,
  26. /* Dump liveness set from the bb header. */
  27. SEL_DUMP_CFG_LV_SET = 16,
  28. /* Dump insns of the given block. */
  29. SEL_DUMP_CFG_BB_INSNS = 32,
  30. /* Show current fences when dumping cfg. */
  31. SEL_DUMP_CFG_FENCES = 64,
  32. /* Show insn's seqnos when dumping cfg. */
  33. SEL_DUMP_CFG_INSN_SEQNO = 128,
  34. /* Dump function name when dumping cfg. */
  35. SEL_DUMP_CFG_FUNCTION_NAME = 256,
  36. /* Dump loop father number of the given bb. */
  37. SEL_DUMP_CFG_BB_LOOP = 512,
  38. /* The default flags for cfg dumping. */
  39. SEL_DUMP_CFG_FLAGS = (SEL_DUMP_CFG_CURRENT_REGION
  40. | SEL_DUMP_CFG_BB_NOTES_LIST
  41. | SEL_DUMP_CFG_AV_SET
  42. | SEL_DUMP_CFG_LV_SET
  43. | SEL_DUMP_CFG_BB_INSNS
  44. | SEL_DUMP_CFG_FENCES
  45. | SEL_DUMP_CFG_INSN_SEQNO
  46. | SEL_DUMP_CFG_BB_LOOP)
  47. };
  48. /* These values control the dumping of insns containing in expressions. */
  49. enum dump_insn_rtx_def
  50. {
  51. /* Dump insn's UID. */
  52. DUMP_INSN_RTX_UID = 2,
  53. /* Dump insn's pattern. */
  54. DUMP_INSN_RTX_PATTERN = 4,
  55. /* Dump insn's basic block number. */
  56. DUMP_INSN_RTX_BBN = 8,
  57. /* Dump all of the above. */
  58. DUMP_INSN_RTX_ALL = (DUMP_INSN_RTX_UID | DUMP_INSN_RTX_PATTERN
  59. | DUMP_INSN_RTX_BBN)
  60. };
  61. extern void dump_insn_rtx_1 (rtx, int);
  62. extern void dump_insn_rtx (rtx);
  63. extern void debug_insn_rtx (rtx);
  64. /* These values control dumping of vinsns. The meaning of different fields
  65. of a vinsn is explained in sel-sched-ir.h. */
  66. enum dump_vinsn_def
  67. {
  68. /* Dump the insn behind this vinsn. */
  69. DUMP_VINSN_INSN_RTX = 2,
  70. /* Dump vinsn's type. */
  71. DUMP_VINSN_TYPE = 4,
  72. /* Dump vinsn's count. */
  73. DUMP_VINSN_COUNT = 8,
  74. /* Dump the cost (default latency) of the insn behind this vinsn. */
  75. DUMP_VINSN_COST = 16,
  76. /* Dump all of the above. */
  77. DUMP_VINSN_ALL = (DUMP_VINSN_INSN_RTX | DUMP_VINSN_TYPE | DUMP_VINSN_COUNT
  78. | DUMP_VINSN_COST)
  79. };
  80. extern void dump_vinsn_1 (vinsn_t, int);
  81. extern void dump_vinsn (vinsn_t);
  82. extern void debug_vinsn (vinsn_t);
  83. extern void debug (vinsn_def &ref);
  84. extern void debug (vinsn_def *ptr);
  85. extern void debug_verbose (vinsn_def &ref);
  86. extern void debug_verbose (vinsn_def *ptr);
  87. /* These values control dumping of expressions. The meaning of the fields
  88. is explained in sel-sched-ir.h. */
  89. enum dump_expr_def
  90. {
  91. /* Dump the vinsn behind this expression. */
  92. DUMP_EXPR_VINSN = 2,
  93. /* Dump expression's SPEC parameter. */
  94. DUMP_EXPR_SPEC = 4,
  95. /* Dump expression's priority. */
  96. DUMP_EXPR_PRIORITY = 8,
  97. /* Dump the number of times this expression was scheduled. */
  98. DUMP_EXPR_SCHED_TIMES = 16,
  99. /* Dump speculative status of the expression. */
  100. DUMP_EXPR_SPEC_DONE_DS = 32,
  101. /* Dump the basic block number which originated this expression. */
  102. DUMP_EXPR_ORIG_BB = 64,
  103. /* Dump expression's usefulness. */
  104. DUMP_EXPR_USEFULNESS = 128,
  105. /* Dump all of the above. */
  106. DUMP_EXPR_ALL = (DUMP_EXPR_VINSN | DUMP_EXPR_SPEC | DUMP_EXPR_PRIORITY
  107. | DUMP_EXPR_SCHED_TIMES | DUMP_EXPR_SPEC_DONE_DS
  108. | DUMP_EXPR_ORIG_BB | DUMP_EXPR_USEFULNESS)
  109. };
  110. extern void dump_expr_1 (expr_t, int);
  111. extern void dump_expr (expr_t);
  112. extern void debug_expr (expr_t);
  113. extern void debug (expr_def &ref);
  114. extern void debug (expr_def *ptr);
  115. extern void debug_verbose (expr_def &ref);
  116. extern void debug_verbose (expr_def *ptr);
  117. /* A enumeration for dumping flags of an insn. The difference from
  118. dump_insn_rtx_def is that these fields are for insns in stream only. */
  119. enum dump_insn_def
  120. {
  121. /* Dump expression of this insn. */
  122. DUMP_INSN_EXPR = 2,
  123. /* Dump insn's seqno. */
  124. DUMP_INSN_SEQNO = 4,
  125. /* Dump the cycle on which insn was scheduled. */
  126. DUMP_INSN_SCHED_CYCLE = 8,
  127. /* Dump insn's UID. */
  128. DUMP_INSN_UID = 16,
  129. /* Dump insn's pattern. */
  130. DUMP_INSN_PATTERN = 32,
  131. /* Dump insn's basic block number. */
  132. DUMP_INSN_BBN = 64,
  133. /* Dump all of the above. */
  134. DUMP_INSN_ALL = (DUMP_INSN_EXPR | DUMP_INSN_SEQNO | DUMP_INSN_BBN
  135. | DUMP_INSN_SCHED_CYCLE | DUMP_INSN_UID | DUMP_INSN_PATTERN)
  136. };
  137. extern void dump_insn_1 (insn_t, int);
  138. extern void dump_insn (insn_t);
  139. extern void debug_insn (insn_t);
  140. /* When this flag is on, we are dumping to the .dot file.
  141. When it is off, we are dumping to log. */
  142. extern bool sched_dump_to_dot_p;
  143. /* Functions from sel-sched-dump.c. */
  144. extern void sel_print (const char *fmt, ...) ATTRIBUTE_PRINTF_1;
  145. extern const char * sel_print_insn (const rtx_insn *, int);
  146. extern void free_sel_dump_data (void);
  147. extern void block_start (void);
  148. extern void block_finish (void);
  149. extern int get_print_blocks_num (void);
  150. extern void line_start (void);
  151. extern void line_finish (void);
  152. extern void sel_print_rtl (rtx x);
  153. extern void dump_insn_1 (insn_t, int);
  154. extern void dump_insn (insn_t);
  155. extern void dump_insn_vector (rtx_vec_t);
  156. extern void dump_expr (expr_t);
  157. extern void dump_used_regs (bitmap);
  158. extern void dump_av_set (av_set_t);
  159. extern void dump_lv_set (regset);
  160. extern void dump_blist (blist_t);
  161. extern void dump_flist (flist_t);
  162. extern void dump_hard_reg_set (const char *, HARD_REG_SET);
  163. extern void sel_debug_cfg_1 (int);
  164. extern void sel_debug_cfg (void);
  165. extern void setup_dump_cfg_params (void);
  166. /* Debug functions. */
  167. extern void debug_expr (expr_t);
  168. extern void debug_av_set (av_set_t);
  169. extern void debug_lv_set (regset);
  170. extern void debug_ilist (ilist_t);
  171. extern void debug_blist (blist_t);
  172. extern void debug (vec<rtx> &ref);
  173. extern void debug (vec<rtx> *ptr);
  174. extern void debug_insn_vector (rtx_vec_t);
  175. extern void debug_hard_reg_set (HARD_REG_SET);
  176. extern rtx debug_mem_addr_value (rtx);
  177. #endif