- where hash_mid (MidComment (FastString u _ _ _ _)) = cvt u
- hash_mid (MidAssign r e) = hash_reg r + hash_e e
- hash_mid (MidStore e e') = hash_e e + hash_e e'
- hash_mid (MidForeignCall _ t _ as) = hash_tgt t + hash_lst hash_e as
+ where hash_fst _ h = h
+ hash_mid m h = hash_node m + h `shiftL` 1
+ hash_lst m h = hash_node m + h `shiftL` 1
+
+ hash_node :: CmmNode O x -> Word32
+ hash_node (CmmComment (FastString u _ _ _ _)) = cvt u
+ hash_node (CmmAssign r e) = hash_reg r + hash_e e
+ hash_node (CmmStore e e') = hash_e e + hash_e e'
+ hash_node (CmmUnsafeForeignCall t _ as) = hash_tgt t + hash_list hash_e as
+ hash_node (CmmBranch _) = 23 -- would be great to hash these properly
+ hash_node (CmmCondBranch p _ _) = hash_e p
+ hash_node (CmmCall e _ _ _ _) = hash_e e
+ hash_node (CmmForeignCall t _ _ _ _ _) = hash_tgt t
+ hash_node (CmmSwitch e _) = hash_e e
+