nak: Report progress from nak_nir_rematerialize_load_const()

Fixes: 8fffcdb18b ("nak/nir: Re-materialize load_const instructions in use blocks")
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Mel Henning <mhenning@darkrefraction.com>
(cherry picked from commit 381bc06c4a)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
This commit is contained in:
Faith Ekstrand 2026-03-17 11:07:49 -04:00 committed by Eric Engestrom
parent 73d8c998fe
commit 4dc0c3ce94
2 changed files with 6 additions and 5 deletions

View file

@ -6624,7 +6624,7 @@
"description": "nak: Report progress from nak_nir_rematerialize_load_const()",
"nominated": true,
"nomination_type": 2,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "8fffcdb18b4d24f66a76d7c4de8006bd67eec728",
"notes": null

View file

@ -43,13 +43,12 @@ rematerialize_load_const(nir_src *src, void *_ctx)
static bool
rematerialize_load_const_impl(nir_function_impl *impl)
{
bool progress = false;
struct remat_ctx ctx = {
.remap = _mesa_pointer_hash_table_create(NULL),
.b = nir_builder_create(impl),
};
bool progress = false;
nir_foreach_block(block, impl) {
_mesa_hash_table_clear(ctx.remap, NULL);
ctx.block = block;
@ -82,12 +81,14 @@ rematerialize_load_const_impl(nir_function_impl *impl)
}
}
}
if (ctx.remap->entries > 0)
progress = true;
}
_mesa_hash_table_destroy(ctx.remap, NULL);
return nir_progress(progress, impl, nir_metadata_control_flow |
nir_metadata_divergence);
return nir_progress(progress, impl, nir_metadata_control_flow);
}
bool