diff options
author | Timothy Arceri <[email protected]> | 2019-10-28 21:27:52 +1100 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2019-10-28 11:24:38 +0000 |
commit | 7f106a2b5d0b27c1ce47a4b335c4cc8ae9cd460b (patch) | |
tree | 1307edca18a23a59f1a50d2bcc41d054a7453676 /src/compiler | |
parent | c578600489e35abb481816c87124b1dc6b279655 (diff) |
util: rename list_empty() to list_is_empty()
This makes it clear that it's a boolean test and not an action
(eg. "empty the list").
Reviewed-by: Eric Engestrom <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/nir/nir.c | 6 | ||||
-rw-r--r-- | src/compiler/nir/nir_clone.c | 4 | ||||
-rw-r--r-- | src/compiler/nir/nir_deref.c | 4 | ||||
-rw-r--r-- | src/compiler/nir/nir_from_ssa.c | 4 | ||||
-rw-r--r-- | src/compiler/nir/nir_lower_io.c | 4 | ||||
-rw-r--r-- | src/compiler/nir/nir_lower_regs_to_ssa.c | 6 | ||||
-rw-r--r-- | src/compiler/nir/nir_lower_to_source_mods.c | 6 | ||||
-rw-r--r-- | src/compiler/nir/nir_lower_vec_to_movs.c | 2 | ||||
-rw-r--r-- | src/compiler/nir/nir_opt_combine_stores.c | 2 | ||||
-rw-r--r-- | src/compiler/nir/nir_opt_loop_unroll.c | 2 | ||||
-rw-r--r-- | src/compiler/nir/nir_opt_peephole_select.c | 2 | ||||
-rw-r--r-- | src/compiler/nir/nir_opt_vectorize.c | 8 | ||||
-rw-r--r-- | src/compiler/nir/nir_search_helpers.h | 8 | ||||
-rw-r--r-- | src/compiler/nir/nir_serialize.c | 2 | ||||
-rw-r--r-- | src/compiler/nir/nir_validate.c | 2 | ||||
-rw-r--r-- | src/compiler/nir/nir_worklist.h | 2 | ||||
-rw-r--r-- | src/compiler/spirv/vtn_cfg.c | 2 |
17 files changed, 33 insertions, 33 deletions
diff --git a/src/compiler/nir/nir.c b/src/compiler/nir/nir.c index 1cec8171a7f..1d7a7479d6c 100644 --- a/src/compiler/nir/nir.c +++ b/src/compiler/nir/nir.c @@ -1416,7 +1416,7 @@ nir_instr_rewrite_dest(nir_instr *instr, nir_dest *dest, nir_dest new_dest) { if (dest->is_ssa) { /* We can only overwrite an SSA destination if it has no uses. */ - assert(list_empty(&dest->ssa.uses) && list_empty(&dest->ssa.if_uses)); + assert(list_is_empty(&dest->ssa.uses) && list_is_empty(&dest->ssa.if_uses)); } else { list_del(&dest->reg.def_link); if (dest->reg.indirect) @@ -1547,7 +1547,7 @@ nir_ssa_def_components_read(const nir_ssa_def *def) } } - if (!list_empty(&def->if_uses)) + if (!list_is_empty(&def->if_uses)) read_mask |= 1; return read_mask; @@ -1888,7 +1888,7 @@ nir_function_impl_lower_instructions(nir_function_impl *impl, list_for_each_entry_safe(nir_src, use_src, &old_if_uses, use_link) nir_if_rewrite_condition(use_src->parent_if, new_src); - if (list_empty(&old_def->uses) && list_empty(&old_def->if_uses)) { + if (list_is_empty(&old_def->uses) && list_is_empty(&old_def->if_uses)) { iter = nir_instr_remove(instr); } else { iter = nir_after_instr(instr); diff --git a/src/compiler/nir/nir_clone.c b/src/compiler/nir/nir_clone.c index 71303086db7..682a1a274a7 100644 --- a/src/compiler/nir/nir_clone.c +++ b/src/compiler/nir/nir_clone.c @@ -629,7 +629,7 @@ fixup_phi_srcs(clone_state *state) list_addtail(&src->src.use_link, &src->src.reg.reg->uses); } } - assert(list_empty(&state->phi_srcs)); + assert(list_is_empty(&state->phi_srcs)); } void @@ -669,7 +669,7 @@ clone_function_impl(clone_state *state, const nir_function_impl *fi) clone_reg_list(state, &nfi->registers, &fi->registers); nfi->reg_alloc = fi->reg_alloc; - assert(list_empty(&state->phi_srcs)); + assert(list_is_empty(&state->phi_srcs)); clone_cf_list(state, &nfi->body, &fi->body); diff --git a/src/compiler/nir/nir_deref.c b/src/compiler/nir/nir_deref.c index 7ec460126e3..b81edde8dac 100644 --- a/src/compiler/nir/nir_deref.c +++ b/src/compiler/nir/nir_deref.c @@ -92,7 +92,7 @@ nir_deref_instr_remove_if_unused(nir_deref_instr *instr) for (nir_deref_instr *d = instr; d; d = nir_deref_instr_parent(d)) { /* If anyone is using this deref, leave it alone */ assert(d->dest.is_ssa); - if (!list_empty(&d->dest.ssa.uses)) + if (!list_is_empty(&d->dest.ssa.uses)) break; nir_instr_remove(&d->instr); @@ -855,7 +855,7 @@ opt_deref_cast(nir_builder *b, nir_deref_instr *cast) } /* If uses would be a bit crazy */ - assert(list_empty(&cast->dest.ssa.if_uses)); + assert(list_is_empty(&cast->dest.ssa.if_uses)); nir_deref_instr_remove_if_unused(cast); return progress; diff --git a/src/compiler/nir/nir_from_ssa.c b/src/compiler/nir/nir_from_ssa.c index b5d79b37459..acb758584a6 100644 --- a/src/compiler/nir/nir_from_ssa.c +++ b/src/compiler/nir/nir_from_ssa.c @@ -495,7 +495,7 @@ rewrite_ssa_def(nir_ssa_def *def, void *void_state) } nir_ssa_def_rewrite_uses(def, nir_src_for_reg(reg)); - assert(list_empty(&def->uses) && list_empty(&def->if_uses)); + assert(list_is_empty(&def->uses) && list_is_empty(&def->if_uses)); if (def->parent_instr->type == nir_instr_type_ssa_undef) { /* If it's an ssa_undef instruction, remove it since we know we just got @@ -961,7 +961,7 @@ ssa_def_is_local_to_block(nir_ssa_def *def, UNUSED void *state) } } - if (!list_empty(&def->if_uses)) + if (!list_is_empty(&def->if_uses)) return false; return true; diff --git a/src/compiler/nir/nir_lower_io.c b/src/compiler/nir/nir_lower_io.c index 6f257d94cc4..745ef92ddf3 100644 --- a/src/compiler/nir/nir_lower_io.c +++ b/src/compiler/nir/nir_lower_io.c @@ -1191,8 +1191,8 @@ lower_explicit_io_deref(nir_builder *b, nir_deref_instr *deref, * one deref which could break our list walking since we walk the list * backwards. */ - assert(list_empty(&deref->dest.ssa.if_uses)); - if (list_empty(&deref->dest.ssa.uses)) { + assert(list_is_empty(&deref->dest.ssa.if_uses)); + if (list_is_empty(&deref->dest.ssa.uses)) { nir_instr_remove(&deref->instr); return; } diff --git a/src/compiler/nir/nir_lower_regs_to_ssa.c b/src/compiler/nir/nir_lower_regs_to_ssa.c index b755d1df99e..2e83c80af18 100644 --- a/src/compiler/nir/nir_lower_regs_to_ssa.c +++ b/src/compiler/nir/nir_lower_regs_to_ssa.c @@ -300,9 +300,9 @@ nir_lower_regs_to_ssa_impl(nir_function_impl *impl) nir_foreach_register_safe(reg, &impl->registers) { if (state.values[reg->index]) { - assert(list_empty(®->uses)); - assert(list_empty(®->if_uses)); - assert(list_empty(®->defs)); + assert(list_is_empty(®->uses)); + assert(list_is_empty(®->if_uses)); + assert(list_is_empty(®->defs)); exec_node_remove(®->node); } } diff --git a/src/compiler/nir/nir_lower_to_source_mods.c b/src/compiler/nir/nir_lower_to_source_mods.c index f3d004ccdd2..ab9581dcc3d 100644 --- a/src/compiler/nir/nir_lower_to_source_mods.c +++ b/src/compiler/nir/nir_lower_to_source_mods.c @@ -122,8 +122,8 @@ nir_lower_to_source_mods_block(nir_block *block, alu->src[i].swizzle[j] = parent->src[0].swizzle[alu->src[i].swizzle[j]]; } - if (list_empty(&parent->dest.dest.ssa.uses) && - list_empty(&parent->dest.dest.ssa.if_uses)) + if (list_is_empty(&parent->dest.dest.ssa.uses) && + list_is_empty(&parent->dest.dest.ssa.if_uses)) nir_instr_remove(&parent->instr); progress = true; @@ -144,7 +144,7 @@ nir_lower_to_source_mods_block(nir_block *block, if (!(options & nir_lower_float_source_mods)) continue; - if (!list_empty(&alu->dest.dest.ssa.if_uses)) + if (!list_is_empty(&alu->dest.dest.ssa.if_uses)) continue; bool all_children_are_sat = true; diff --git a/src/compiler/nir/nir_lower_vec_to_movs.c b/src/compiler/nir/nir_lower_vec_to_movs.c index 8c286117d55..eec994f15e5 100644 --- a/src/compiler/nir/nir_lower_vec_to_movs.c +++ b/src/compiler/nir/nir_lower_vec_to_movs.c @@ -140,7 +140,7 @@ try_coalesce(nir_alu_instr *vec, unsigned start_idx) return 0; } - if (!list_empty(&vec->src[start_idx].src.ssa->if_uses)) + if (!list_is_empty(&vec->src[start_idx].src.ssa->if_uses)) return 0; if (vec->src[start_idx].src.ssa->parent_instr->type != nir_instr_type_alu) diff --git a/src/compiler/nir/nir_opt_combine_stores.c b/src/compiler/nir/nir_opt_combine_stores.c index b3e5cb3947f..c59f3ed9936 100644 --- a/src/compiler/nir/nir_opt_combine_stores.c +++ b/src/compiler/nir/nir_opt_combine_stores.c @@ -84,7 +84,7 @@ static struct combined_store * alloc_combined_store(struct combine_stores_state *state) { struct combined_store *result; - if (list_empty(&state->freelist)) { + if (list_is_empty(&state->freelist)) { result = linear_zalloc_child(state->lin_ctx, sizeof(*result)); } else { result = list_first_entry(&state->freelist, diff --git a/src/compiler/nir/nir_opt_loop_unroll.c b/src/compiler/nir/nir_opt_loop_unroll.c index 0681518d960..e1c37d24eb7 100644 --- a/src/compiler/nir/nir_opt_loop_unroll.c +++ b/src/compiler/nir/nir_opt_loop_unroll.c @@ -514,7 +514,7 @@ complex_unroll_single_terminator(nir_loop *loop) static bool wrapper_unroll(nir_loop *loop) { - if (!list_empty(&loop->info->loop_terminator_list)) { + if (!list_is_empty(&loop->info->loop_terminator_list)) { /* Unrolling a loop with a large number of exits can result in a * large inrease in register pressure. For now we just skip diff --git a/src/compiler/nir/nir_opt_peephole_select.c b/src/compiler/nir/nir_opt_peephole_select.c index 09ae3d5632f..14f36e799de 100644 --- a/src/compiler/nir/nir_opt_peephole_select.c +++ b/src/compiler/nir/nir_opt_peephole_select.c @@ -156,7 +156,7 @@ block_check_for_allowed_instrs(nir_block *block, unsigned *count, return false; /* It cannot have any if-uses */ - if (!list_empty(&mov->dest.dest.ssa.if_uses)) + if (!list_is_empty(&mov->dest.dest.ssa.if_uses)) return false; /* The only uses of this definition must be phis in the successor */ diff --git a/src/compiler/nir/nir_opt_vectorize.c b/src/compiler/nir/nir_opt_vectorize.c index a3681610a59..20e03db0d38 100644 --- a/src/compiler/nir/nir_opt_vectorize.c +++ b/src/compiler/nir/nir_opt_vectorize.c @@ -248,8 +248,8 @@ instr_try_combine(nir_instr *instr1, nir_instr *instr2) nir_if_rewrite_condition(src->parent_if, nir_src_for_ssa(new_alu1)); } - assert(list_empty(&alu1->dest.dest.ssa.uses)); - assert(list_empty(&alu1->dest.dest.ssa.if_uses)); + assert(list_is_empty(&alu1->dest.dest.ssa.uses)); + assert(list_is_empty(&alu1->dest.dest.ssa.if_uses)); nir_foreach_use_safe(src, &alu2->dest.dest.ssa) { if (src->parent_instr->type == nir_instr_type_alu) { @@ -285,8 +285,8 @@ instr_try_combine(nir_instr *instr1, nir_instr *instr2) nir_if_rewrite_condition(src->parent_if, nir_src_for_ssa(new_alu2)); } - assert(list_empty(&alu2->dest.dest.ssa.uses)); - assert(list_empty(&alu2->dest.dest.ssa.if_uses)); + assert(list_is_empty(&alu2->dest.dest.ssa.uses)); + assert(list_is_empty(&alu2->dest.dest.ssa.if_uses)); nir_instr_remove(instr1); nir_instr_remove(instr2); diff --git a/src/compiler/nir/nir_search_helpers.h b/src/compiler/nir/nir_search_helpers.h index 4849aef052d..0c2f631ac39 100644 --- a/src/compiler/nir/nir_search_helpers.h +++ b/src/compiler/nir/nir_search_helpers.h @@ -226,8 +226,8 @@ is_not_const_and_not_fsign(struct hash_table *ht, nir_alu_instr *instr, unsigned static inline bool is_used_once(nir_alu_instr *instr) { - bool zero_if_use = list_empty(&instr->dest.dest.ssa.if_uses); - bool zero_use = list_empty(&instr->dest.dest.ssa.uses); + bool zero_if_use = list_is_empty(&instr->dest.dest.ssa.if_uses); + bool zero_use = list_is_empty(&instr->dest.dest.ssa.uses); if (zero_if_use && zero_use) return false; @@ -248,13 +248,13 @@ is_used_once(nir_alu_instr *instr) static inline bool is_used_by_if(nir_alu_instr *instr) { - return !list_empty(&instr->dest.dest.ssa.if_uses); + return !list_is_empty(&instr->dest.dest.ssa.if_uses); } static inline bool is_not_used_by_if(nir_alu_instr *instr) { - return list_empty(&instr->dest.dest.ssa.if_uses); + return list_is_empty(&instr->dest.dest.ssa.if_uses); } static inline bool diff --git a/src/compiler/nir/nir_serialize.c b/src/compiler/nir/nir_serialize.c index b7b44f6af88..558bd6c97a3 100644 --- a/src/compiler/nir/nir_serialize.c +++ b/src/compiler/nir/nir_serialize.c @@ -762,7 +762,7 @@ read_fixup_phis(read_ctx *ctx) list_addtail(&src->src.use_link, &src->src.ssa->uses); } - assert(list_empty(&ctx->phi_srcs)); + assert(list_is_empty(&ctx->phi_srcs)); } static void diff --git a/src/compiler/nir/nir_validate.c b/src/compiler/nir/nir_validate.c index 204cfdbbe3c..22effa0c5e6 100644 --- a/src/compiler/nir/nir_validate.c +++ b/src/compiler/nir/nir_validate.c @@ -498,7 +498,7 @@ validate_deref_instr(nir_deref_instr *instr, validate_state *state) * conditions expect well-formed Booleans. If you want to compare with * NULL, an explicit comparison operation should be used. */ - validate_assert(state, list_empty(&instr->dest.ssa.if_uses)); + validate_assert(state, list_is_empty(&instr->dest.ssa.if_uses)); /* Only certain modes can be used as sources for phi instructions. */ nir_foreach_use(use, &instr->dest.ssa) { diff --git a/src/compiler/nir/nir_worklist.h b/src/compiler/nir/nir_worklist.h index 05aa757eb79..36014cc7752 100644 --- a/src/compiler/nir/nir_worklist.h +++ b/src/compiler/nir/nir_worklist.h @@ -124,7 +124,7 @@ nir_instr_worklist_length(nir_instr_worklist *wl) } static inline bool -nir_instr_worklist_empty(nir_instr_worklist *wl) +nir_instr_worklist_is_empty(nir_instr_worklist *wl) { return nir_instr_worklist_length(wl) == 0; } diff --git a/src/compiler/spirv/vtn_cfg.c b/src/compiler/spirv/vtn_cfg.c index 843966f86b5..a6451490081 100644 --- a/src/compiler/spirv/vtn_cfg.c +++ b/src/compiler/spirv/vtn_cfg.c @@ -1002,7 +1002,7 @@ vtn_emit_cf_list(struct vtn_builder *b, struct list_head *cf_list, vtn_emit_cf_list(b, &vtn_loop->body, NULL, NULL, handler); - if (!list_empty(&vtn_loop->cont_body)) { + if (!list_is_empty(&vtn_loop->cont_body)) { /* If we have a non-trivial continue body then we need to put * it at the beginning of the loop with a flag to ensure that * it doesn't get executed in the first iteration. |