Skip to content
Snippets Groups Projects
Commit 7fe3731e authored by Timothy Arceri's avatar Timothy Arceri Committed by Juan A. Suárez
Browse files

glsl: fix infinite loop caused by bug in loop unrolling pass


Just checking for 2 jumps is not enough to be sure we can do a
complex loop unroll. We need to make sure we also have also found
2 loop terminators.

Without this we were attempting to unroll a loop where the second
jump was nested inside multiple ifs which loop analysis is unable
to detect as a terminator. We ended up splicing out the first
terminator but failed to actually unroll the loop, this resulted
in the creation of a possible infinite loop.

Fixes: 646621c6 "glsl: make loop unrolling more like the nir unrolling path"

Tested-by: default avatarGert Wollny <gw.fossdev@gmail.com>
Reviewed-by: default avatarIan Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105670


(cherry picked from commit 56b86739)

Squashed with:

glsl: remove unreachable assert()

Earlier commit enforced that we'll bail out if the number of terminators
is different than 2. With that in mind, the assert() will never trigger.

Fixes: 56b86739 ("glsl: fix infinite loop caused by bug in loop
unrolling pass")
Reviewed-by: default avatarTimothy Arceri <tarceri@itsqueeze.com>
Signed-off-by: default avatarEmil Velikov <emil.velikov@collabora.com>
(cherry picked from commit 8eceac9d)
parent 4cfb3553
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment