nir/opt_phi_precision: Work with libraries

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25625>
This commit is contained in:
Alyssa Rosenzweig
2023-09-05 17:19:50 -04:00
committed by Marge Bot
parent cd1ba21958
commit b1b7616418

View File

@@ -444,13 +444,10 @@ nir_opt_phi_precision(nir_shader *shader)
unsigned bit_sizes_used = shader->info.bit_sizes_float |
shader->info.bit_sizes_int;
if (!bit_sizes_used) {
nir_shader_gather_info(shader, nir_shader_get_entrypoint(shader));
bit_sizes_used = shader->info.bit_sizes_float |
shader->info.bit_sizes_int;
}
if (!(bit_sizes_used & (8 | 16)))
/* Note: if the info is zeroed, we conservatively run to avoid gathering
* info, which doesn't work for libraries.
*/
if (bit_sizes_used && !(bit_sizes_used & (8 | 16)))
return false;
nir_foreach_function_impl(impl, shader) {