nir: add loop unroll support for wrapper loops

Graphics / Mesa 3D Graphics Library / Mesa - Timothy Arceri [itsqueeze.com] - 29 August 2018 06:02 EDT

This adds support for unrolling the classic

do { // ... } while (false)

that is used to wrap multi-line macros. GLSL IR also wraps switch statements in a loop like this.

shader-db results IVB:

total loops in shared programs: 2515 -> 2512 (-0.12%) loops in affected programs: 33 -> 30 (-9.09%) helped: 3 HURT: 0

5db981952a nir: add loop unroll support for wrapper loops
src/compiler/nir/nir_opt_loop_unroll.c | 77 ++++++++++++++++++++++++++++++++++
1 file changed, 77 insertions(+)

Upstream: cgit.freedesktop.org


  • Share