mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-20 07:20:10 +01:00
treewide: Use nir_deref_instr_is_arr()
Via coccinelle and some manual fixups. @@ expression e1; @@ - e1->deref_type == nir_deref_type_array || e1->deref_type == nir_deref_type_ptr_as_array + nir_deref_instr_is_arr(e1) Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38856>
This commit is contained in:
parent
263a82f49b
commit
dc44c0f32b
6 changed files with 6 additions and 12 deletions
|
|
@ -129,8 +129,7 @@ nir_deref_instr_has_indirect(nir_deref_instr *instr)
|
|||
if (instr->deref_type == nir_deref_type_cast)
|
||||
return true;
|
||||
|
||||
if ((instr->deref_type == nir_deref_type_array ||
|
||||
instr->deref_type == nir_deref_type_ptr_as_array) &&
|
||||
if (nir_deref_instr_is_arr(instr) &&
|
||||
!nir_src_is_const(instr->arr.index))
|
||||
return true;
|
||||
|
||||
|
|
|
|||
|
|
@ -281,8 +281,7 @@ pin_intrinsic(nir_intrinsic_instr *intrin)
|
|||
nir_var_mem_push_const)) {
|
||||
nir_deref_instr *deref = nir_src_as_deref(intrin->src[0]);
|
||||
while (deref->deref_type != nir_deref_type_var) {
|
||||
if ((deref->deref_type == nir_deref_type_array ||
|
||||
deref->deref_type == nir_deref_type_ptr_as_array) &&
|
||||
if (nir_deref_instr_is_arr(deref) &&
|
||||
!nir_src_is_always_uniform(deref->arr.index)) {
|
||||
instr->pass_flags = GCM_INSTR_PINNED;
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -838,8 +838,7 @@ is_indirect_load(nir_instr *instr)
|
|||
if (!nir_deref_mode_may_be(deref, mem_modes))
|
||||
return false;
|
||||
while (deref) {
|
||||
if ((deref->deref_type == nir_deref_type_array ||
|
||||
deref->deref_type == nir_deref_type_ptr_as_array) &&
|
||||
if (nir_deref_instr_is_arr(deref) &&
|
||||
!nir_src_is_const(deref->arr.index)) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1144,8 +1144,7 @@ print_deref_instr(nir_deref_instr *instr, print_state *state)
|
|||
instr->cast.align_mul, instr->cast.align_offset);
|
||||
}
|
||||
|
||||
if (instr->deref_type == nir_deref_type_array ||
|
||||
instr->deref_type == nir_deref_type_ptr_as_array) {
|
||||
if (nir_deref_instr_is_arr(instr)) {
|
||||
if (instr->arr.in_bounds)
|
||||
fprintf(fp, " (in bounds)");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -915,8 +915,7 @@ write_deref(write_ctx *ctx, const nir_deref_instr *deref)
|
|||
header.deref_var.object_idx = var_idx;
|
||||
}
|
||||
|
||||
if (deref->deref_type == nir_deref_type_array ||
|
||||
deref->deref_type == nir_deref_type_ptr_as_array) {
|
||||
if (nir_deref_instr_is_arr(deref)) {
|
||||
header.deref.packed_src_ssa_16bit = are_object_ids_16bit(ctx);
|
||||
|
||||
header.deref.in_bounds = deref->arr.in_bounds;
|
||||
|
|
|
|||
|
|
@ -36,8 +36,7 @@ resize_deref(nir_builder *b, nir_deref_instr *deref,
|
|||
|
||||
/* NIR requires array indices have to match the deref bit size */
|
||||
if (deref->def.bit_size != bit_size &&
|
||||
(deref->deref_type == nir_deref_type_array ||
|
||||
deref->deref_type == nir_deref_type_ptr_as_array)) {
|
||||
nir_deref_instr_is_arr(deref)) {
|
||||
b->cursor = nir_before_instr(&deref->instr);
|
||||
nir_def *idx;
|
||||
if (nir_src_is_const(deref->arr.index)) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue