nir: unroll loops, based on non-add incrementation

Yevhenii Kolesnikov requested to merge GL/mesa:opt/nir_unroll_empirically into main

If loop iterator is incremented with something other than regular addition, it would be more error prone to calculate the number of iterations theoretically. What we can do instead, is try to emulate the loop, and determine the number of iterations empirically.

These operations are covered:

  • imul
  • fmul
  • ishl
  • ishr
  • ushr

Also add unit tests for loop unrollment.

No shaderdb changes.

Signed-off-by: Yevhenii Kolesnikov

This is a rework of !1935 (closed)

Edited by Jordan Justen

Merge request reports