diff mbox series

Fix compile-time of PR89115

Message ID alpine.LSU.2.20.1901301342360.23386@zhemvz.fhfr.qr
State New
Headers show
Series Fix compile-time of PR89115 | expand

Commit Message

Richard Biener Jan. 30, 2019, 12:45 p.m. UTC
The PR89115 spends ~66% of its compile-time in LRA reload inheritance
because of a weak hash and a lot of collisions in the invaraints hash.

This can be fixed by the following, bringing down inheritance time
to the noise.

Bootstrap / regtest running on x86_64-unknown-linux-gnu, OK for trunk
(and branches?)?

The hash function is still weak but w/o a testcase I don't think
it's worth slowing it down further.

Thanks,
Richard.

2019-01-30  Richard Biener  <rguenther@suse.de>

	PR rtl-optimization/89115
	* lra.c (lra_rtx_hash): Properly hash CONST_INT values.

Comments

Vladimir Makarov Jan. 30, 2019, 2:24 p.m. UTC | #1
On 01/30/2019 07:45 AM, Richard Biener wrote:
> The PR89115 spends ~66% of its compile-time in LRA reload inheritance
> because of a weak hash and a lot of collisions in the invaraints hash.
>
> This can be fixed by the following, bringing down inheritance time
> to the noise.
>
> Bootstrap / regtest running on x86_64-unknown-linux-gnu, OK for trunk
> (and branches?)?
Yes, sure.  Thank you, Richard.
> The hash function is still weak but w/o a testcase I don't think
> it's worth slowing it down further.
>
> Thanks,
> Richard.
>
> 2019-01-30  Richard Biener  <rguenther@suse.de>
>
> 	PR rtl-optimization/89115
> 	* lra.c (lra_rtx_hash): Properly hash CONST_INT values.
>
> Index: gcc/lra.c
> ===================================================================
> --- gcc/lra.c	(revision 268383)
> +++ gcc/lra.c	(working copy)
> @@ -1719,10 +1719,12 @@ lra_rtx_hash (rtx x)
>   
>       case SCRATCH:
>       case CONST_DOUBLE:
> -    case CONST_INT:
>       case CONST_VECTOR:
>         return val;
>   
> +    case CONST_INT:
> +      return val + UINTVAL (x);
> +
>       default:
>         break;
>       }
diff mbox series

Patch

Index: gcc/lra.c
===================================================================
--- gcc/lra.c	(revision 268383)
+++ gcc/lra.c	(working copy)
@@ -1719,10 +1719,12 @@  lra_rtx_hash (rtx x)
 
     case SCRATCH:
     case CONST_DOUBLE:
-    case CONST_INT:
     case CONST_VECTOR:
       return val;
 
+    case CONST_INT:
+      return val + UINTVAL (x);
+
     default:
       break;
     }