nir: replace fnv1a hash function with xxhash
[mesa.git] / src / compiler / nir / nir_lower_locals_to_regs.c
index e417c6419faa59a2190fac6b075e579f08901b79..dcac46727cf9174e4f1a296855597ed826f0066c 100644 (file)
@@ -45,19 +45,19 @@ struct locals_to_regs_state {
 static uint32_t
 hash_deref(const void *void_deref)
 {
-   uint32_t hash = _mesa_fnv32_1a_offset_bias;
+   uint32_t hash = 0;
 
    for (const nir_deref_instr *deref = void_deref; deref;
         deref = nir_deref_instr_parent(deref)) {
       switch (deref->deref_type) {
       case nir_deref_type_var:
-         return _mesa_fnv32_1a_accumulate(hash, deref->var);
+         return XXH32(&deref->var, sizeof(deref->var), hash);
 
       case nir_deref_type_array:
          continue; /* Do nothing */
 
       case nir_deref_type_struct:
-         hash = _mesa_fnv32_1a_accumulate(hash, deref->strct.index);
+         hash = XXH32(&deref->strct.index, sizeof(deref->strct.index), hash);
          continue;
 
       default: