From 296a54ec9a2e753a1f5d1c426fb7c5e7575e9dcb Mon Sep 17 00:00:00 2001 From: Timotej Kapus Date: Thu, 21 Jun 2018 17:01:02 +0100 Subject: Make ConstantExpr hashing function faster and modify affected test --- lib/Expr/Expr.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/Expr/Expr.cpp b/lib/Expr/Expr.cpp index f73d1614..a5c7f652 100644 --- a/lib/Expr/Expr.cpp +++ b/lib/Expr/Expr.cpp @@ -182,7 +182,12 @@ unsigned Expr::computeHash() { } unsigned ConstantExpr::computeHash() { - hashValue = hash_value(value) ^ (getWidth() * MAGIC_HASH_CONSTANT); + Expr::Width w = getWidth(); + if (w <= 64) + hashValue = value.getLimitedValue() ^ (w * MAGIC_HASH_CONSTANT); + else + hashValue = hash_value(value) ^ (w * MAGIC_HASH_CONSTANT); + return hashValue; } -- cgit 1.4.1