anv,turnip,radv,clover,glspirv: Run nir_copy_prop before nir_opt_deref
authorJason Ekstrand <jason@jlekstrand.net>
Thu, 11 Jun 2020 18:29:02 +0000 (13:29 -0500)
committerJason Ekstrand <jason@jlekstrand.net>
Fri, 24 Jul 2020 03:43:21 +0000 (22:43 -0500)
We're about to make the SPIR-V -> NIR path generate a bit more complex
SSA chains for certain derefs.  This will ensure we don't regress anyone
when we start making vec2's of derefs.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5278>

src/amd/vulkan/radv_shader.c
src/freedreno/vulkan/tu_shader.c
src/gallium/frontends/clover/nir/invocation.cpp
src/intel/vulkan/anv_pipeline.c
src/mesa/main/glspirv.c

index 3af15d4e8446b92217c370eac13811e127174977..11f8fbec7cf46ea425648adeba3739f755f195b9 100644 (file)
@@ -431,6 +431,7 @@ radv_shader_compile_to_nir(struct radv_device *device,
                NIR_PASS_V(nir, nir_lower_variable_initializers, nir_var_function_temp);
                NIR_PASS_V(nir, nir_lower_returns);
                NIR_PASS_V(nir, nir_inline_functions);
+               NIR_PASS_V(nir, nir_copy_prop);
                NIR_PASS_V(nir, nir_opt_deref);
 
                /* Pick off the single entrypoint that we want */
index 3e87c06252cbf45ca2205215bb3e3b2b4c4b5132..a98a967359b9a3210b266a426cbeab10f3dea939 100644 (file)
@@ -713,6 +713,7 @@ tu_shader_create(struct tu_device *dev,
    NIR_PASS_V(nir, nir_lower_variable_initializers, nir_var_function_temp);
    NIR_PASS_V(nir, nir_lower_returns);
    NIR_PASS_V(nir, nir_inline_functions);
+   NIR_PASS_V(nir, nir_copy_prop);
    NIR_PASS_V(nir, nir_opt_deref);
    foreach_list_typed_safe(nir_function, func, node, &nir->functions) {
       if (!func->is_entrypoint)
index 46440d96e09dc2fa9da424381b692281eacf010f..730011b7885ae5abd7c708bcaf527022678f714b 100644 (file)
@@ -112,6 +112,7 @@ module clover::nir::spirv_to_nir(const module &mod, const device &dev,
       NIR_PASS_V(nir, nir_lower_variable_initializers, nir_var_function_temp);
       NIR_PASS_V(nir, nir_lower_returns);
       NIR_PASS_V(nir, nir_inline_functions);
+      NIR_PASS_V(nir, nir_copy_prop);
       NIR_PASS_V(nir, nir_opt_deref);
 
       // Pick off the single entrypoint that we want.
index 856c018d10ee4c31c0cdc5e656469cf2749ca7be..82a2752b760369a2d28c6e45b40b161bd90d7039 100644 (file)
@@ -259,6 +259,7 @@ anv_shader_compile_to_nir(struct anv_device *device,
    NIR_PASS_V(nir, nir_lower_variable_initializers, nir_var_function_temp);
    NIR_PASS_V(nir, nir_lower_returns);
    NIR_PASS_V(nir, nir_inline_functions);
+   NIR_PASS_V(nir, nir_copy_prop);
    NIR_PASS_V(nir, nir_opt_deref);
 
    /* Pick off the single entrypoint that we want */
index 64daf54ec422bfd0342f6f7550efa6a6b0a3d119..dc0a0d29dd36b401871eeb4b3f0cadd952a2577f 100644 (file)
@@ -285,6 +285,7 @@ _mesa_spirv_to_nir(struct gl_context *ctx,
    NIR_PASS_V(nir, nir_lower_variable_initializers, nir_var_function_temp);
    NIR_PASS_V(nir, nir_lower_returns);
    NIR_PASS_V(nir, nir_inline_functions);
+   NIR_PASS_V(nir, nir_copy_prop);
    NIR_PASS_V(nir, nir_opt_deref);
 
    /* Pick off the single entrypoint that we want */