From c34a7b6627d4c07531daf7d99dceaf7f89bd1c0a Mon Sep 17 00:00:00 2001 From: Ellie Hermaszewska Date: Tue, 1 Aug 2023 12:43:51 +0800 Subject: Generalize collectInductionValues (#3031) * Generalize collectInductionValues * Support affine transformations of loop index as induction variables * Test for generalized induction value collection * Neaten inductive variable finding * Store the type of implication success when finding inductive variables * Test that loop induction finding does not alway succeed * Support chains of additions and branches of additions in induction variable finding * Use c++17 for downstream compilers --- source/core/slang-hash.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source/core') diff --git a/source/core/slang-hash.h b/source/core/slang-hash.h index 8c4fbac42..bc4b30ccc 100644 --- a/source/core/slang-hash.h +++ b/source/core/slang-hash.h @@ -164,6 +164,13 @@ namespace Slang return PointerHash::value>::getHashCode(key); } + template + HashCode getHashCodeBytewise(const TKey& t) + { + static_assert(std::has_unique_object_representations_v); + return getHashCode(reinterpret_cast(&t), sizeof(TKey)); + } + inline HashCode combineHash(HashCode left, HashCode right) { return (left * 16777619) ^ right; -- cgit v1.2.3