nir: Do not eliminate dead writes to shared memory in called functions.

Fixes regressions in rusticl and c11_atomic OpenCL CTS test.

Fixes: e65c1473de ("nir: Eliminate dead writes to shared memory at the end of the program")
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33807>
This commit is contained in:
Karol Herbst 2025-02-27 17:41:45 +01:00 committed by Marge Bot
parent 44110fe004
commit 5c1f61d900

View file

@ -115,6 +115,10 @@ ends_program(nir_block *block)
if (block->cf_node.parent->type == nir_cf_node_loop)
return false;
/* Avoid called functions */
if (!nir_cf_node_get_function(&block->cf_node)->function->is_entrypoint)
return false;
if (block->successors[0] == NULL) {
/* This is the end block */
assert(block->successors[1] == NULL);