aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfgexpand.cc
diff options
context:
space:
mode:
authorAndrew Pinski <quic_apinski@quicinc.com>2024-11-12 22:13:35 -0800
committerAndrew Pinski <quic_apinski@quicinc.com>2024-11-14 00:37:34 -0800
commit301dab51be5d8a3c690cd9b0cea462fb11a3ad4b (patch)
treeb4cbc48ed57823b86ecb29064f93d3edc26cd00e /gcc/cfgexpand.cc
parent879c1619ab5a708514cbb1f3754e59f30ba29e6c (diff)
downloadgcc-301dab51be5d8a3c690cd9b0cea462fb11a3ad4b.zip
gcc-301dab51be5d8a3c690cd9b0cea462fb11a3ad4b.tar.gz
gcc-301dab51be5d8a3c690cd9b0cea462fb11a3ad4b.tar.bz2
cfgexpand: Skip doing conflicts if there is only 1 variable
This is a small speed up. If there is only one know stack variable, there is no reason figure out the scope conflicts as there are none. So don't go through all the live range calculations just to see there are none. Bootstrapped and tested on x86_64-linux-gnu with no regressions. gcc/ChangeLog: * cfgexpand.cc (add_scope_conflicts): Return right away if there are only one stack variable. Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
Diffstat (limited to 'gcc/cfgexpand.cc')
-rw-r--r--gcc/cfgexpand.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/cfgexpand.cc b/gcc/cfgexpand.cc
index f3a33ff..ed890f6 100644
--- a/gcc/cfgexpand.cc
+++ b/gcc/cfgexpand.cc
@@ -703,6 +703,11 @@ add_scope_conflicts_1 (basic_block bb, bitmap work, bool for_conflict)
static void
add_scope_conflicts (void)
{
+ /* If there is only one variable, there is nothing to be done as
+ there is only possible partition. */
+ if (stack_vars_num == 1)
+ return;
+
basic_block bb;
bool changed;
bitmap work = BITMAP_ALLOC (NULL);