diff options
author | steven <steven@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-07-17 23:17:20 +0000 |
---|---|---|
committer | steven <steven@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-07-17 23:17:20 +0000 |
commit | 5147ec0758d033a3f21f831c878ec8fa5dcd2a94 (patch) | |
tree | 9d5c1ea84c526379245c9986d831f4ce16757d79 /gcc/cfg-flags.def | |
parent | f25dbbf707698795ff642f32c290d25d5c356975 (diff) | |
download | gcc-5147ec0758d033a3f21f831c878ec8fa5dcd2a94.tar.gz |
* dumpfile.h (TDF_COMMENT): New define.
* basic-block.h (EDGE_FALLTHRU, EDGE_ABNORMAL, EDGE_ABNORMAL_CALL,
EDGE_EH, EDGE_FAKE, EDGE_DFS_BACK, EDGE_CAN_FALLTHRU,
EDGE_IRREDUCIBLE_LOOP, EDGE_SIBCALL, EDGE_LOOP_EXIT, EDGE_TRUE_VALUE,
EDGE_FALSE_VALUE, EDGE_EXECUTABLE, EDGE_CROSSING, EDGE_PRESERVE):
Move to new file cfg-flags.h.
(enum cfg_edge_flags): New enum, using cfg-flags.h.
(EDGE_ALL_FLAGS): Compute value automatically.
(BB_NEW, BB_REACHABLE, BB_IRREDUCIBLE_LOOP, BB_SUPERBLOCK,
BB_DISABLE_SCHEDULE, BB_HOT_PARTITION, BB_COLD_PARTITION,
BB_DUPLICATED, BB_NON_LOCAL_GOTO_TARGET, BB_RTL,
BB_FORWARDER_BLOCK, BB_NONTHREADABLE_BLOCK, BB_MODIFIED, BB_VISITED,
BB_IN_TRANSACTION): Move to new file cfg-flags.h.
(enum bb_flags): Rename to cfg_bb_flags. Use cfg-flags.h.
(BB_ALL_FLAGS): New, compute value automatically.
(dump_bb_info): Update prototype.
(dump_edge_info): Update prototype.
* cfg-flags.h: New file.
* cfg.c (dump_edge_info): Take flags argument. Be verbose only if
TDF_DETAILS and not TDF_SLIM. Include cfg-flags.h for bitnames.
Check that the edge flags are within the range of EDGE_ALL_FLAGS.
(debug_bb): Update dump_bb call.
(dump_cfg_bb_info): Remove.
(dump_bb_info): New function. Use cfg-flags.h for bitnames.
Adjust verbosity using TDF_* flags. Check that the basic block flags
are within the range of BB_ALL_FLAGS.
(brief_dump_cfg): Use dump_bb_info instead of dump_cfg_bb_info.
* cfghooks.h (struct cfghooks): Update dump_bb hook, take a FILE
first for consistency with other dump functions.
(dump_bb): Update prototype accordingly.
* cfghooks.c: Include dumpfile.h.
(verify_flow_info): Update dump_edge_info calls.
(dump_bb): Take a flags argument and pass it around.
Use dump_bb_info to dump common information about a basic block.
(dump_flow_info): Moved here from cfgrtl.c. Make IL agnostic.
(debug_flow_info): Moved here from cfgrtl.c.
* profile.c (is_edge_inconsistent): Update dump_bb calls.
* loop-invariant.c (find_defs): Update print_rtl_with_bb call.
* rtl.h (debug_bb_n_slim, debug_bb_slim, print_rtl_slim,
print_rtl_slim_with_bb): Remove prototypes.
(dump_insn_slim): Adjust prototype to take a const_rtx.
(print_rtl_with_bb): Adjust prototype.
* sched-rgn.c (debug_region): Use dump_bb instead of debug_bb_n_slim.
* sched-vis.c (dump_insn_slim): Take a const_rtx.
(debug_insn_slim): Prototype here near DEBUG_FUNCTION marker.
(print_rtl_slim_with_bb): Remove.
(print_rtl_slim): Rename to debug_rtl_slim. Print only insn info,
not basic block info (print_rtl_with_bb with TDF_SLIM should be used
for that. Prototype here near DEBUG_FUNCTION marker.
(debug_bb_slim): Prototype here near DEBUG_FUNCTION marker.
Use dump_bb.
(debug_bb_n_slim): Prototype here near DEBUG_FUNCTION marker.
* tree-cfg.c (gimple_can_merge_blocks_p): Use EDGE_COMPLEX.
(remove_bb): Update dump_bb call.
(gimple_debug_bb): Use dump_bb.
(dump_function_to_file): Update gimple_dump_bb call.
(print_loops_bb): Likewise.
* tree-flow.h (gimple_dump_bb): Update prototype.
* gimple-pretty-print.c (dump_bb_header): Rename to
dump_gimple_bb_header. Write to a stream instead of a pretty
printer. Use dump_bb_info to dump basic block info.
(dump_bb_end): Rename to dump_gimple_bb_footer. Write to a
stream instead of a pretty printer. Use dump_bb_info.
(gimple_dump_bb_buff): Do not call dump_bb_header and dump_bb_end.
(gimple_dump_bb): Do it here with dump_gimple_bb_header and
dump_gimple_bb_footer.
* cfgrtl.c (rtl_dump_bb): Update prototype. Only dump DF if the
dump flags have TDF_DETAILS. Use dump_insn_slim if TDF_SLIM.
(print_rtl_with_bb): Take a flags argument and pass it around.
Use dump_insn_slim if TDF_SLIM.
(dump_bb_info): Removed and re-incarnated in cfg.c.
(dump_flow_info): Moved to cfghooks.c.
(debug_flow_info): Moved to cfghooks.c.
* passes.c (execute_function_dump): Unconditionally use
print_rtl_with_bb for RTL dumps, now that it understands TDF_SLIM.
* final.c (dump_basic_block_info): Update dump_edge_info calls.
* tree-vrp.c (dump_asserts_for): Likewise.
* ifcvt.c (if_convert): Unconditionally use print_rtl_with_bb.
* tree-if-conv.c (if_convertible_bb_p): Don't look at
EDGE_ABNORMAL_CALL, it has no meaning in the GIMPLE world.
* trans-mem.c (make_tm_edge): Don't set EDGE_ABNORMAL_CALL,
for the same reason.
* config/rl78/rl78.c (rl78_reorg): Update print_rtl_with_bb calls.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@189590 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfg-flags.def')
-rw-r--r-- | gcc/cfg-flags.def | 179 |
1 files changed, 179 insertions, 0 deletions
diff --git a/gcc/cfg-flags.def b/gcc/cfg-flags.def new file mode 100644 index 00000000000..a9aaf186ec1 --- /dev/null +++ b/gcc/cfg-flags.def @@ -0,0 +1,179 @@ +/* Flags on basic blocks and edges. + Copyright (C) 2012 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 3, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING3. If not see +<http://www.gnu.org/licenses/>. */ + +/* This file defines flags that may appear on basic blocks or on + edges. Source files define DEF_BASIC_BLOCK_FLAG or DEF_EDGE_FLAG + appropriately before including this file. */ + +#if !defined(DEF_BASIC_BLOCK_FLAG) && !defined(DEF_EDGE_FLAG) +#error "You must define DEF_BASIC_BLOCK_FLAG or DEF_EDGE_FLAG" +#endif + +#ifdef DEF_BASIC_BLOCK_FLAG + +/* Masks for basic_block.flags. + + The format of this file is: DEF_BASIC_BLOCK_FLAG(NAME, IDX). + NAME is the name of the basic block flag. A flag BB_#NAME will be + created and the name is used in dump_edge_info. + IDX is a sequence number that is used to determine the value + of the flag, which is 1 << IDX). + + BB_HOT_PARTITION and BB_COLD_PARTITION should be preserved throughout + the compilation, so they are never cleared. + + All other flags may be cleared by clear_bb_flags(). It is generally + a bad idea to rely on any flags being up-to-date. */ + +/* Only set on blocks that have just been created by create_bb. */ +DEF_BASIC_BLOCK_FLAG(NEW, 0) + +/* Set by find_unreachable_blocks. Do not rely on this being set in any + pass. */ +DEF_BASIC_BLOCK_FLAG(REACHABLE, 1) + +/* Set for blocks in an irreducible loop by loop analysis. */ +DEF_BASIC_BLOCK_FLAG(IRREDUCIBLE_LOOP, 2) + +/* Set on blocks that may actually not be single-entry single-exit block. */ +DEF_BASIC_BLOCK_FLAG(SUPERBLOCK, 3) + +/* Set on basic blocks that the scheduler should not touch. This is used + by SMS to prevent other schedulers from messing with the loop schedule. */ +DEF_BASIC_BLOCK_FLAG(DISABLE_SCHEDULE, 4) + +/* Set on blocks that should be put in a hot section. */ +DEF_BASIC_BLOCK_FLAG(HOT_PARTITION, 5) + +/* Set on blocks that should be put in a cold section. */ +DEF_BASIC_BLOCK_FLAG(COLD_PARTITION, 6) + +/* Set on block that was duplicated. */ +DEF_BASIC_BLOCK_FLAG(DUPLICATED, 7) + +/* Set if the label at the top of this block is the target of a non-local goto. */ +DEF_BASIC_BLOCK_FLAG(NON_LOCAL_GOTO_TARGET, 8) + +/* Set on blocks that are in RTL format. */ +DEF_BASIC_BLOCK_FLAG(RTL, 9) + +/* Set on blocks that are forwarder blocks. + Only used in cfgcleanup.c. */ +DEF_BASIC_BLOCK_FLAG(FORWARDER_BLOCK, 10) + +/* Set on blocks that cannot be threaded through. + Only used in cfgcleanup.c. */ +DEF_BASIC_BLOCK_FLAG(NONTHREADABLE_BLOCK, 11) + +/* Set on blocks that were modified in some way. This bit is set in + df_set_bb_dirty, but not cleared by df_analyze, so it can be used + to test whether a block has been modified prior to a df_analyze call. */ +DEF_BASIC_BLOCK_FLAG(MODIFIED, 12) + +/* A general visited flag for passes to use. */ +DEF_BASIC_BLOCK_FLAG(VISITED, 13) + +/* Set on blocks that are in a transaction. This is calculated on + demand, and is available after calling + compute_transaction_bits(). */ +DEF_BASIC_BLOCK_FLAG(IN_TRANSACTION, 14) + +#endif + +#ifdef DEF_EDGE_FLAG + +/* Masks for edge.flags. + + The format of this file is: DEF_EDGE_FLAG(NAME, IDX, STRING). + NAME is the name of the edge flag. A flag EDGE_#NAME will be + created and the name is used in dump_edge_info. + IDX is a sequence number that is used to determine the value + of the flag, which is 1 << IDX). */ + +/* 'Straight line' flow. In GIMPLE and in cfglayout mode, all normal + edges are fallthru edges. In cfgrtl mode, this flag really means + that control flow falls through to the next basic block in the line. */ +DEF_EDGE_FLAG(FALLTHRU, 0) + +/* Strange flow, like a computed jump or exception handling. Usually + this means that the edge cannot be split. */ +DEF_EDGE_FLAG(ABNORMAL, 1) + +/* Edge out of a basic block that ends with a CALL_INSN with abnormal + exit, like an exception, or a sibcall. + This flag is only used for the RTL CFG. */ +DEF_EDGE_FLAG(ABNORMAL_CALL, 2) + +/* Exception edge. Exception handling edges represent possible control + transfers from a trapping instruction to an exception handler. EH + edges also have EDGE_ABNORMAL set. */ +DEF_EDGE_FLAG(EH, 3) + +/* Never merge blocks via this edge. This is used for exception handling, + to prevent merging away edges to the post-landing-pad basic block. + This flag is only used for the RTL CFG. */ +DEF_EDGE_FLAG(PRESERVE, 4) + +/* Not a real edge. This is used to connect parts of the CFG that do + not halt, such as infinite loops and noreturn functions, to the + EXIT_BLOCK, so that traversing of the reverse CFG is possible. */ +DEF_EDGE_FLAG(FAKE, 5) + +/* A back edge, marked in a depth-first search of the CFG. Back edges + are hints that this edge may be part of a loop in the CFG. */ +DEF_EDGE_FLAG(DFS_BACK, 6) + +/* Edge in a part of the CFG that is an irreducible loop. */ +DEF_EDGE_FLAG(IRREDUCIBLE_LOOP, 7) + +/* Edge taken when controlling predicate is nonzero. + This is only used for the GIMPLE CFG. */ +DEF_EDGE_FLAG(TRUE_VALUE, 8) + +/* Edge taken when controlling predicate is zero. + This is only used for the GIMPLE CFG. */ +DEF_EDGE_FLAG(FALSE_VALUE, 9) + +/* Edge is executable. This is only used in GIMPLE SSA-CCP and VRP. + This is only used for the GIMPLE CFG. */ +DEF_EDGE_FLAG(EXECUTABLE, 10) + +/* Edge crosses between hot and cold sections, when we do partitioning. + This flag is only used for the RTL CFG. */ +DEF_EDGE_FLAG(CROSSING, 11) + +/* Edge from a sibcall CALL_INSN to exit. + This flag is only used for the RTL CFG. */ +DEF_EDGE_FLAG(SIBCALL, 12) + +/* Candidate for straight line flow. Only used in bb-reorder.c. + This flag is only used for the RTL CFG. */ +DEF_EDGE_FLAG(CAN_FALLTHRU, 13) + +/* Exit of a loop. This is only used in ifcvt.c. + This flag is only used for the RTL CFG. */ +DEF_EDGE_FLAG(LOOP_EXIT, 14) + +#endif + +/* +Local variables: +mode:c +End: +*/ |