[RFC] Propose Updating Basic Block Checking Limits in variable_tracking_main_1

Message ID 20200618183242.4029-1-xerofoify@gmail.com
State New
Headers show
Series
  • [RFC] Propose Updating Basic Block Checking Limits in variable_tracking_main_1
Related show

Commit Message

Jakub Jelinek via Gcc-patches June 18, 2020, 6:32 p.m.
From: Nicholas Krause <xerofoify@gmail.com>


Changelog:gcc/
	*var-tracking.c(variable_tracking_main): Update
	numbers for both number of basic blocks per
	function and number of edges per function to 
	basic blocks to more sane numbers, in order to 
	avoid extra edge cases.

Signed-off-by: Nicholas Krause <xerofoify@gmail.com>

---
 gcc/var-tracking.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
1.8.3.1

Comments

Jakub Jelinek via Gcc-patches June 18, 2020, 6:34 p.m. | #1
On 6/18/20 2:32 PM, Nicholas Krause wrote:
> From: Nicholas Krause <xerofoify@gmail.com>

> 

> Changelog:gcc/

> 	*var-tracking.c(variable_tracking_main): Update

> 	numbers for both number of basic blocks per

> 	function and number of edges per function to

> 	basic blocks to more sane numbers, in order to

> 	avoid extra edge cases.

> 

> Signed-off-by: Nicholas Krause <xerofoify@gmail.com>

> ---

>   gcc/var-tracking.c | 4 ++--

>   1 file changed, 2 insertions(+), 2 deletions(-)

> 

> diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c

> index fc861a0..9cf1b5d 100644

> --- a/gcc/var-tracking.c

> +++ b/gcc/var-tracking.c

> @@ -10470,8 +10470,8 @@ variable_tracking_main_1 (void)

>     if (!flag_var_tracking)

>       return 0;

>   

> -  if (n_basic_blocks_for_fn (cfun) > 500

> -      && n_edges_for_fn (cfun) / n_basic_blocks_for_fn (cfun) >= 20)

> +  if (n_basic_blocks_for_fn (cfun) > 10000

> +      && n_edges_for_fn (cfun) / n_basic_blocks_for_fn (cfun) >= 500)

>       {

>         vt_debug_insns_local (true);

>         return 0;

> 


Commit message seems to not have been added. Sorry about that:

This proposes based on issues reported in PR93092 to update
the check for basic blocks and the ratio of it to edges in
variable_tracking_main_1 in order to avoid edge cases as
found in the reported PR with huge numbers of edges or
basic blocks per function. Therefore update the numbers
to a more sane limit, while preserving the current ratio
of 25:1 for basic blocks per function to edges per function.

Changelog:gcc/
	*var-tracking.c(variable_tracking_main): Update
	numbers for both number of basic blocks per
	function and number of edges per function to
	basic blocks to more sane numbers, in order to
	avoid extra edge cases.

Signed-off-by: Nicholas Krause <xerofoify@gmail.com>

---
  gcc/var-tracking.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c
index fc861a0..9cf1b5d 100644
--- a/gcc/var-tracking.c
+++ b/gcc/var-tracking.c
@@ -10470,8 +10470,8 @@ variable_tracking_main_1 (void)
    if (!flag_var_tracking)
      return 0;

-  if (n_basic_blocks_for_fn (cfun) > 500
-      && n_edges_for_fn (cfun) / n_basic_blocks_for_fn (cfun) >= 20)
+  if (n_basic_blocks_for_fn (cfun) > 10000
+      && n_edges_for_fn (cfun) / n_basic_blocks_for_fn (cfun) >= 500)
      {
        vt_debug_insns_local (true);
        return 0;
-- 
1.8.3.1


-- 
Fundamentally an organism has conscious mental states if and only if 
there is something that it is like to be that organism--something it is 
like for the organism. - Thomas Nagel

Patch

diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c
index fc861a0..9cf1b5d 100644
--- a/gcc/var-tracking.c
+++ b/gcc/var-tracking.c
@@ -10470,8 +10470,8 @@  variable_tracking_main_1 (void)
   if (!flag_var_tracking)
     return 0;
 
-  if (n_basic_blocks_for_fn (cfun) > 500
-      && n_edges_for_fn (cfun) / n_basic_blocks_for_fn (cfun) >= 20)
+  if (n_basic_blocks_for_fn (cfun) > 10000
+      && n_edges_for_fn (cfun) / n_basic_blocks_for_fn (cfun) >= 500)
     {
       vt_debug_insns_local (true);
       return 0;