From patchwork Wed Jan 30 12:45:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 1033494 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-494945-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="Ia3kxRLc"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43qNQ72tNpz9sBZ for ; Wed, 30 Jan 2019 23:45:49 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; q=dns; s=default; b=UHBFvXo9XR+S9vedvxPBgJgokDICZea+TOLUY1Wb/vRQLlbQsm qxGu5OBO0lALJXZymoSdArNSOfY2s7WWCoK1JbD/cGfjjX8X/8Hb3HVywEkaZQk+ p/IZ9nxkzzi1G0mD8rCCSGLm0zuwSNT5CY4PaVHCaQ3DU8rjCcPl27c64= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; s= default; bh=fB78qIG2qJNUmxls0hPy0m4FPX4=; b=Ia3kxRLcj0YBWkFhhM8H HI1O10Jwk+w7E1kgDLXaxZuGoAQ2QZmJ+ImD8j5V4PtMzqZodVa+p33kEzq239aQ 5ASvD2hGERKxJUCKGY0FENRrqA0djMlI2+yQ0cDG8IVmBpRde1nXxhvfaMT43OEn LEI5HZqBNfzTtFniDgx1kHY= Received: (qmail 76988 invoked by alias); 30 Jan 2019 12:45:42 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 76979 invoked by uid 89); 30 Jan 2019 12:45:42 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.4 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, SPF_PASS autolearn=ham version=3.3.2 spammy=spends, Hx-languages-length:942 X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 30 Jan 2019 12:45:40 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id B13B7AE88; Wed, 30 Jan 2019 12:45:38 +0000 (UTC) Date: Wed, 30 Jan 2019 13:45:38 +0100 (CET) From: Richard Biener To: gcc-patches@gcc.gnu.org cc: vmakarov@redhat.com Subject: [PATCH] Fix compile-time of PR89115 Message-ID: User-Agent: Alpine 2.20 (LSU 67 2015-01-07) MIME-Version: 1.0 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 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; }