diff options
author | ctice <ctice@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-08-25 19:52:54 +0000 |
---|---|---|
committer | ctice <ctice@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-08-25 19:52:54 +0000 |
commit | 1118aef745a25250fb86472ad8a585f335a233cf (patch) | |
tree | a5867d1e566bb25285998220b8ed1c4261740f02 /gcc/ifcvt.c | |
parent | 63bd12e19c98ff38073b1d971a736999c7bfaedc (diff) | |
download | gcc-1118aef745a25250fb86472ad8a585f335a233cf.tar.gz |
Add more details to hot/cold partitioning comments and documentation.
2004-08-25 Caroline Tice <ctice@apple.com>
* bb-reorder.c (partition_hot_cold_basic_blocks): Add more details
to comments at start of function.
* cfgbuild.c (make_edges): Add more details to hot/cold partitioning
comment.
* cfgcleanup.c (try_simplify_condjump, try_forward_edges,
merge_blocks_move_predecessor_nojumps,
merge_blocks_move_successor_nojumps, merge_blocks_move,
try_crossjump_to_edge, try_crossjump_bb): Likewise.
* cfglayout.c (fixup_reorder_chain): Likewise.
* cfgrtl.c (rtl_can_merge_blocks, try_redirect_by_replacing_jump,
cfg_layout_can_merge_blocks_p): Likewise.
* ifcvt.c (find_if_case_1, find_if_case_2): Likewise.
* passes.c (rest_of_compilation): Update comments for calling
optimization that partitions hot/cold basic blocks.
* doc/invoke.texi: Update documentation of
freorder-blocks-and-partition flag.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@86570 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ifcvt.c')
-rw-r--r-- | gcc/ifcvt.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c index 2711f1b516d..7473054757f 100644 --- a/gcc/ifcvt.c +++ b/gcc/ifcvt.c @@ -2850,8 +2850,14 @@ find_if_case_1 (basic_block test_bb, edge then_edge, edge else_edge) /* If we are partitioning hot/cold basic blocks, we don't want to mess up unconditional or indirect jumps that cross between hot - and cold sections. */ + and cold sections. + Basic block partitioning may result in some jumps that appear to + be optimizable (or blocks that appear to be mergeable), but which really + must be left untouched (they are required to make it safely across + partition boundaries). See the comments at the top of + bb-reorder.c:partition_hot_cold_basic_blocks for complete details. */ + if (flag_reorder_blocks_and_partition && ((BB_END (then_bb) && find_reg_note (BB_END (then_bb), REG_CROSSING_JUMP, NULL_RTX)) @@ -2909,6 +2915,9 @@ find_if_case_1 (basic_block test_bb, edge then_edge, edge else_edge) { new_bb->index = then_bb_index; BASIC_BLOCK (then_bb_index) = new_bb; + /* Since the fallthru edge was redirected from test_bb to new_bb, + we need to ensure that new_bb is in the same partition as + test bb (you can not fall through across section boundaries). */ BB_COPY_PARTITION (new_bb, test_bb); } /* We've possibly created jump to next insn, cleanup_cfg will solve that @@ -2933,8 +2942,14 @@ find_if_case_2 (basic_block test_bb, edge then_edge, edge else_edge) /* If we are partitioning hot/cold basic blocks, we don't want to mess up unconditional or indirect jumps that cross between hot - and cold sections. */ + and cold sections. + Basic block partitioning may result in some jumps that appear to + be optimizable (or blocks that appear to be mergeable), but which really + must be left untouched (they are required to make it safely across + partition boundaries). See the comments at the top of + bb-reorder.c:partition_hot_cold_basic_blocks for complete details. */ + if (flag_reorder_blocks_and_partition && ((BB_END (then_bb) && find_reg_note (BB_END (then_bb), REG_CROSSING_JUMP, NULL_RTX)) |