PolyHash is an optimization pass for the SSA IntermediateLanguage, invoked from SSASimplify.


This pass implements polymorphic, structural hashing.


Details and Notes

For each datatype, tycon, and vector type, it builds and equality function and translates calls to MLton_hash into calls to that function.

For tuples, it does the equality test inline; i.e., it does not create a separate equality function for each tuple type.

All equality functions are created only if necessary, i.e., if equality is actually used at a type.