i965/fs: Merge CMP and SEL into CSEL on Gen8+

v2: Fix several problems handling inverted predicates.  Add a much
bigger comment around the BRW_CONDITIONAL_NZ case.

v3: Allow uniforms and shader inputs as sources for the original SEL and
CMP instructions.  This enables a LOT more shaders to receive CSEL
merging (5816 vs 8564 on SKL).

v4: Report progress.

Broadwell and Skylake had similar results. (Broadwell shown)
helped: 8527
HURT: 0
helped stats (abs) min: 1 max: 27 x̄: 2.44 x̃: 1
helped stats (rel) min: 0.03% max: 17.80% x̄: 1.12% x̃: 0.70%
95% mean confidence interval for instructions value: -2.51 -2.36
95% mean confidence interval for instructions %-change: -1.15% -1.10%
Instructions are helped.

total cycles in shared programs: 559442317 -> 558288357 (-0.21%)
cycles in affected programs: 372699860 -> 371545900 (-0.31%)
helped: 6748
HURT: 1450
helped stats (abs) min: 1 max: 32000 x̄: 182.41 x̃: 12
helped stats (rel) min: <.01% max: 66.08% x̄: 3.42% x̃: 0.70%
HURT stats (abs)   min: 1 max: 2538 x̄: 53.08 x̃: 14
HURT stats (rel)   min: <.01% max: 96.72% x̄: 3.32% x̃: 0.90%
95% mean confidence interval for cycles value: -179.01 -102.51
95% mean confidence interval for cycles %-change: -2.37% -2.08%
Cycles are helped.

LOST:   0
GAINED: 6

No changes on earlier platforms.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> [v1]
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> [v3]
Reviewed-by: Matt Turner <mattst88@gmail.com>
50 jobs for !2823 with wip/fs-csel in 43 minutes and 1 second (queued for 9 seconds)
latest detached
Status Job ID Name Coverage
  Container
passed #988595
aarch64
arm_build

00:00:27

passed #988596
aarch64
arm_test

00:00:17

passed #988591
lava_arm64

00:00:20

passed #988590
lava_armhf

00:00:23

passed #988592
x86_build

00:00:20

passed #988594
x86_build_old

00:00:19

passed #988593
x86_test

00:00:20

 
  Build
passed #988598
lava-build:arm64

00:04:52

passed #988597
lava-build:armhf

00:04:58

passed #988601
aarch64
meson-arm64

00:09:13

passed #988600
aarch64
meson-armhf

00:04:25

passed #988603
meson-clang

00:08:14

passed #988606
meson-clover

00:06:18

passed #988607
meson-clover-old-llvm

00:06:13

passed #988609
meson-i386

00:03:59

passed #988599
meson-main

00:14:04

passed #988610
meson-mingw32-x86_64

00:03:53

passed #988602
meson-swr-glvnd

00:04:05

passed #988608
meson-vulkan

00:04:25

passed #988611
scons

00:10:53

passed #988612
scons-old-llvm

00:06:14

passed #988604
scons-swr

00:07:09

passed #988605
scons-win64

00:05:34

 
  Test
passed #988636
db410c
arm64_a306_gles2 1/4

00:08:29

passed #988637
db410c
arm64_a306_gles2 2/4

00:07:27

passed #988638
db410c
arm64_a306_gles2 3/4

00:06:30

passed #988639
db410c
arm64_a306_gles2 4/4

00:08:33

passed #988625
mesa-cheza
arm64_a630_gles2

00:05:19

passed #988626
mesa-cheza
arm64_a630_gles31 1/4

00:05:04

passed #988627
mesa-cheza
arm64_a630_gles31 2/4

00:05:47

passed #988628
mesa-cheza
arm64_a630_gles31 3/4

00:05:47

passed #988629
mesa-cheza
arm64_a630_gles31 4/4

00:04:55

passed #988630
mesa-cheza
arm64_a630_gles3 1/6

00:03:41

passed #988631
mesa-cheza
arm64_a630_gles3 2/6

00:04:07

passed #988632
mesa-cheza
arm64_a630_gles3 3/6

00:03:48

passed #988633
mesa-cheza
arm64_a630_gles3 4/6

00:03:53

passed #988634
mesa-cheza
arm64_a630_gles3 5/6

00:03:47

passed #988635
mesa-cheza
arm64_a630_gles3 6/6

00:04:06

passed #988613
lava-rk3288-veyron-jaq
panfrost-t760-test:armhf

00:05:32

passed #988614
lava-rk3399-gru-kevin
panfrost-t860-test:arm64

00:04:50

passed #988616
piglit-glslparser+quick_shader

00:07:40

passed #988615
piglit-quick_gl

00:11:17

passed #988617
test-llvmpipe-gles2

00:05:09

passed #988618
test-softpipe-gles2

00:02:05

passed #988621
test-softpipe-gles31 1/4

00:03:05

passed #988619
test-softpipe-gles3 1/2

00:04:58

passed #988622
test-softpipe-gles31 2/4

00:04:34

passed #988623
test-softpipe-gles31 3/4

00:04:46

passed #988624
test-softpipe-gles31 4/4

00:03:36

passed #988620
test-softpipe-gles3 2/2

00:05:13