The resouce_intel intrinsic doesn't not result in an actual
instruction, it's just a wrapper around another value, usually a
load_const.
Allowing this intrinsic to be moved anywhere means it's going to be
closer to the value it wraps, enabling opt_gcm to move a load_ubo
using this resource_intel.
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21645>
return true;
if (instr->type == nir_instr_type_load_const ||
- instr->type == nir_instr_type_tex)
+ instr->type == nir_instr_type_tex ||
+ (instr->type == nir_instr_type_intrinsic &&
+ nir_instr_as_intrinsic(instr)->intrinsic == nir_intrinsic_resource_intel))
return true;
return false;
if (instr->type == nir_instr_type_load_const)
return true;
+ if (instr->type == nir_instr_type_intrinsic &&
+ nir_instr_as_intrinsic(instr)->intrinsic == nir_intrinsic_resource_intel)
+ return true;
+
/* TODO: Figure out some more heuristics to allow more to be moved into
* if-statements.
*/