Lines Matching refs:parent

32    nir_deref_instr *parent = nir_src_as_deref(cast->parent);  in is_trivial_deref_cast()  local
33 if (!parent) in is_trivial_deref_cast()
36 return cast->modes == parent->modes && in is_trivial_deref_cast()
37 cast->type == parent->type && in is_trivial_deref_cast()
38 cast->dest.ssa.num_components == parent->dest.ssa.num_components && in is_trivial_deref_cast()
39 cast->dest.ssa.bit_size == parent->dest.ssa.bit_size; in is_trivial_deref_cast()
172 if (use_src != &use_deref->parent) in nir_deref_instr_has_complex_use()
309 nir_deref_instr *parent = *(p - 1); in nir_deref_instr_get_const_offset() local
310 offset += struct_type_get_field_offset(parent->type, size_align, in nir_deref_instr_get_const_offset()
345 nir_deref_instr *parent = *(p - 1); in nir_build_deref_offset() local
347 struct_type_get_field_offset(parent->type, size_align, in nir_build_deref_offset()
417 assert(deref->parent.is_ssa); in nir_fixup_deref_modes()
418 nir_deref_instr *parent = in nir_fixup_deref_modes() local
419 nir_instr_as_deref(deref->parent.ssa->parent_instr); in nir_fixup_deref_modes()
420 parent_modes = parent->modes; in nir_fixup_deref_modes()
674 nir_deref_instr *parent = nir_src_as_deref(deref->parent); in rematerialize_deref_in_block() local
675 if (parent) { in rematerialize_deref_in_block()
676 parent = rematerialize_deref_in_block(parent, state); in rematerialize_deref_in_block()
677 new_deref->parent = nir_src_for_ssa(&parent->dest.ssa); in rematerialize_deref_in_block()
679 nir_src_copy(&new_deref->parent, &deref->parent, new_deref); in rematerialize_deref_in_block()
786 nir_deref_instr_fixup_child_types(nir_deref_instr *parent) in nir_deref_instr_fixup_child_types() argument
788 nir_foreach_use(use, &parent->dest.ssa) { in nir_deref_instr_fixup_child_types()
799 child->type = glsl_get_array_element(parent->type); in nir_deref_instr_fixup_child_types()
803 child->type = parent->type; in nir_deref_instr_fixup_child_types()
807 child->type = glsl_get_struct_field(parent->type, in nir_deref_instr_fixup_child_types()
826 nir_deref_instr *parent = nir_src_as_deref(cast->parent); in is_trivial_array_deref_cast() local
828 if (parent->deref_type == nir_deref_type_array) { in is_trivial_array_deref_cast()
830 glsl_get_explicit_stride(nir_deref_instr_parent(parent)->type); in is_trivial_array_deref_cast()
831 } else if (parent->deref_type == nir_deref_type_ptr_as_array) { in is_trivial_array_deref_cast()
833 nir_deref_instr_array_stride(parent); in is_trivial_array_deref_cast()
853 nir_deref_instr *parent = nir_src_as_deref(cast->parent); in opt_remove_restricting_cast_alignments() local
854 if (parent == NULL) in opt_remove_restricting_cast_alignments()
862 if (!nir_get_explicit_deref_align(parent, false /* default_to_type_align */, in opt_remove_restricting_cast_alignments()
925 nir_deref_instr *parent = nir_deref_instr_parent(first_cast); in opt_remove_cast_cast() local
926 if (parent == NULL || parent->deref_type != nir_deref_type_cast) in opt_remove_cast_cast()
928 first_cast = parent; in opt_remove_cast_cast()
933 nir_instr_rewrite_src(&cast->instr, &cast->parent, in opt_remove_cast_cast()
934 nir_src_for_ssa(first_cast->parent.ssa)); in opt_remove_cast_cast()
953 nir_deref_instr *parent = nir_src_as_deref(deref->parent); in opt_restrict_deref_modes() local
954 if (parent == NULL || parent->modes == deref->modes) in opt_restrict_deref_modes()
957 assert(parent->modes & deref->modes); in opt_restrict_deref_modes()
958 deref->modes &= parent->modes; in opt_restrict_deref_modes()
966 nir_deref_instr *parent = nir_src_as_deref(cast->parent); in opt_remove_sampler_cast() local
967 if (parent == NULL) in opt_remove_sampler_cast()
973 const struct glsl_type *parent_type = parent->type; in opt_remove_sampler_cast()
991 nir_src_for_ssa(&parent->dest.ssa)); in opt_remove_sampler_cast()
995 nir_deref_instr_fixup_child_types(parent); in opt_remove_sampler_cast()
1012 nir_deref_instr *parent = nir_src_as_deref(cast->parent); in opt_replace_struct_wrapper_cast() local
1013 if (!parent) in opt_replace_struct_wrapper_cast()
1019 if (!glsl_type_is_struct(parent->type)) in opt_replace_struct_wrapper_cast()
1022 if (glsl_get_struct_field_offset(parent->type, 0) != 0) in opt_replace_struct_wrapper_cast()
1025 if (cast->type != glsl_get_struct_field(parent->type, 0)) in opt_replace_struct_wrapper_cast()
1028 nir_deref_instr *replace = nir_build_deref_struct(b, parent, 0); in opt_replace_struct_wrapper_cast()
1060 assert(cast->parent.is_ssa); in opt_deref_cast()
1070 nir_instr_rewrite_src(use_src->parent_instr, use_src, cast->parent); in opt_deref_cast()
1088 nir_deref_instr *parent = nir_deref_instr_parent(deref); in opt_deref_ptr_as_array() local
1101 if (parent->deref_type == nir_deref_type_cast && in opt_deref_ptr_as_array()
1102 is_trivial_deref_cast(parent)) in opt_deref_ptr_as_array()
1103 parent = nir_deref_instr_parent(parent); in opt_deref_ptr_as_array()
1105 nir_src_for_ssa(&parent->dest.ssa)); in opt_deref_ptr_as_array()
1110 if (parent->deref_type != nir_deref_type_array && in opt_deref_ptr_as_array()
1111 parent->deref_type != nir_deref_type_ptr_as_array) in opt_deref_ptr_as_array()
1114 assert(parent->parent.is_ssa); in opt_deref_ptr_as_array()
1115 assert(parent->arr.index.is_ssa); in opt_deref_ptr_as_array()
1118 nir_ssa_def *new_idx = nir_iadd(b, parent->arr.index.ssa, in opt_deref_ptr_as_array()
1121 deref->deref_type = parent->deref_type; in opt_deref_ptr_as_array()
1122 nir_instr_rewrite_src(&deref->instr, &deref->parent, parent->parent); in opt_deref_ptr_as_array()
1141 nir_deref_instr *parent = nir_src_as_deref(cast->parent); in is_vector_bitcast_deref() local
1142 if (parent == NULL) in is_vector_bitcast_deref()
1146 if (!glsl_type_is_vector_or_scalar(parent->type)) in is_vector_bitcast_deref()
1151 unsigned parent_bit_size = glsl_get_bit_size(parent->type); in is_vector_bitcast_deref()
1157 glsl_get_explicit_stride(parent->type)) in is_vector_bitcast_deref()
1163 unsigned parent_bytes = glsl_get_vector_elements(parent->type) * in is_vector_bitcast_deref()
1203 nir_deref_instr *parent = nir_src_as_deref(deref->parent); in opt_load_vec_deref() local
1204 const unsigned new_num_comps = glsl_get_vector_elements(parent->type); in opt_load_vec_deref()
1205 const unsigned new_bit_size = glsl_get_bit_size(parent->type); in opt_load_vec_deref()
1209 nir_src_for_ssa(&parent->dest.ssa)); in opt_load_vec_deref()
1245 nir_deref_instr *parent = nir_src_as_deref(deref->parent); in opt_store_vec_deref() local
1246 const unsigned new_num_comps = glsl_get_vector_elements(parent->type); in opt_store_vec_deref()
1247 const unsigned new_bit_size = glsl_get_bit_size(parent->type); in opt_store_vec_deref()
1250 nir_src_for_ssa(&parent->dest.ssa)); in opt_store_vec_deref()