Skip to content

nir/opt_loop: move loop control-flow optimizations into separate pass

Daniel Schürmann requested to merge daniel-schuermann/mesa:nir_opt_loop into main

This is something, I already wanted to do a long time ago. The new nir_opt_loop() pass combines all pattern from

  • nir_opt_trivial_continues()
  • nir_opt_if/opt_if_last_continue()
  • nir_opt_if/opt_merge_breaks()
  • nir_opt_if/opt_if_loop_terminator()

while at the same time generalizing and simplifying them.

Please check for significant stats changes as this new pass is slightly more aggressive than previously. It also removes the aggressive_last_continue option from nir_opt_if(), so there is no conservative option anymore.

Edited by Daniel Schürmann

Merge request reports