nir/algebraic: Additional D3D Boolean optimization

I observed this pattern in several shaders in Hand of Fate 2 while
investigating bugzilla #111490.  This also led to the related
bugzilla #111578.  The shaders from HoF2 are *not* in shader-db.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>

Skylake and Ice Lake had similar results. (Ice Lake shown)
total instructions in shared programs: 16222621 -> 16205419 (-0.11%)
instructions in affected programs: 798418 -> 781216 (-2.15%)
helped: 548
HURT: 0
helped stats (abs) min: 2 max: 158 x̄: 31.39 x̃: 35
helped stats (rel) min: 0.45% max: 28.64% x̄: 2.83% x̃: 2.09%
95% mean confidence interval for instructions value: -33.22 -29.56
95% mean confidence interval for instructions %-change: -3.11% -2.56%
Instructions are helped.

total cycles in shared programs: 364676209 -> 363345763 (-0.36%)
cycles in affected programs: 112810504 -> 111480058 (-1.18%)
helped: 546
HURT: 7
helped stats (abs) min: 2 max: 118913 x̄: 2439.77 x̃: 2340
helped stats (rel) min: 0.08% max: 37.56% x̄: 1.46% x̃: 1.08%
HURT stats (abs)   min: 2 max: 770 x̄: 238.00 x̃: 43
HURT stats (rel)   min: 0.02% max: 11.24% x̄: 3.71% x̃: 0.35%
95% mean confidence interval for cycles value: -2884.33 -1927.41
95% mean confidence interval for cycles %-change: -1.59% -1.21%
Cycles are helped.

total spills in shared programs: 8870 -> 8514 (-4.01%)
spills in affected programs: 1230 -> 874 (-28.94%)
helped: 161
HURT: 0

total fills in shared programs: 21901 -> 21348 (-2.52%)
fills in affected programs: 2120 -> 1567 (-26.08%)
helped: 155
HURT: 5

Broadwell and Haswell had similar results. (Broadwell shown)
total instructions in shared programs: 14994910 -> 14975495 (-0.13%)
instructions in affected programs: 839033 -> 819618 (-2.31%)
helped: 548
HURT: 0
helped stats (abs) min: 2 max: 299 x̄: 35.43 x̃: 49
helped stats (rel) min: 0.39% max: 19.89% x̄: 2.91% x̃: 2.22%
95% mean confidence interval for instructions value: -37.46 -33.40
95% mean confidence interval for instructions %-change: -3.12% -2.70%
Instructions are helped.

total cycles in shared programs: 386032453 -> 384450722 (-0.41%)
cycles in affected programs: 117807357 -> 116225626 (-1.34%)
helped: 547
HURT: 6
helped stats (abs) min: 2 max: 22096 x̄: 2892.01 x̃: 3926
helped stats (rel) min: 0.17% max: 10.34% x̄: 1.56% x̃: 1.31%
HURT stats (abs)   min: 4 max: 60 x̄: 32.83 x̃: 29
HURT stats (rel)   min: 0.38% max: 12.79% x̄: 5.86% x̃: 4.65%
95% mean confidence interval for cycles value: -3060.28 -2660.27
95% mean confidence interval for cycles %-change: -1.59% -1.37%
Cycles are helped.

total spills in shared programs: 23372 -> 21869 (-6.43%)
spills in affected programs: 11730 -> 10227 (-12.81%)
helped: 352
HURT: 0

total fills in shared programs: 34747 -> 35351 (1.74%)
fills in affected programs: 11013 -> 11617 (5.48%)
helped: 3
HURT: 347

Ivy Bridge and Sandybridge had similar results. (Ivy Bridge shown)
total instructions in shared programs: 11956420 -> 11956126 (<.01%)
instructions in affected programs: 14898 -> 14604 (-1.97%)
helped: 98
HURT: 0
helped stats (abs) min: 3 max: 3 x̄: 3.00 x̃: 3
helped stats (rel) min: 1.30% max: 3.57% x̄: 2.08% x̃: 2.00%
95% mean confidence interval for instructions value: -3.00 -3.00
95% mean confidence interval for instructions %-change: -2.18% -1.98%
Instructions are helped.

