aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple-range-edge.cc
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2021-12-06 18:29:31 +0000
committerRichard Sandiford <richard.sandiford@arm.com>2021-12-06 18:29:31 +0000
commit63c59f054a5cd6d356ad8bce79182ab205b7aa43 (patch)
tree5527a2db354d9a14fc0a562bd663cf251cbe6770 /gcc/gimple-range-edge.cc
parentd27b7e69872b34890077e3dff291b4bcbc52e4cd (diff)
downloadgcc-63c59f054a5cd6d356ad8bce79182ab205b7aa43.zip
gcc-63c59f054a5cd6d356ad8bce79182ab205b7aa43.tar.gz
gcc-63c59f054a5cd6d356ad8bce79182ab205b7aa43.tar.bz2
ranger: Add shortcuts for single-successor blocks
When compiling an optabs.ii at -O2 with a release-checking build, there were 6,643,575 calls to gimple_outgoing_range_stmt_p. 96.8% of them were for blocks with a single successor, which never have a control statement that generates new range info. This patch therefore adds a shortcut for that case. This gives a ~1% compile-time improvement for the test. I tried making the function inline (in the header) so that the single_succ_p didn't need to be repeated, but it seemed to make things slightly worse. gcc/ * gimple-range-edge.cc (gimple_outgoing_range::edge_range_p): Add a shortcut for blocks with single successors. * gimple-range-gori.cc (gori_map::calculate_gori): Likewise.
Diffstat (limited to 'gcc/gimple-range-edge.cc')
-rw-r--r--gcc/gimple-range-edge.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/gimple-range-edge.cc b/gcc/gimple-range-edge.cc
index afffc8d..9e80523 100644
--- a/gcc/gimple-range-edge.cc
+++ b/gcc/gimple-range-edge.cc
@@ -182,6 +182,9 @@ gimple_outgoing_range::calc_switch_ranges (gswitch *sw)
gimple *
gimple_outgoing_range::edge_range_p (irange &r, edge e)
{
+ if (single_succ_p (e->src))
+ return NULL;
+
// Determine if there is an outgoing edge.
gimple *s = gimple_outgoing_range_stmt_p (e->src);
if (!s)