nir: add heuristic for instructions in loops with GCM
Moving instructions out of large loops tends to cause excessive spilling. This appears to be a good limit on my BDW Intel GPU.
In future it might make sense to make this a NIR options so other drivers can set their own limits.
shader-db results IRIS (BDW):
total instructions in shared programs: 16388045 -> 16387586 (<.01%)
instructions in affected programs: 142201 -> 141742 (-0.32%)
helped: 182
HURT: 47
total cycles in shared programs: 889823101 -> 888711761 (-0.12%)
cycles in affected programs: 169948098 -> 168836758 (-0.65%)
helped: 1007
HURT: 116
total loops in shared programs: 4928 -> 4923 (-0.10%)
loops in affected programs: 10 -> 5 (-50.00%)
helped: 5
HURT: 0
total spills in shared programs: 19251 -> 19251 (0.00%)
spills in affected programs: 0 -> 0
helped: 0
HURT: 0
total fills in shared programs: 23008 -> 23008 (0.00%)
fills in affected programs: 0 -> 0
helped: 0
HURT: 0
LOST: 0
GAINED: 3
Closes: #2899 (closed)