total cycles in shared programs: 178791217 -> 178790792 (<.01%)
cycles in affected programs: 149763 -> 149338 (-0.28%)
helped: 91
HURT: 7
helped stats (abs) min: 3 max: 107 x̄: 20.63 x̃: 16
helped stats (rel) min: 0.13% max: 6.91% x̄: 1.40% x̃: 1.18%
HURT stats (abs)   min: 3 max: 322 x̄: 207.43 x̃: 322
HURT stats (rel)   min: 0.14% max: 19.85% x̄: 12.73% x̃: 17.41%
95% mean confidence interval for cycles value: -18.94 10.27
95% mean confidence interval for cycles %-change: -1.28% 0.49%
Inconclusive result (value mean confidence interval includes 0).
40 jobs for !1920 with review/bug-111490 in 27 minutes and 11 seconds (queued for 3 seconds)
latest detached
Status Job ID Name Coverage
  Containers
passed #633949
debian-10

00:02:35

passed #633950
debian-9

00:01:14

passed #633951
aarch64
test-container:arm64

00:00:21

 
  Build
passed #633954
meson-arm64

00:05:39

passed #633953
meson-armhf

00:02:58

passed #633956
meson-clang

00:07:19

passed #633959
meson-clover

00:06:36

passed #633960
meson-clover-old-llvm

00:05:35

passed #633962
meson-i386

00:03:54

passed #633952
meson-main

00:09:31

passed #633955
meson-swr-glvnd

00:06:00

passed #633961
meson-vulkan

00:02:55

passed #633963
scons

00:09:20

passed #633964
scons-old-llvm

00:07:37

passed #633957
scons-swr

00:08:07

passed #633958
scons-win64

00:06:49

 
  Test
passed #633985
db410c
arm64_a306_gles2 1/4

00:08:51

passed #633986
db410c
arm64_a306_gles2 2/4

00:10:34

passed #633987
db410c
arm64_a306_gles2 3/4

00:08:28

passed #633988
db410c
arm64_a306_gles2 4/4

00:04:33

passed #633974
mesa-cheza
arm64_a630_gles2

00:04:59

passed #633975
mesa-cheza
arm64_a630_gles31 1/4

00:06:16

passed #633976
mesa-cheza
arm64_a630_gles31 2/4

00:07:46

passed #633977
mesa-cheza
arm64_a630_gles31 3/4

00:07:48

passed #633978
mesa-cheza
arm64_a630_gles31 4/4

00:07:10

passed #633979
mesa-cheza
arm64_a630_gles3 1/6

00:04:47

passed #633980
mesa-cheza
arm64_a630_gles3 2/6

00:04:19

passed #633981
mesa-cheza
arm64_a630_gles3 3/6

00:03:50

passed #633982
mesa-cheza
arm64_a630_gles3 4/6

00:04:31

passed #633983
mesa-cheza
arm64_a630_gles3 5/6

00:04:09

passed #633984
mesa-cheza
arm64_a630_gles3 6/6

00:04:00

passed #633965
test-llvmpipe-gles2 1/4

00:03:25

passed #633966
test-llvmpipe-gles2 2/4

00:03:44

passed #633967
test-llvmpipe-gles2 3/4

00:03:22

passed #633968
test-llvmpipe-gles2 4/4

00:03:27

passed #633969
test-softpipe-gles2 1/4

00:01:26

passed #633970
test-softpipe-gles2 2/4

00:01:34

passed #633971
test-softpipe-gles2 3/4

00:01:16

passed #633972
test-softpipe-gles2 4/4

00:01:30

passed #633973
test-softpipe-gles3-limited

00:03:43