summaryrefslogtreecommitdiffstats
path: root/polly/lib/External/isl/isl_multi_hash.c
diff options
context:
space:
mode:
Diffstat (limited to 'polly/lib/External/isl/isl_multi_hash.c')
-rw-r--r--polly/lib/External/isl/isl_multi_hash.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/polly/lib/External/isl/isl_multi_hash.c b/polly/lib/External/isl/isl_multi_hash.c
new file mode 100644
index 00000000000..b4bb6c321a0
--- /dev/null
+++ b/polly/lib/External/isl/isl_multi_hash.c
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2016 Sven Verdoolaege
+ *
+ * Use of this software is governed by the MIT license
+ *
+ * Written by Sven Verdoolaege
+ */
+
+#include <isl_multi_macro.h>
+#include <isl/hash.h>
+
+/* Return a hash value that digests "multi".
+ */
+uint32_t FN(MULTI(BASE),get_hash)(__isl_keep MULTI(BASE) *multi)
+{
+ int i;
+ uint32_t hash;
+
+ if (!multi)
+ return 0;
+
+ hash = isl_hash_init();
+ for (i = 0; i < multi->n; ++i) {
+ uint32_t el_hash;
+ el_hash = FN(EL,get_hash)(multi->p[i]);
+ isl_hash_hash(hash, el_hash);
+ }
+
+ return hash;
+}
OpenPOWER on IntegriCloud