nir/loop_analyze: Fix inverted condition handling in iterations calculation
authorSviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Fri, 3 Nov 2023 01:13:50 +0000 (03:13 +0200)
committerEric Engestrom <eric@engestrom.ch>
Tue, 7 Nov 2023 13:30:20 +0000 (13:30 +0000)
commitb419916e7f5a7b250004564ae1aaff340505f197
tree6c222bb07543d73cff3978b431ed0043ef73756b
parent43540839e7b47e2a0c14aaf1d6ab287d7d13e669
nir/loop_analyze: Fix inverted condition handling in iterations calculation

In the tagged commit, we stopped actually inverting the condition, and
instead relied on the "invert_cond" flag. But we missed a few places
where this flag should've been handled too.

Also, add a few more tests to make sure this won't regress in the future.

Fixes: 99a7a664 ("nir/loop_analyze: Change invert_cond instead of changing the condition")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10012
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26024>
(cherry picked from commit aa33ca0a52591961f8ae01dc253354462ed17c18)
.pick_status.json
src/compiler/nir/nir_loop_analyze.c
src/compiler/nir/tests/loop_analyze_tests.cpp