nir/loop_analyze: Don't test non-positive iterations count
authorSviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Mon, 13 Nov 2023 11:40:10 +0000 (13:40 +0200)
committerEric Engestrom <eric@engestrom.ch>
Wed, 20 Dec 2023 00:05:05 +0000 (00:05 +0000)
commite17dfc075a4b2f339faaac6ef051836b6f7dd880
tree5c39ee23ec18f9d7c03c8c44e019b56e1a38b142
parentab4a2e97a9ae8340f755193f8d0b4f8cfa929b23
nir/loop_analyze: Don't test non-positive iterations count

Testing negative iterations count makes no sense, and can cause issues
when the unsigned type is used.
Testing 0 iterations is already covered with
will_break_on_first_iteration, so it can be skipped too.

Fixes: 6772a17a ("nir: Add a loop analysis pass")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9913
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26173>
(cherry picked from commit a6459e0f7bcb662130c79764ccf54ccfa9151182)
.pick_status.json
src/compiler/nir/nir_loop_analyze.c
src/compiler/nir/tests/loop_analyze_tests.cpp