nir/opt_algebraic: Add fmul(a, 2.0) -> fadd(a, a)

Investigated for Bifrost, but should be the same or cheaper for any
reasonable architecture. For the compilers I maintain:

* Bifrost - fadd can be scheduled 2x as frequently as ffma, there is no
  fmul separate from ffma.
* Midgard - fadd x, x is used as a canonical form, again for easier
  scheduling.
* AGX - fmul and fadd are both native ops, but fmul is heavier weight
  (unknown whether this is a performance issue or just power
   consumption). Also saves a move / uniform file slot for the constant.

Since floating point multiplication is inherently more expensive than
addition, presumably this is a win for everyone else too.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
131 jobs for !10670 with nir-fmul-two in 8 seconds (queued for 8 seconds)
latest detached
Status Job ID Name Coverage
  Sanity
passed #9548907
sanity

00:00:08

 
  Container
manual #9548910
aarch64 manual
arm_build
manual #9548911
windows shell 1809 mesa manual
windows_build_vs2019
manual #9548908
manual
x86_build-base
manual #9548909
manual
x86_test-base
 
  Container 2
created #9548916
android_build
created #9548913
i386_build
created #9548919
kernel+rootfs_amd64
created #9548920
aarch64
kernel+rootfs_arm64
created #9548921
aarch64
kernel+rootfs_armhf
created #9548914
ppc64el_build
created #9548915
s390x_build
created #9548912
x86_build
created #9548917
x86_test-gl
created #9548918
x86_test-vk
 
  Meson X86 64
created #9548927
meson-clang
created #9548928
meson-clover
created #9548924
meson-clover-testing
created #9548925
meson-gallium
created #9548926
meson-release
created #9548922
meson-testing
created #9548923
meson-testing-asan
created #9548929
meson-vulkan
 
  Build Misc
created #9548930
arm_test
created #9548931
meson-android
created #9548933
aarch64
meson-arm64
created #9548934
aarch64
meson-arm64-asan
created #9548935
aarch64
meson-arm64-build-test
created #9548932
aarch64
meson-armhf
created #9548937
meson-i386
created #9548940
meson-mingw32-x86_64
created #9548939
meson-ppc64el
created #9548938
kvm
meson-s390x
created #9548936
windows docker 1809 mesa
meson-windows-vs2019
 
  Amd
created #9548942
mesa-ci-aarch64-lava-collabora
radeonsi-stoney-gles2:amd64
created #9548945
mesa-ci-aarch64-lava-collabora
radeonsi-stoney-gles31:amd64 1/2
created #9548946
mesa-ci-aarch64-lava-collabora
radeonsi-stoney-gles31:amd64 2/2
created #9548943
mesa-ci-aarch64-lava-collabora
radeonsi-stoney-gles3:amd64 1/2
created #9548944
mesa-ci-aarch64-lava-collabora
radeonsi-stoney-gles3:amd64 2/2
created #9548948
mesa-ci-aarch64-lava-collabora
radeonsi-stoney-piglit-gl:amd64
created #9548947
mesa-ci-aarch64-lava-collabora
radeonsi-stoney-traces:amd64
created #9548941
radv-fossils
 
  Intel
created #9548951
mesa-ci-aarch64-lava-collabora manual
iris-amly-traces:amd64
created #9548949
mesa-ci-aarch64-lava-collabora manual
iris-apl-traces:amd64
created #9548950
mesa-ci-aarch64-lava-collabora manual
iris-glk-traces:amd64
 
  Arm
created #9548960
mesa-ci-aarch64-lava-collabora
panfrost-g52-gles2:arm64
created #9548963
mesa-ci-aarch64-lava-collabora
panfrost-g52-gles31:arm64
created #9548961
mesa-ci-aarch64-lava-collabora
panfrost-g52-gles3:arm64 1/2
created #9548962
mesa-ci-aarch64-lava-collabora
panfrost-g52-gles3:arm64 2/2
created #9548952
mesa-ci-aarch64-lava-collabora
panfrost-t720-gles2:arm64
created #9548953
mesa-ci-aarch64-lava-collabora
panfrost-t760-gles2:armhf
created #9548954
mesa-ci-aarch64-lava-collabora
panfrost-t760-traces:armhf
created #9548955
mesa-ci-aarch64-lava-collabora
panfrost-t860-gles2:arm64
created #9548958
mesa-ci-aarch64-lava-collabora
panfrost-t860-gles31:arm64
created #9548956
mesa-ci-aarch64-lava-collabora
panfrost-t860-gles3:arm64 1/2
created #9548957
mesa-ci-aarch64-lava-collabora
panfrost-t860-gles3:arm64 2/2
created #9548959
mesa-ci-aarch64-lava-collabora
panfrost-t860-traces:arm64
 
  Broadcom
created #9548974
igalia-rpi4
v3d-rpi4-gles2:armhf
created #9548968
igalia-rpi4
v3d-rpi4-gles31:armhf 1/2
created #9548969
igalia-rpi4
v3d-rpi4-gles31:armhf 2/2
created #9548970
igalia-rpi4
v3d-rpi4-gles3:armhf 1/4
created #9548971
igalia-rpi4
v3d-rpi4-gles3:armhf 2/4
created #9548972
igalia-rpi4
v3d-rpi4-gles3:armhf 3/4
created #9548973
igalia-rpi4
v3d-rpi4-gles3:armhf 4/4
created #9548975
igalia-rpi4
v3dv-rpi4-vk:armhf 1/6
created #9548976
igalia-rpi4
v3dv-rpi4-vk:armhf 2/6
created #9548977
igalia-rpi4
v3dv-rpi4-vk:armhf 3/6
created #9548978
igalia-rpi4
v3dv-rpi4-vk:armhf 4/6
created #9548979
igalia-rpi4
v3dv-rpi4-vk:armhf 5/6
created #9548980
igalia-rpi4
v3dv-rpi4-vk:armhf 6/6
created #9548964
igalia-rpi3
vc4-rpi3-gles2:armhf 1/4
created #9548965
igalia-rpi3
vc4-rpi3-gles2:armhf 2/4
created #9548966
igalia-rpi3
vc4-rpi3-gles2:armhf 3/4
created #9548967
igalia-rpi3
vc4-rpi3-gles2:armhf 4/4
 
  Freedreno
created #9548981
google-freedreno-db410c
a306_gles2
created #9548982
google-freedreno-db410c
a306_gles3 1/3
created #9548983
google-freedreno-db410c
a306_gles3 2/3
created #9548984
google-freedreno-db410c
a306_gles3 3/3
created #9548985
google-freedreno-db410c
a306_gles3_options
created #9548986
google-freedreno-db410c
a306-traces
created #9548987
google-freedreno-db820c
a530_gles2
created #9548990
google-freedreno-db820c
a530_gles31 1/2
created #9548988
google-freedreno-db820c
a530_gles3 1/2
created #9548991
google-freedreno-db820c
a530_gles31 2/2
created #9548989
google-freedreno-db820c
a530_gles3 2/2
created #9548992
google-freedreno-db820c
a530_piglit_gl
created #9548993
google-freedreno-db820c
a530_piglit_shader
created #9548994
google-freedreno-db820c
a530-traces
created #9548999
google-freedreno-cheza
a630_egl
created #9548998
google-freedreno-cheza
a630_gl
created #9548995
google-freedreno-cheza
a630_gles2
created #9548997
google-freedreno-cheza
a630_gles3
created #9548996
google-freedreno-cheza
a630_gles31
created #9549000
google-freedreno-cheza
a630_gles_others
created #9549004
google-freedreno-cheza
a630_piglit
created #9549005
google-freedreno-cheza
a630-traces
created #9549001
google-freedreno-cheza
a630_vk 1/2
created #9549002
google-freedreno-cheza
a630_vk 2/2
created #9549003
google-freedreno-cheza
a630_vk_sysmem
 
  Software Renderer
created #9549024
lavapipe-vk
created #9549013
llvmpipe-egl
created #9549011
llvmpipe-gles2
created #9549012
llvmpipe-khr-gles2
created #9549006
llvmpipe-piglit-cl
created #9549008
llvmpipe-piglit-glslparser
created #9549007
llvmpipe-piglit-quick_gl
created #9549009
llvmpipe-piglit-quick_shader
created #9549010
llvmpipe-traces
created #9549021
softpipe-asan-gles31
created #9549023
softpipe-gl
created #9549014
softpipe-gles2
created #9549015
softpipe-gles3
created #9549016
softpipe-gles31 1/2
created #9549017
softpipe-gles31 2/2
created #9549018
softpipe-khr-gles2
created #9549019
softpipe-khr-gles3
created #9549020
softpipe-khr-gles31
created #9549022
softpipe-piglit-quick
 
  Layered Backends
created #9549037
windows docker 1809 mesa
test-d3d12-windows
created #9549029
virgl-gl30-on-gl
created #9549030
virgl-gl31-on-gl
created #9549031
virgl-gl32-on-gl
created #9549025
virgl-gles2-on-gl
created #9549027
virgl-gles31-on-gl 1/2
created #9549028
virgl-gles31-on-gl 2/2
created #9549026
virgl-gles3-on-gl
created #9549032
virgl-traces
created #9549036
zink-lvp-gl
created #9549034
zink-lvp-gles2
created #9549035
zink-lvp-gles3
created #9549033
zink-piglit-quick_gl