aboutsummaryrefslogtreecommitdiff
path: root/gcc/bitmap.cc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2024-02-14 12:33:13 +0100
committerRichard Biener <rguenther@suse.de>2024-02-14 15:50:48 +0100
commitad7a365aaccecd23ea287c7faaab9c7bd50b944a (patch)
tree70797be9537cd3d35a476a732a804cb2fa797f78 /gcc/bitmap.cc
parenta032c319cb9cf5348d71f008f311bcf95f3dac40 (diff)
downloadgcc-ad7a365aaccecd23ea287c7faaab9c7bd50b944a.zip
gcc-ad7a365aaccecd23ea287c7faaab9c7bd50b944a.tar.gz
gcc-ad7a365aaccecd23ea287c7faaab9c7bd50b944a.tar.bz2
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.
Diffstat (limited to 'gcc/bitmap.cc')
-rw-r--r--gcc/bitmap.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/bitmap.cc b/gcc/bitmap.cc
index 6cf326b..459e32c 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);
}