This patch sanitizes the partitioning to address issues such as edge weight insanitie...
authorTeresa Johnson <tejohnson@google.com>
Sat, 31 Aug 2013 01:43:33 +0000 (01:43 +0000)
committerTeresa Johnson <tejohnson@gcc.gnu.org>
Sat, 31 Aug 2013 01:43:33 +0000 (01:43 +0000)
commit600b5b1d5cb381a652a9b57445b27793304e954f
tree5309c6fb7e215165052af90d314125c561039563
parent7b55c620f002242dfa035572deb1bd1ed9c97dd7
This patch sanitizes the partitioning to address issues such as edge weight insanities that sometimes occur due to upstream optimizations...

This patch sanitizes the partitioning to address issues such as edge
weight insanities that sometimes occur due to upstream optimizations,
and ensures that hot blocks are not dominated by cold blocks. This
needs to be resanitized after certain cfg optimizations that may
cause hot blocks previously reached via both hot and cold paths to
only be reached by cold paths.

The verification code in sanitize_dominator_hotness was contributed by
Steven Bosscher.

2013-08-29  Teresa Johnson  <tejohnson@google.com>
            Steven Bosscher  <steven@gcc.gnu.org>

* cfgrtl.c (fixup_new_cold_bb): New routine.
(commit_edge_insertions): Invoke fixup_partitions.
(find_partition_fixes): New routine.
(fixup_partitions): Ditto.
(verify_hot_cold_block_grouping): Update comments.
(rtl_verify_edges): Invoke find_partition_fixes.
(rtl_verify_bb_pointers): Update comments.
(rtl_verify_bb_layout): Ditto.
* basic-block.h (probably_never_executed_edge_p): Declare.
        (fixup_partitions): Ditto.
* cfgcleanup.c (try_optimize_cfg): Invoke fixup_partitions.
* bb-reorder.c (sanitize_hot_paths): New function.
        (find_rarely_executed_basic_blocks_and_crossing_edges): Invoke
        sanitize_hot_paths.
* predict.c (probably_never_executed_edge_p): New routine.
* cfg.c (check_bb_profile): Add partition insanity warnings.

Co-Authored-By: Steven Bosscher <steven@gcc.gnu.org>
From-SVN: r202125
gcc/ChangeLog
gcc/basic-block.h
gcc/bb-reorder.c
gcc/cfg.c
gcc/cfgcleanup.c
gcc/cfgrtl.c
gcc/predict.c