Module: Mesa
Branch: main
Commit: 2b14618daa574f1394ed1c0efa898cd8f2519ed7
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=2b14618daa574f1394ed1c0efa898cd8f2519ed7

Author: Kenneth Graunke <[email protected]>
Date:   Tue Aug 22 10:38:55 2023 -0700

glsl: Use nir_opt_barrier_modes() to drop unnecessary barriers

iris shader-db stats on Alchemist:

    total instructions in shared programs: 23150249 -> 23142733 (-0.03%)
    instructions in affected programs: 157322 -> 149806 (-4.78%)
    helped: 105
    HURT: 2
    helped stats (abs) min: 2 max: 821 x̄: 71.61 x̃: 15
    helped stats (rel) min: 0.13% max: 27.56% x̄: 6.21% x̃: 2.35%
    HURT stats (abs)   min: 1 max: 2 x̄: 1.50 x̃: 1
    HURT stats (rel)   min: 0.18% max: 0.23% x̄: 0.20% x̃: 0.20%
    95% mean confidence interval for instructions value: -101.99 -38.50
    95% mean confidence interval for instructions %-change: -7.59% -4.58%
    Instructions are helped.

    total sends in shared programs: 1036916 -> 1035366 (-0.15%)
    sends in affected programs: 15274 -> 13724 (-10.15%)
    helped: 108 / HURT: 0
    helped stats (abs) min: 1 max: 162 x̄: 14.35 x̃: 3
    helped stats (rel) min: 0.88% max: 33.83% x̄: 9.81% x̃: 5.05%
    95% mean confidence interval for sends value: -20.79 -7.92
    95% mean confidence interval for sends %-change: -11.66% -7.95%

Reviewed-by: Alyssa Rosenzweig <[email protected]>
Reviewed-by: Ian Romanick <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24842>

---

 src/compiler/glsl/gl_nir_linker.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/compiler/glsl/gl_nir_linker.c 
b/src/compiler/glsl/gl_nir_linker.c
index e8fa0f2aa1e..f8bd7c1c3b4 100644
--- a/src/compiler/glsl/gl_nir_linker.c
+++ b/src/compiler/glsl/gl_nir_linker.c
@@ -1066,6 +1066,8 @@ preprocess_shader(const struct gl_constants *consts,
                  options->lower_to_scalar_filter, NULL);
    }
 
+   NIR_PASS_V(nir, nir_opt_barrier_modes);
+
    /* before buffers and vars_to_ssa */
    NIR_PASS_V(nir, gl_nir_lower_images, true);
 

Reply via email to