From 18fc4daaf666c735d3cfc654bc09ed14ed7254d0 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Fri, 3 Feb 2023 15:57:22 -0800 Subject: [PATCH] nir/inline_uniforms: Add inot condition support From the 96c19d23c95700 commit message: Ever since 4246c2869c3c and 7d85dc4f350b loop unrolling can no longer depend on inot being eliminated from the loop terminator condition so we need to be able to handle it. Support these conditions here too. Acked-by: Mike Blumenkrantz Part-of: --- src/compiler/nir/nir_inline_uniforms.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/compiler/nir/nir_inline_uniforms.c b/src/compiler/nir/nir_inline_uniforms.c index c07d4366902..5589a6f9485 100644 --- a/src/compiler/nir/nir_inline_uniforms.c +++ b/src/compiler/nir/nir_inline_uniforms.c @@ -239,8 +239,11 @@ nir_add_inlinable_uniforms(const nir_src *cond, nir_loop_info *info, /* Limit terminator condition to loop unroll support case which is a simple * comparison (ie. "i < count" is supported, but "i + 1 < count" is not). */ - if (nir_is_terminator_condition_with_two_inputs(cond_scalar)) { - nir_alu_instr *alu = nir_instr_as_alu(cond->ssa->parent_instr); + if (nir_is_supported_terminator_condition(cond_scalar)) { + if (nir_ssa_scalar_alu_op(cond_scalar) == nir_op_inot) + cond_scalar = nir_ssa_scalar_chase_alu_src(cond_scalar, 0); + + nir_alu_instr *alu = nir_instr_as_alu(cond_scalar.def->parent_instr); /* One side of comparison is induction variable, the other side is * only uniform.