nir/algebraic: Distribute source modifiers into instructions

Perform this pass after nir_lower_to_source_mods on the assumption that
any remaining source modifier-like instructions will result in actual
instructions.  In many cases the can be propagated into the instructions
that generate the value (e.g., -(a*b) = (-a)*b).

In addition to the operations implemtned in this patch, I also tried:

 - frcp - Helped 6 or fewer shaders on Gen7+, and hurt just as many on
   pre-Gen7.  On Gen6 and earlier, frcp is a math box instruction, and
   math box instructions cannot have source modifiers.

 - bcsel - Hurt a few shaders with none helped.  bcsel operates on
   integer sources, so the fabs or fneg cannot be a source modifier in
   the bcsel itself.

 - Integer instructions - No changes on any Intel platform.

If / when we stop doing nir_lower_to_source_mods, we'll have to think
of a different way to accomplish this.

All Gen8+ platforms had similar results. (Ice Lake shown)
total instructions in shared programs: 16249518 -> 16239218 (-0.06%)
instructions in affected programs: 919750 -> 909450 (-1.12%)
helped: 6239
HURT: 2
helped stats (abs) min: 1 max: 12 x̄: 1.65 x̃: 1
helped stats (rel) min: 0.07% max: 17.65% x̄: 1.64% x̃: 1.18%
HURT stats (abs)   min: 1 max: 1 x̄: 1.00 x̃: 1
HURT stats (rel)   min: 3.45% max: 3.70% x̄: 3.58% x̃: 3.58%
95% mean confidence interval for instructions value: -1.68 -1.62
95% mean confidence interval for instructions %-change: -1.67% -1.60%
Instructions are helped.

total cycles in shared programs: 365373580 -> 365340312 (<.01%)
cycles in affected programs: 6093963 -> 6060695 (-0.55%)
helped: 4212
HURT: 1104
helped stats (abs) min: 1 max: 212 x̄: 15.77 x̃: 5
helped stats (rel) min: <.01% max: 34.78% x̄: 2.09% x̃: 1.23%
HURT stats (abs)   min: 1 max: 428 x̄: 30.05 x̃: 6
HURT stats (rel)   min: 0.03% max: 36.55% x̄: 2.85% x̃: 1.04%
95% mean confidence interval for cycles value: -7.31 -5.20
95% mean confidence interval for cycles %-change: -1.17% -0.95%
Cycles are helped.

Sandy Bridge, Ivy Bridge, and Haswell had similar results. (Haswell shown)
total instructions in shared programs: 13318340 -> 13311379 (-0.05%)
instructions in affected programs: 573966 -> 567005 (-1.21%)
helped: 3815
HURT: 80
helped stats (abs) min: 1 max: 12 x̄: 1.85 x̃: 1
helped stats (rel) min: 0.07% max: 15.25% x̄: 1.69% x̃: 1.51%
HURT stats (abs)   min: 1 max: 1 x̄: 1.00 x̃: 1
HURT stats (rel)   min: 0.43% max: 4.76% x̄: 1.10% x̃: 1.06%
95% mean confidence interval for instructions value: -1.82 -1.75
95% mean confidence interval for instructions %-change: -1.67% -1.59%
Instructions are helped.

total cycles in shared programs: 374497811 -> 374453577 (-0.01%)
cycles in affected programs: 4933216 -> 4888982 (-0.90%)
helped: 2651
HURT: 469
helped stats (abs) min: 1 max: 1172 x̄: 22.22 x̃: 16
helped stats (rel) min: <.01% max: 20.29% x̄: 2.46% x̃: 1.68%
HURT stats (abs)   min: 1 max: 338 x̄: 31.29 x̃: 14
HURT stats (rel)   min: 0.08% max: 63.06% x̄: 3.30% x̃: 1.11%
95% mean confidence interval for cycles value: -15.82 -12.54
95% mean confidence interval for cycles %-change: -1.75% -1.43%
Cycles are helped.

GM45 and Iron Lake had similar results. (Iron Lake shown)
total instructions in shared programs: 8123138 -> 8118996 (-0.05%)
instructions in affected programs: 423026 -> 418884 (-0.98%)
helped: 1955
HURT: 0
helped stats (abs) min: 1 max: 3 x̄: 2.12 x̃: 3
helped stats (rel) min: 0.22% max: 8.33% x̄: 1.21% x̃: 1.07%
95% mean confidence interval for instructions value: -2.16 -2.08
95% mean confidence interval for instructions %-change: -1.25% -1.17%
Instructions are helped.

total cycles in shared programs: 188513724 -> 188502818 (<.01%)
cycles in affected programs: 12490132 -> 12479226 (-0.09%)
helped: 1737
HURT: 15
helped stats (abs) min: 2 max: 28 x̄: 6.30 x̃: 4
helped stats (rel) min: <.01% max: 6.57% x̄: 0.21% x̃: 0.09%
HURT stats (abs)   min: 2 max: 6 x̄: 2.80 x̃: 2
HURT stats (rel)   min: 0.02% max: 0.23% x̄: 0.09% x̃: 0.08%
95% mean confidence interval for cycles value: -6.40 -6.05
95% mean confidence interval for cycles %-change: -0.23% -0.19%
Cycles are helped.
17 jobs for !1359 with review/source-modifiers in 15 minutes and 3 seconds (queued for 4 seconds)
detached
Status Job ID Name Coverage
  Containers Build
passed #515875
debian

00:00:22

 
  Build+Test
passed #515884
meson-arm64

00:03:33

passed #515883
meson-armhf

00:03:26

passed #515877
meson-clang

00:09:26

passed #515881
meson-clover

00:09:54

passed #515885
meson-i386

00:03:59

passed #515880
meson-main

00:10:58

passed #515876
meson-swr-glvnd

00:06:46

passed #515882
meson-vulkan

00:04:14

passed #515887
scons-llvm

00:07:13

passed #515886
scons-nollvm

00:04:31

passed #515878
scons-swr

00:06:26

passed #515879
scons-win64

00:06:52

 
  Test
passed #515888
test-llvmpipe-gles2 1/4

00:03:11

passed #515889
test-llvmpipe-gles2 2/4

00:03:39

passed #515890
test-llvmpipe-gles2 3/4

00:03:00

passed #515891
test-llvmpipe-gles2 4/4

00:02:13