From 373bd37b85e5f467eed02d3bc345b84a509b2081 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Thu, 6 Apr 2023 15:50:29 -0400 Subject: [PATCH] dxil: Avoid list_length Do O(1) check instead. Signed-off-by: Alyssa Rosenzweig Reviewed-by: Faith Ekstrand Reviewed-by: Jesse Natalie Part-of: --- src/microsoft/compiler/dxil_nir_tess.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/microsoft/compiler/dxil_nir_tess.c b/src/microsoft/compiler/dxil_nir_tess.c index addfccc..c70d21f 100644 --- a/src/microsoft/compiler/dxil_nir_tess.c +++ b/src/microsoft/compiler/dxil_nir_tess.c @@ -230,7 +230,8 @@ dxil_nir_split_tess_ctrl(nir_shader *nir, nir_function **patch_const_func) continue; nir_intrinsic_instr *intr = nir_instr_as_intrinsic(instr); if (intr->intrinsic != nir_intrinsic_load_invocation_id || - list_length(&intr->dest.ssa.uses) <= 1) + list_is_empty(&intr->dest.ssa.uses) || + list_is_singular(&intr->dest.ssa.uses)) continue; nir_foreach_use_including_if_safe(src, &intr->dest.ssa) { b.cursor = nir_before_src(src); -- 2.7.4