aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2018-03-27 09:45:00 -0700
committerJason Ekstrand <[email protected]>2018-06-22 20:15:56 -0700
commitf46ecdc44167b7c6eefac07a02c1e0f1bc41e04e (patch)
tree15b7d1edd1398fac0eb2f6438774b8166ff42ced
parent1e1733aaf06fe2aac62fe4c36d951ce09dc0dfbd (diff)
nir: Consider deref instructions in opt_peephole_select
Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]> Acked-by: Rob Clark <[email protected]> Acked-by: Bas Nieuwenhuizen <[email protected]> Acked-by: Dave Airlie <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
-rw-r--r--src/compiler/nir/nir_opt_peephole_select.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/compiler/nir/nir_opt_peephole_select.c b/src/compiler/nir/nir_opt_peephole_select.c
index 24a232ece89..608701ab55c 100644
--- a/src/compiler/nir/nir_opt_peephole_select.c
+++ b/src/compiler/nir/nir_opt_peephole_select.c
@@ -77,6 +77,17 @@ block_check_for_allowed_instrs(nir_block *block, unsigned *count, bool alu_ok)
}
break;
+ case nir_intrinsic_load_deref:
+ switch (nir_src_as_deref(intrin->src[0])->mode) {
+ case nir_var_shader_in:
+ case nir_var_uniform:
+ break;
+
+ default:
+ return false;
+ }
+ break;
+
case nir_intrinsic_load_uniform:
if (!alu_ok)
return false;
@@ -255,8 +266,6 @@ nir_opt_peephole_select(nir_shader *shader, unsigned limit)
{
bool progress = false;
- nir_assert_lowered_derefs(shader, nir_lower_load_store_derefs);
-
nir_foreach_function(function, shader) {
if (function->impl)
progress |= nir_opt_peephole_select_impl(function->impl, limit);