perf: skip computing hash of bv_decide BVExpr.Cache.Key (#7709)

This PR skips computation of the hash of `BVExpr.Cache.Key` as the
expression's hash is a computed field and the width is already mixed in
by its hash function. This will probably only have a very minor effect
but is visible in large SMTLIB benchmarks.
This commit is contained in:
Henrik Böving 2025-03-28 18:21:10 +01:00 committed by GitHub
parent 5fb990fcbd
commit bb23713542
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -34,7 +34,11 @@ namespace BVExpr
structure Cache.Key where
w : Nat
expr : BVExpr w
deriving DecidableEq, Hashable
deriving DecidableEq
instance : Hashable Cache.Key where
-- The width is already mixed into the hash of `key.expr` which is completely cached.
hash key := hash key.expr
structure Cache (aig : AIG BVBit) where
map : Std.DHashMap Cache.Key (fun k => Vector (Nat × Bool) k.w)