From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1666) id 3C922385E007; Wed, 14 Feb 2024 14:51:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3C922385E007 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1707922308; bh=LVlV1UkyhGMDLqRJkEeG/oU8yoP0Ou9OuZgimCA5Ztk=; h=From:To:Subject:Date:From; b=vYWA573AdTjxicysQhd2V9thMkMkgMF3pmx5qQxFj0u+pyj1AsjjdqRM7ctrqm9yD QhTv0s0cP9KuT7tsF76+wPg8BFEZDfyGnWX3dU6/FjkRsj5f3GGt9DHLKM0duIFfVw d/N1QAgMgKlnSsWlBXg9OWXWwb+N7uRlC22Ic+/U= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Richard Biener To: gcc-cvs@gcc.gnu.org Subject: [gcc r14-8980] tree-optimization/113910 - huge compile time during PTA X-Act-Checkin: gcc X-Git-Author: Richard Biener X-Git-Refname: refs/heads/master X-Git-Oldrev: a032c319cb9cf5348d71f008f311bcf95f3dac40 X-Git-Newrev: ad7a365aaccecd23ea287c7faaab9c7bd50b944a Message-Id: <20240214145148.3C922385E007@sourceware.org> Date: Wed, 14 Feb 2024 14:51:48 +0000 (GMT) List-Id: https://gcc.gnu.org/g:ad7a365aaccecd23ea287c7faaab9c7bd50b944a commit r14-8980-gad7a365aaccecd23ea287c7faaab9c7bd50b944a Author: Richard Biener Date: Wed Feb 14 12:33:13 2024 +0100 tree-optimization/113910 - huge compile time during PTA For the testcase in PR113910 we spend a lot of time in PTA comparing bitmaps for looking up equivalence class members. This points to the very weak bitmap_hash function which effectively hashes set and a subset of not set bits. The major problem with it is that it simply truncates the BITMAP_WORD sized intermediate hash to hashval_t which is unsigned int, effectively not hashing half of the bits. This reduces the compile-time for the testcase from tens of minutes to 42 seconds and PTA time from 99% to 46%. PR tree-optimization/113910 * bitmap.cc (bitmap_hash): Mix the full element "hash" to the hashval_t hash. Diff: --- gcc/bitmap.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/bitmap.cc b/gcc/bitmap.cc index 6cf326bca5a8..459e32c1ad18 100644 --- a/gcc/bitmap.cc +++ b/gcc/bitmap.cc @@ -2706,7 +2706,7 @@ bitmap_hash (const_bitmap head) for (ix = 0; ix != BITMAP_ELEMENT_WORDS; ix++) hash ^= ptr->bits[ix]; } - return (hashval_t)hash; + return iterative_hash (&hash, sizeof (hash), 0); }