public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix compile-time of PR89115
@ 2019-01-30 13:20 Richard Biener
  2019-01-30 14:25 ` Vladimir Makarov
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Biener @ 2019-01-30 13:20 UTC (permalink / raw)
  To: gcc-patches; +Cc: vmakarov


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.

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;
     }

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fix compile-time of PR89115
  2019-01-30 13:20 [PATCH] Fix compile-time of PR89115 Richard Biener
@ 2019-01-30 14:25 ` Vladimir Makarov
  0 siblings, 0 replies; 2+ messages in thread
From: Vladimir Makarov @ 2019-01-30 14:25 UTC (permalink / raw)
  To: Richard Biener, gcc-patches



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;
>       }

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-01-30 14:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-30 13:20 [PATCH] Fix compile-time of PR89115 Richard Biener
2019-01-30 14:25 ` Vladimir Makarov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).