Skip to content
Commit 81af1a0a authored by Timothy Arceri's avatar Timothy Arceri Committed by Dylan Baker
Browse files

nir: fix selection of loop terminator when two or more have the same limit



We need to add loop terminators to the list in the order we come
across them otherwise if two or more have the same exit condition
we will select that last one rather than the first one even though
its unreachable.

This fix is for simple unrolls where we only have a single exit
point. When unrolling these type of loops the unreachable
terminators and their unreachable branch are removed prior to
unrolling. Because of the logic change we also switch some
list access in the complex unrolling logic to avoid breakage.

Fixes: 6772a17a ("nir: Add a loop analysis pass")

Reviewed-by: default avatarJason Ekstrand <jason@jlekstrand.net>
(cherry picked from commit 463f8490)
parent 4cd70c4c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment