diff --git a/src/compiler/nir/nir_opt_gcm.c b/src/compiler/nir/nir_opt_gcm.c index 8debbe4afa0..b241103aa84 100644 --- a/src/compiler/nir/nir_opt_gcm.c +++ b/src/compiler/nir/nir_opt_gcm.c @@ -531,7 +531,9 @@ set_block_for_loop_instr(struct gcm_state *state, nir_instr *instr, 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; @@ -544,6 +546,10 @@ set_block_to_if_block(struct gcm_state *state, nir_instr *instr, 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. */