Skip to content

r300: Delete the loop unrolling.

Emma Anholt requested to merge anholt/mesa:r300-no-emulate-loops into main

There were two paths in this code: One was transform_loops, which would try to detect loops with an iteration count it understood and unroll that many times. The other was emulate_loops, which would just figure out how many instructions the program could have and still compile (hopefully), and unroll this loop however many times would fit in that.

The transform_loops had no analysis as good as GLSL or NIR loop unrolling have, so it shouldn't be missed -- any opportunity it found would only be due to bugs in the unrolling code.

The emulate_loops path had an issue with computing the number of times it should try to unroll -- if you had more instrs than ALUs available already, you'd overflow and unroll approximately infinitely many times, OOMing the system. But, also, it's better to throw a compiler error about unsupported loops than to run the loop an incorrect number of times and call it a success.

Fixes: #5883 (closed), 6018

Merge request reports