nir/inline_uniforms: Add inot condition support

From the 96c19d23c9 commit message:

    Ever since 4246c2869c and 7d85dc4f35 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 <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21179>
This commit is contained in:
Ian Romanick
2023-02-03 15:57:22 -08:00
committed by Marge Bot
parent 682e83f012
commit 18fc4daaf6

View File

@@ -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.