ir3/analyze_ubo_ranges: Move IR3_DBG_NOUBOOPT check
authorChristian Gmeiner <cgmeiner@igalia.com>
Mon, 26 Jun 2023 08:53:58 +0000 (10:53 +0200)
committerMarge Bot <emma+marge@anholt.net>
Tue, 27 Jun 2023 08:19:10 +0000 (08:19 +0000)
There is no need to walk the hole nir shader if IR3_DBG_NOUBOOPT
is used.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23854>

src/freedreno/ir3/ir3_nir_analyze_ubo_ranges.c

index d9fbef9..5d6ff10 100644 (file)
@@ -137,9 +137,6 @@ gather_ubo_ranges(nir_shader *nir, nir_intrinsic_instr *instr,
                   struct ir3_ubo_analysis_state *state, uint32_t alignment,
                   uint32_t *upload_remaining)
 {
-   if (ir3_shader_debug & IR3_DBG_NOUBOOPT)
-      return;
-
    struct ir3_ubo_info ubo = {};
    if (!get_ubo_info(instr, &ubo))
       return;
@@ -425,6 +422,9 @@ ir3_nir_analyze_ubo_ranges(nir_shader *nir, struct ir3_shader_variant *v)
 
    memset(state, 0, sizeof(*state));
 
+   if (ir3_shader_debug & IR3_DBG_NOUBOOPT)
+      return;
+
    uint32_t upload_remaining = max_upload;
    bool push_ubos = compiler->options.push_ubo_with_preamble;
    nir_foreach_function (function, nir) {