Skip to content

intel/compiler: exit NIR optimization loop early if no more progress will be made

This is similar to what RADV implements using the NIR_LOOP_PASS helpers. I have not used those helpers for a couple of reasons:

  1. They use the pointer to the optimization function, which doesn't work if the same function is called multiple times in one invocation of the loop (fixable)
  2. After fixing them, due to Intel's use of sub-expressions, the amount of code added to wrap the shared macro becomes more than simply reimplementing them for the Intel compiler

On most workloads the results are a wash, but on compile heavy workloads like Cyberpunk 2077 and Rise of the Tomb Raider, I saw fossil-db runtimes fall by 1-2%, with no changes to the compiled shaders.

Merge request reports