nir/functions: use helper to get function for a name.
authorDave Airlie <airlied@redhat.com>
Mon, 4 Sep 2023 04:17:05 +0000 (14:17 +1000)
committerMarge Bot <emma+marge@anholt.net>
Tue, 12 Sep 2023 01:57:50 +0000 (01:57 +0000)
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24687>

src/compiler/nir/nir_functions.c

index 834ce69..3a958c5 100644 (file)
@@ -270,12 +270,7 @@ lower_function_link_call_instr(nir_instr *instr, nir_builder *b,
    if (!call->callee->name)
       return false;
 
-   nir_foreach_function(function, link_shader) {
-      if (strcmp(function->name, call->callee->name) == 0) {
-         func = function;
-         break;
-      }
-   }
+   func = nir_shader_get_function_for_name(link_shader, call->callee->name);
    if (!func || !func->impl) {
       return false;
    }