nir/range_analysis: set deleted key

If (uintptr_t)&deleted_key is small enough, inserting entries into the
hash table might not work correctly.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Backport-to: 26.0
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
(cherry picked from commit c0079e09ca)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40359>
This commit is contained in:
Rhys Perry 2026-03-03 13:44:01 +00:00 committed by Eric Engestrom
parent 0d52c7941e
commit 1d66a995ce
2 changed files with 3 additions and 1 deletions

View file

@ -2784,7 +2784,7 @@
"description": "nir/range_analysis: set deleted key",
"nominated": true,
"nomination_type": 4,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null,
"notes": null

View file

@ -2197,6 +2197,7 @@ nir_unsigned_upper_bound(nir_shader *shader, struct hash_table *range_ht,
push_scalar_query(&state, scalar);
_mesa_hash_table_set_deleted_key(range_ht, (void *)(uintptr_t)UINT32_MAX);
return perform_analysis(&state);
}
@ -2588,5 +2589,6 @@ nir_def_num_lsb_zero(struct hash_table *numlsb_ht, nir_scalar def)
push_scalar_query(&state, def);
_mesa_hash_table_set_deleted_key(numlsb_ht, (void *)(uintptr_t)UINT32_MAX);
return perform_analysis(&state);
}