nir/phis_to_scalar,gcm: Use nir_deref_mode_may_be

In both cases, we're trying to determine if a load is scalarizable.  We
don't want to scalarize if it's a function_temp or shader_temp because
it might turn into something we can't scalarize.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6332>
This commit is contained in:
Jason Ekstrand 2020-11-01 17:15:28 -06:00 committed by Marge Bot
parent 9f3e3dfd2f
commit fff78fc1c5
2 changed files with 4 additions and 4 deletions

View file

@ -91,8 +91,8 @@ is_phi_src_scalarizable(nir_phi_src *src,
* might turn into one of the things we can't scalarize.
*/
nir_deref_instr *deref = nir_src_as_deref(src_intrin->src[0]);
return !(deref->mode & (nir_var_function_temp |
nir_var_shader_temp));
return !nir_deref_mode_may_be(deref, nir_var_function_temp |
nir_var_shader_temp);
}
case nir_intrinsic_interp_deref_at_centroid:

View file

@ -146,8 +146,8 @@ is_src_scalarizable(nir_src *src)
* might turn into one of the things we can't scalarize.
*/
nir_deref_instr *deref = nir_src_as_deref(src_intrin->src[0]);
return !(deref->mode & (nir_var_function_temp |
nir_var_shader_temp));
return !nir_deref_mode_may_be(deref, (nir_var_function_temp |
nir_var_shader_temp));
}
case nir_intrinsic_interp_deref_at_centroid: