Skip to content

nir/loop_unroll: clean up after complex_unroll_single_terminator()

Timothy Arceri requested to merge tarceri/mesa:fix_unroll into main

Previously we would just unroll the loop one extra iteration and let other optimisation passes clean up the mess. This worked to a degree but if the loop happened to be nested inside another loop we would end up with phi chains that would block other passes from being able to do the cleanup.

With this commit we explicitly clone the variables create by lcsaa and insert them directly in the last continue branch after we are done unrolling. With this optimisation passes can recognise both sides of the if output the same values and can progress further.

Could help with the issues described in #6051 (closed)

Edited by Timothy Arceri

Merge request reports