From 903a1439e18a8a5d4603caac0a652cb2a53563be Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Mon, 6 Feb 2017 10:16:56 +0100 Subject: [PATCH] add isl_space_get_tuple_hash This function can be used instead of isl_space_get_hash when the parameters should be ignored. Signed-off-by: Sven Verdoolaege --- isl_space.c | 16 ++++++++++++++++ isl_space_private.h | 1 + 2 files changed, 17 insertions(+) diff --git a/isl_space.c b/isl_space.c index 9122a30f..0ddacc23 100644 --- a/isl_space.c +++ b/isl_space.c @@ -1999,6 +1999,22 @@ static uint32_t isl_hash_tuples_domain(uint32_t hash, return hash; } +/* Return a hash value that digests the tuples of "space", + * i.e., that ignores the parameters. + */ +uint32_t isl_space_get_tuple_hash(__isl_keep isl_space *space) +{ + uint32_t hash; + + if (!space) + return 0; + + hash = isl_hash_init(); + hash = isl_hash_tuples(hash, space); + + return hash; +} + uint32_t isl_space_get_hash(__isl_keep isl_space *space) { uint32_t hash; diff --git a/isl_space_private.h b/isl_space_private.h index 21976eb9..783ba43c 100644 --- a/isl_space_private.h +++ b/isl_space_private.h @@ -27,6 +27,7 @@ __isl_give isl_space *isl_space_cow(__isl_take isl_space *dim); __isl_give isl_space *isl_space_underlying(__isl_take isl_space *dim, unsigned n_div); +uint32_t isl_space_get_tuple_hash(__isl_keep isl_space *space); uint32_t isl_space_get_hash(__isl_keep isl_space *space); uint32_t isl_space_get_domain_hash(__isl_keep isl_space *space); -- 2.11.4.GIT