Lines Matching defs:deref
46 nir_deref_instr *deref = nir_instr_as_deref(instr);
51 if (deref->deref_type == nir_deref_type_var &&
52 nir_deref_instr_has_complex_use(deref, 0))
53 _mesa_set_add(complex_vars, deref->var);
174 /* We can't split a variable that's referenced with deref that has any
209 nir_deref_instr *deref = nir_instr_as_deref(instr);
210 if (!nir_deref_mode_may_be(deref, modes))
216 if (nir_deref_instr_remove_if_unused(deref))
219 if (!glsl_type_is_vector_or_scalar(deref->type))
222 nir_variable *base_var = nir_deref_instr_get_variable(deref);
239 nir_deref_path_init(&path, deref, mem_ctx);
276 unreachable("Invalid deref type in path");
280 assert(new_deref->type == deref->type);
281 nir_ssa_def_rewrite_uses(&deref->dest.ssa,
283 nir_deref_instr_remove_if_unused(deref);
392 /* We can't split a variable that's referenced with deref that has any
431 get_array_deref_info(nir_deref_instr *deref,
435 if (!nir_deref_mode_may_be(deref, modes))
438 nir_variable *var = nir_deref_instr_get_variable(deref);
446 mark_array_deref_used(nir_deref_instr *deref,
452 get_array_deref_info(deref, var_info_map, modes);
457 nir_deref_path_init(&path, deref, mem_ctx);
459 /* Walk the path and look for indirects. If we have an array deref with an
764 nir_deref_instr *deref = nir_instr_as_deref(instr);
765 if (nir_deref_mode_may_be(deref, modes))
766 nir_deref_instr_remove_if_unused(deref);
783 nir_deref_instr *deref = nir_src_as_deref(intrin->src[d]);
786 get_array_deref_info(deref, var_info_map, modes);
791 nir_deref_path_init(&path, deref, mem_ctx);
838 assert(new_deref->type == deref->type);
840 /* Rewrite the deref source to point to the split one */
843 nir_deref_instr_remove_if_unused(deref);
1016 get_vec_deref_usage(nir_deref_instr *deref,
1021 if (!nir_deref_mode_may_be(deref, modes))
1024 nir_variable *var = nir_deref_instr_get_variable(deref);
1028 return get_vec_var_usage(nir_deref_instr_get_variable(deref),
1033 mark_deref_if_complex(nir_deref_instr *deref,
1041 if (deref->deref_type != nir_deref_type_var)
1044 if (!(deref->var->data.mode & modes))
1047 if (!nir_deref_instr_has_complex_use(deref, 0))
1051 get_vec_var_usage(deref->var, var_usage_map, true, mem_ctx);
1059 mark_deref_used(nir_deref_instr *deref,
1067 if (!nir_deref_mode_may_be(deref, modes))
1070 nir_variable *var = nir_deref_instr_get_variable(deref);
1097 nir_deref_path_init(&path, deref, mem_ctx);
1106 nir_deref_instr *deref = path.path[i + 1];
1107 assert(deref->deref_type == nir_deref_type_array ||
1108 deref->deref_type == nir_deref_type_array_wildcard);
1111 if (deref->deref_type == nir_deref_type_array) {
1112 max_used = nir_src_is_const(deref->arr.index) ?
1113 nir_src_as_uint(deref->arr.index) : UINT_MAX;
1116 assert(deref->deref_type == nir_deref_type_array_wildcard);
1162 * instruction on the same deref. If the only data in a particular component
1184 /* If it's just a swizzle of a load from the same deref, discount any
1195 * same deref put in the same spot.
1424 vec_deref_is_oob(nir_deref_instr *deref,
1428 nir_deref_path_init(&path, deref, NULL);
1449 vec_deref_is_dead_or_oob(nir_deref_instr *deref,
1454 get_vec_deref_usage(deref, var_usage_map, modes, false, NULL);
1458 return usage->comps_kept == 0 || vec_deref_is_oob(deref, usage);
1473 nir_deref_instr *deref = nir_instr_as_deref(instr);
1474 if (!nir_deref_mode_may_be(deref, modes))
1480 if (nir_deref_instr_remove_if_unused(deref))
1483 /* Update the type in the deref to keep the types consistent as
1487 * an invalid deref.
1489 if (deref->deref_type == nir_deref_type_var) {
1490 deref->type = deref->var->type;
1491 } else if (deref->deref_type == nir_deref_type_array ||
1492 deref->deref_type == nir_deref_type_array_wildcard) {
1493 nir_deref_instr *parent = nir_deref_instr_parent(deref);
1496 deref->type = glsl_get_array_element(parent->type);
1526 nir_deref_instr *deref = nir_src_as_deref(intrin->src[0]);
1527 if (!nir_deref_mode_may_be(deref, modes))
1531 get_vec_deref_usage(deref, var_usage_map, modes, false, NULL);
1535 if (usage->comps_kept == 0 || vec_deref_is_oob(deref, usage)) {
1544 nir_deref_instr_remove_if_unused(deref);