anv,turnip,radv,clover,glspirv: Run nir_copy_prop before nir_opt_deref

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>
This commit is contained in:
Jason Ekstrand
2020-06-11 13:29:02 -05:00
parent 66c8628b65
commit 196db51fc2
5 changed files with 5 additions and 0 deletions

View 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_variable_initializers, nir_var_function_temp);
NIR_PASS_V(nir, nir_lower_returns); NIR_PASS_V(nir, nir_lower_returns);
NIR_PASS_V(nir, nir_inline_functions); NIR_PASS_V(nir, nir_inline_functions);
NIR_PASS_V(nir, nir_copy_prop);
NIR_PASS_V(nir, nir_opt_deref); NIR_PASS_V(nir, nir_opt_deref);
/* Pick off the single entrypoint that we want */ /* Pick off the single entrypoint that we want */

View 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_variable_initializers, nir_var_function_temp);
NIR_PASS_V(nir, nir_lower_returns); NIR_PASS_V(nir, nir_lower_returns);
NIR_PASS_V(nir, nir_inline_functions); NIR_PASS_V(nir, nir_inline_functions);
NIR_PASS_V(nir, nir_copy_prop);
NIR_PASS_V(nir, nir_opt_deref); NIR_PASS_V(nir, nir_opt_deref);
foreach_list_typed_safe(nir_function, func, node, &nir->functions) { foreach_list_typed_safe(nir_function, func, node, &nir->functions) {
if (!func->is_entrypoint) if (!func->is_entrypoint)

View 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_variable_initializers, nir_var_function_temp);
NIR_PASS_V(nir, nir_lower_returns); NIR_PASS_V(nir, nir_lower_returns);
NIR_PASS_V(nir, nir_inline_functions); NIR_PASS_V(nir, nir_inline_functions);
NIR_PASS_V(nir, nir_copy_prop);
NIR_PASS_V(nir, nir_opt_deref); NIR_PASS_V(nir, nir_opt_deref);
// Pick off the single entrypoint that we want. // Pick off the single entrypoint that we want.

View 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_variable_initializers, nir_var_function_temp);
NIR_PASS_V(nir, nir_lower_returns); NIR_PASS_V(nir, nir_lower_returns);
NIR_PASS_V(nir, nir_inline_functions); NIR_PASS_V(nir, nir_inline_functions);
NIR_PASS_V(nir, nir_copy_prop);
NIR_PASS_V(nir, nir_opt_deref); NIR_PASS_V(nir, nir_opt_deref);
/* Pick off the single entrypoint that we want */ /* Pick off the single entrypoint that we want */

View 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_variable_initializers, nir_var_function_temp);
NIR_PASS_V(nir, nir_lower_returns); NIR_PASS_V(nir, nir_lower_returns);
NIR_PASS_V(nir, nir_inline_functions); NIR_PASS_V(nir, nir_inline_functions);
NIR_PASS_V(nir, nir_copy_prop);
NIR_PASS_V(nir, nir_opt_deref); NIR_PASS_V(nir, nir_opt_deref);
/* Pick off the single entrypoint that we want */ /* Pick off the single entrypoint that we want */