Skip to content

nine: use separate register for aL emulation

Pavel Ondračka requested to merge ondracka/mesa:nine_loops_two_registers into main

NIR loop unrolling is only working if the loop counter is a scalar. So keep the loop counter separate and move the aL emulation to a new register. This allows NIR loop unrolling with vec4 backends where unconditional scalarizing of phi nodes is undesirable, like for example r300.

I still need to do more testing with real apps, but so far it seems to help the unrolling and there are no regressions with @okias piglit branch of nine tests. So sending out now to hopefully get some feedback whether this is the correct path of if completely different approach is needed.

I originally wanted to scalarize just the problematic phis, see !20881 (closed), which would allow the unrolling without any nine changes, however after consultation with Anholt I went for another approach of shrinking the phis instead. This already works for the REP ... ENDREP where only single phi component is used, but this nine change is unfortunately needed to make it work also for the LOOP ... ENDLOOP cases.

Closes: #7222 (closed)

Merge request reports