sel-sched-dump.h 6.8 KB

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