cfg-flags.def 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. /* Flags on basic blocks and edges.
  2. Copyright (C) 2012-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. /* This file defines flags that may appear on basic blocks or on
  16. edges. Source files define DEF_BASIC_BLOCK_FLAG or DEF_EDGE_FLAG
  17. appropriately before including this file. */
  18. #if !defined(DEF_BASIC_BLOCK_FLAG) && !defined(DEF_EDGE_FLAG)
  19. #error "You must define DEF_BASIC_BLOCK_FLAG or DEF_EDGE_FLAG"
  20. #endif
  21. #ifdef DEF_BASIC_BLOCK_FLAG
  22. /* Masks for basic_block.flags.
  23. The format of this file is: DEF_BASIC_BLOCK_FLAG(NAME, IDX).
  24. NAME is the name of the basic block flag. A flag BB_#NAME will be
  25. created and the name is used in dump_edge_info.
  26. IDX is a sequence number that is used to determine the value
  27. of the flag, which is 1 << IDX).
  28. BB_HOT_PARTITION and BB_COLD_PARTITION should be preserved throughout
  29. the compilation, so they are never cleared.
  30. All other flags may be cleared by clear_bb_flags(). It is generally
  31. a bad idea to rely on any flags being up-to-date. */
  32. /* Only set on blocks that have just been created by create_bb. */
  33. DEF_BASIC_BLOCK_FLAG(NEW, 0)
  34. /* Set by find_unreachable_blocks. Do not rely on this being set in any
  35. pass. */
  36. DEF_BASIC_BLOCK_FLAG(REACHABLE, 1)
  37. /* Set for blocks in an irreducible loop by loop analysis. */
  38. DEF_BASIC_BLOCK_FLAG(IRREDUCIBLE_LOOP, 2)
  39. /* Set on blocks that may actually not be single-entry single-exit block. */
  40. DEF_BASIC_BLOCK_FLAG(SUPERBLOCK, 3)
  41. /* Set on basic blocks that the scheduler should not touch. This is used
  42. by SMS to prevent other schedulers from messing with the loop schedule. */
  43. DEF_BASIC_BLOCK_FLAG(DISABLE_SCHEDULE, 4)
  44. /* Set on blocks that should be put in a hot section. */
  45. DEF_BASIC_BLOCK_FLAG(HOT_PARTITION, 5)
  46. /* Set on blocks that should be put in a cold section. */
  47. DEF_BASIC_BLOCK_FLAG(COLD_PARTITION, 6)
  48. /* Set on block that was duplicated. */
  49. DEF_BASIC_BLOCK_FLAG(DUPLICATED, 7)
  50. /* Set if the label at the top of this block is the target of a non-local goto. */
  51. DEF_BASIC_BLOCK_FLAG(NON_LOCAL_GOTO_TARGET, 8)
  52. /* Set on blocks that are in RTL format. */
  53. DEF_BASIC_BLOCK_FLAG(RTL, 9)
  54. /* Set on blocks that are forwarder blocks.
  55. Only used in cfgcleanup.c. */
  56. DEF_BASIC_BLOCK_FLAG(FORWARDER_BLOCK, 10)
  57. /* Set on blocks that cannot be threaded through.
  58. Only used for jump threading. */
  59. DEF_BASIC_BLOCK_FLAG(NONTHREADABLE_BLOCK, 11)
  60. /* Set on blocks that were modified in some way. This bit is set in
  61. df_set_bb_dirty, but not cleared by df_analyze, so it can be used
  62. to test whether a block has been modified prior to a df_analyze call. */
  63. DEF_BASIC_BLOCK_FLAG(MODIFIED, 12)
  64. /* A general visited flag for passes to use. */
  65. DEF_BASIC_BLOCK_FLAG(VISITED, 13)
  66. /* Set on blocks that are in a transaction. This is calculated on
  67. demand, and is available after calling compute_transaction_bits(). */
  68. DEF_BASIC_BLOCK_FLAG(IN_TRANSACTION, 14)
  69. #endif
  70. #ifdef DEF_EDGE_FLAG
  71. /* Masks for edge.flags.
  72. The format of this file is: DEF_EDGE_FLAG(NAME, IDX, STRING).
  73. NAME is the name of the edge flag. A flag EDGE_#NAME will be
  74. created and the name is used in dump_edge_info.
  75. IDX is a sequence number that is used to determine the value
  76. of the flag, which is 1 << IDX). */
  77. /* 'Straight line' flow. In GIMPLE and in cfglayout mode, all normal
  78. edges are fallthru edges. In cfgrtl mode, this flag really means
  79. that control flow falls through to the next basic block in the line. */
  80. DEF_EDGE_FLAG(FALLTHRU, 0)
  81. /* Strange flow, like a computed jump or exception handling. Usually
  82. this means that the edge cannot be split. */
  83. DEF_EDGE_FLAG(ABNORMAL, 1)
  84. /* Edge out of a basic block that ends with a CALL_INSN with abnormal
  85. exit, like an exception or a non-local goto.
  86. ABNORMAL_CALL edges also have ABNORMAL set.
  87. This flag is only used for the RTL CFG. */
  88. DEF_EDGE_FLAG(ABNORMAL_CALL, 2)
  89. /* Exception edge. Exception handling edges represent possible control
  90. transfers from a trapping instruction to an exception handler.
  91. EH edges also have ABNORMAL set for the RTL CFG. */
  92. DEF_EDGE_FLAG(EH, 3)
  93. /* Never merge blocks via this edge. This is used for exception handling,
  94. to prevent merging away edges to the post-landing-pad basic block.
  95. This flag is only used for the RTL CFG. */
  96. DEF_EDGE_FLAG(PRESERVE, 4)
  97. /* Not a real edge. This is used to connect parts of the CFG that do
  98. not halt, such as infinite loops and noreturn functions, to the
  99. EXIT_BLOCK, so that traversing of the reverse CFG is possible. */
  100. DEF_EDGE_FLAG(FAKE, 5)
  101. /* A back edge, marked in a depth-first search of the CFG. Back edges
  102. are hints that this edge may be part of a loop in the CFG. */
  103. DEF_EDGE_FLAG(DFS_BACK, 6)
  104. /* Edge in a part of the CFG that is an irreducible loop. */
  105. DEF_EDGE_FLAG(IRREDUCIBLE_LOOP, 7)
  106. /* Edge taken when controlling predicate is nonzero.
  107. This is only used for the GIMPLE CFG. */
  108. DEF_EDGE_FLAG(TRUE_VALUE, 8)
  109. /* Edge taken when controlling predicate is zero.
  110. This is only used for the GIMPLE CFG. */
  111. DEF_EDGE_FLAG(FALSE_VALUE, 9)
  112. /* Edge is executable. This is only used in GIMPLE SSA-CCP and VRP.
  113. This is only used for the GIMPLE CFG. */
  114. DEF_EDGE_FLAG(EXECUTABLE, 10)
  115. /* Edge crosses between hot and cold sections, when we do partitioning.
  116. This flag is only used for the RTL CFG. */
  117. DEF_EDGE_FLAG(CROSSING, 11)
  118. /* Edge from a sibcall CALL_INSN to exit.
  119. SIBCALL edges also have ABNORMAL set.
  120. This flag is only used for the RTL CFG. */
  121. DEF_EDGE_FLAG(SIBCALL, 12)
  122. /* Candidate for straight line flow. Only used in bb-reorder.c.
  123. This flag is only used for the RTL CFG. */
  124. DEF_EDGE_FLAG(CAN_FALLTHRU, 13)
  125. /* Exit of a loop. This is only used in ifcvt.c.
  126. This flag is only used for the RTL CFG. */
  127. DEF_EDGE_FLAG(LOOP_EXIT, 14)
  128. /* Uninstrumented edge out of a GIMPLE_TRANSACTION statement. */
  129. DEF_EDGE_FLAG(TM_UNINSTRUMENTED, 15)
  130. /* Abort (over) edge out of a GIMPLE_TRANSACTION statement. */
  131. DEF_EDGE_FLAG(TM_ABORT, 16)
  132. /* An edge we should ignore. It should be entirely local to
  133. passes. ie, it is never set on any edge upon the completion
  134. of any pass. */
  135. DEF_EDGE_FLAG(IGNORE, 17)
  136. #endif
  137. /*
  138. Local variables:
  139. mode:c
  140. End:
  141. */