aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2024-10-02 09:39:50 +0200
committerRichard Biener <rguenth@gcc.gnu.org>2024-10-02 13:59:58 +0200
commit842fbfa15fff2daae4a4d8a9cbcdf18e22635f78 (patch)
treec6c54f78de62cb9f825f7d84214d76078c66b60b
parent77c5e4ad08e42a325c6b45ea2b679bc1827b8557 (diff)
downloadgcc-842fbfa15fff2daae4a4d8a9cbcdf18e22635f78.zip
gcc-842fbfa15fff2daae4a4d8a9cbcdf18e22635f78.tar.gz
gcc-842fbfa15fff2daae4a4d8a9cbcdf18e22635f78.tar.bz2
Speedup iterative_hash_template_arg
Using iterative_hash_object is expensive compared to using iterative_hash_hashval_t which is fit for integer sized values. The following reduces the number of perf cycles spent in iterative_hash_template_arg and iterative_hash combined by 20%. gcc/cp/ * pt.cc (iterative_hash_template_arg): Avoid using iterative_hash_object.
-rw-r--r--gcc/cp/pt.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/cp/pt.cc b/gcc/cp/pt.cc
index 43468e5..04f0a1d 100644
--- a/gcc/cp/pt.cc
+++ b/gcc/cp/pt.cc
@@ -1751,7 +1751,7 @@ hashval_t
iterative_hash_template_arg (tree arg, hashval_t val)
{
if (arg == NULL_TREE)
- return iterative_hash_object (arg, val);
+ return iterative_hash_hashval_t (0, val);
if (!TYPE_P (arg))
/* Strip nop-like things, but not the same as STRIP_NOPS. */
@@ -1762,7 +1762,7 @@ iterative_hash_template_arg (tree arg, hashval_t val)
enum tree_code code = TREE_CODE (arg);
- val = iterative_hash_object (code, val);
+ val = iterative_hash_hashval_t (code, val);
switch (code)
{
@@ -1777,7 +1777,7 @@ iterative_hash_template_arg (tree arg, hashval_t val)
return val;
case IDENTIFIER_NODE:
- return iterative_hash_object (IDENTIFIER_HASH_VALUE (arg), val);
+ return iterative_hash_hashval_t (IDENTIFIER_HASH_VALUE (arg), val);
case TREE_VEC:
for (tree elt : tree_vec_range (arg))